81 lines
1.7 KiB
Vue
81 lines
1.7 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 class="tabbar" style="background: linear-gradient(to right, #019c88, #2dbe93); border-radius: 50rpx;"
|
|
@click="goNav()" >重新上传</view>
|
|
</view>
|
|
<u-empty v-show="photoList.length==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: {
|
|
goNav(){
|
|
uni.navigateTo({
|
|
url:'/pages/xingxiangzhao/index'
|
|
})
|
|
},
|
|
// 详情
|
|
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>
|
|
|
|
.tabbar {
|
|
width: 690upx;
|
|
height: 86upx;
|
|
background: #019c88;
|
|
border-radius: 8upx;
|
|
margin: 0 auto;
|
|
text-align: center;
|
|
line-height: 86upx;
|
|
color: #FFFFFF;
|
|
margin-top: 20rpx;
|
|
}
|
|
</style> |