<template>
	<view class="my-content">
		<view class="item" v-for="item in certsList">
			<view>{{item.certNumber}}</view>
			<image @click="showImg(item)" :src="it" mode="widthFix" v-for="it in imgList(item.certs)"></image>
		</view>
		
	</view>
</template>
<script>
	import {getConfigByKey} from '@/api/common'
	export default {
		data() {
			return {
				 certsList:[]
			}
		},

		onLoad(val) {
			this.getConfigByKey();
		},
		methods: {
			imgList(imgs){
				return imgs ? imgs.split(','):[]
			},
			getConfigByKey(){
				var that=this;
				var data={key:"his.certs",appId:wx.getAccountInfoSync().miniProgram.appId,}
				getConfigByKey(data).then(
					res => {
						if(res.code==200){
							console.log(JSON.parse(res.data))
							this.certsList=JSON.parse(res.data);
						}
					},
					rej => {}
				);
			},
			showImg(item) {
				 //预览图片
				 uni.previewImage({
					urls: item.certs ? item.certs.split(','):[],
					current: 0
				 });
			},
		}
	}
 
 
</script>


<style scoped lang="scss">
page{
	height: 100%;
}
.my-content{
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	.item{
		image {
			margin: 30rpx;
			width: 100%;
		}
	}
	
}
 

</style>
