From 905afa72079ff4948534bd96b9b7866b20291825 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期三, 12 七月 2023 19:08:26 +0800 Subject: [PATCH] 修改验质图片错误,增加图片回显 --- pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue index 6f7b9ba..fa844c4 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue @@ -116,7 +116,21 @@ @click="productNamePopoverShow(i)"></u-tag> </view> </view> - <view class="" + <view style="display: flex;margin-top: 20rpx;margin-left: 20rpx;" + v-if="item.isImage"> + <view style="width: 100px;" + v-for="(val,index) in item.inspectionJpg" + :key="index"> + <u--image :showLoading="true" + :src="`${BaseUrl}${val}`" + width="80px" + height="80px"> + <view slot="error" + style="font-size: 24rpx;">鍔犺浇澶辫触</view> + </u--image> + </view> + </view> + <view v-else style="margin-top: 8rpx;"> <u-upload :fileList="item.fileList" deletable @@ -162,6 +176,7 @@ <script> import { BaseUrl } from '@/api/publicInterface.js'; import { onlineurl } from '@/api/request.js' + import backtop from '../../../../../uni_modules/uview-ui/libs/config/props/backtop'; export default { data() { return { @@ -190,6 +205,7 @@ isModify: false, // 涓婁紶鍥剧墖 fileList1: [], + BaseUrl }; }, @@ -220,7 +236,9 @@ ...v, modifyProductName: '', modifygoodsName: '', - fileList: [] + fileList: [], + inspectionJpg: v.inspectionJpg.split(','), + isImage: v.inspectionJpg } }) this.showWeighCopy = JSON.parse(JSON.stringify(this.showWeigh)) @@ -276,7 +294,7 @@ ...v, breed: this.showWeighCopy[i].modifyProductName ? this.showWeighCopy[i].breed : v.breed, spec: this.showWeighCopy[i].modifyProductName ? this.showWeighCopy[i].spec : v.spec, - inspectionJpg: v.fileList.join(',') + inspectionJpg: v.fileList.map(v => v.url.replace(BaseUrl, '')).join(',') } }) @@ -337,7 +355,6 @@ // 鍒犻櫎鍥剧墖 deletePic(event) { this.showWeigh[event.name].fileList.splice(event.index, 1); - // this[`fileList${event.name}`].splice(event.index, 1); }, // 鏂板鍥剧墖 async afterRead(event) { @@ -374,7 +391,6 @@ name: 'file', formData: {}, success: res => { - this.showWeigh[num].fileList.push(JSON.parse(res.data).data.url) resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`); } }); -- Gitblit v1.9.1