<template>
	<view class="" style="width: 100%; background: #fff;">
		<view class="" style="width: 100%;">
			<view class="page-back" v-for="(item,index) in certificateList" :key="index">
				<image :src="item" style="width: 100%; border-radius: 26rpx;" mode="widthFix" @click="saveImg(item)"></image>
			</view>
		</view>
		<u-empty v-show="!certificateList[0]" icon-size="180" text="暂无证件照片" mode="list"></u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				artificerId: '',
				certificateList: []
			}
		},
		onLoad(e) {
			console.log(e)
			this.artificerId = e.artificerId
			this.getDet()
		},
		methods: {
			// 详情
			getDet() {
				uni.showLoading({
					title: '加载中...'

				});
				this.$Request.get("/app/artificer/selectArtificerByArtificerId", {
					artificerId: this.artificerId,
				}).then(res => {
					uni.hideLoading();
					if (res.code == 0) {
						console.log(res.data);
						this.certificateList = res.data.certificate.split(",");
					}
					this.loading = false;
				});
			},
			saveImg(imgs) {
				console.log(imgs)
				let that = this;
				let imgArr = []
				imgArr.push(imgs);
				// //预览图片
				uni.previewImage({
					urls: imgArr,
					current: imgArr[0]
				});
			},
		}
	}
</script>

<style>
	.page-back{
		background: fff;
		padding: 30rpx;
	}
	.page-back img{
		border-radius: 30rpx;
	}
</style>