<template>
	<view class="content">
		<z-nav-bar title="医生证书" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
		<view class="url_block">
			<view v-for="item in urlArr" :key="item" class="item_url">
				<image mode="aspectFit"
				  :src="item"
				  @click="showImg(item)"
				></image>
			</view>
		</view>
	</view>
</template>

<script>
import $http from "@/config/requestConfig.js";
export default {
	data() {
		return {
			urlArr: []
		}
	},
	onLoad(e) {
		let data = JSON.parse(e.data);
		let arr = data.flatMap(item =>
		  item.certificateUrl.split(',').map(v => v)
		);
		this.urlArr = arr;
	},
	methods: {
		//展示图片
		showImg(item){
			uni.previewImage({
				urls: [item],
				current: 0
			});
		}
	},
}
</script>

<style lang="scss" scoped>
@import '@/static/mixin.scss';
.url_block{
	padding: 30rpx 30rpx 10rpx;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
}
.item_url{
	width: 48%;
	background: rgba(216, 230, 255, 0.8);
	border: 1rpx solid #d8e6ff;
	margin-bottom: 20rpx;
	margin-right: 20rpx;

	image{
		width: 100%;
		height: 280rpx;
	}
}
.item_url:nth-child(2n){
	margin-right: 0;
}
</style>