61 lines
1.3 KiB
Vue
61 lines
1.3 KiB
Vue
<template>
|
|
<view class="" style="width: 100%;">
|
|
<view class="" style="width: 100%;">
|
|
<view style="width: 100%;margin: 0 auto 20rpx; box-sizing: border-box; padding: 0 20rpx;" v-for="(item,index) in photoList"
|
|
:key="index">
|
|
<image :src="item" style="width: 100%;" mode="widthFix" @click="saveImg(item)"></image>
|
|
</view>
|
|
</view>
|
|
<u-empty v-show="!photoList[0]" icon-size="180" text="暂无生活照片" mode="list"></u-empty>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
|
|
artificerId: '',
|
|
photoList: []
|
|
}
|
|
},
|
|
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.photoList = res.data.lifePhoto.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>
|
|
</style> |