Files
dvcp_v2_wechat_app/src/project/qujing/AppMine/myCertificate.vue

76 lines
1.5 KiB
Vue
Raw Normal View History

2023-02-21 14:26:25 +08:00
<template>
<div class="page">
<div class="list" v-if="files.length">
<img v-for="(item, index) in files" :key="index" :src="item.imageUrl" alt="" @click="previewImage(index)">
</div>
<AiEmpty :description="`暂无数据`" class="emptyWrap" v-else/>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "myCertificate",
appName: "我的证书",
data() {
return {
files: [],
}
},
computed: {
...mapState(['user', 'token']),
},
onLoad() {
uni.setNavigationBarTitle({
title: '我的证书'
})
uni.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#F4F6FA",
})
},
onLoad() {
this.getFile()
},
methods: {
getFile() {
2023-02-21 14:56:43 +08:00
this.$instance.post(`/app/appcertificateinfo/queryCertificateByApplet`).then(res => {
2023-02-21 14:26:25 +08:00
if (res.code == 0) {
2023-02-21 14:56:43 +08:00
this.files = res.data
2023-02-21 14:26:25 +08:00
}
})
},
previewImage(index) {
var tempList = []
for (var i in this.files) {
tempList.push(this.files[i].imageUrl)
}
uni.previewImage({
current: tempList[index],
urls: tempList
});
},
},
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
background-color: #F4F5FA;
.list {
padding: 50px 0 0 32px;
img {
width: calc(100%/2 - 13px);
height: 462px;
margin: 0 26px 24px 0;
}
img:nth-of-type(2n) {
margin-right: 0;
}
}
}
</style>