From f6eb2f9bd6f9380c39a352f8386bc6a858e927cd Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Sat, 17 Aug 2024 23:45:55 +0800 Subject: [PATCH] uu --- .../bpd-pic-preview-tmp.vue | 32 +++++++++++---- pages/post/query.vue | 41 +++++++++++++++---- 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/components/buns-post-detail-templates/bpd-pic-preview-tmp.vue b/components/buns-post-detail-templates/bpd-pic-preview-tmp.vue index e4094bf..d1cba6e 100644 --- a/components/buns-post-detail-templates/bpd-pic-preview-tmp.vue +++ b/components/buns-post-detail-templates/bpd-pic-preview-tmp.vue @@ -4,7 +4,7 @@ {{label}} - + 查看 @@ -12,7 +12,7 @@ @@ -28,6 +28,9 @@ if(typeof list == 'string') { list = list.split(",") } + if(!this.canView) { + list = [] + } return list } }, @@ -42,6 +45,12 @@ return [] } }, + canView: { + default () { + return true + } + }, + checkViewFun:{} }, data() { return {} @@ -56,16 +65,23 @@ }, methods: { - handleCheckDanJu(list, type){ - let url = '' - if(list.length == 0) { + async handleCheckDanJu(){ + if(!this.canView) { + if(this.checkViewFun) { + let bl = await this.checkViewFun() + if(!bl) { + return + } + } + } + if(this.dataList.length == 0) { return this.showToast("暂无数据") } - this.handlePreviewCur(list, 0) + this.handlePreviewCur(this.dataList, 0) }, - handlePreviewCur(list, index) { + handlePreviewCur(index) { uni.previewImage({ - urls: list, + urls: this.dataList, current: index }) }, diff --git a/pages/post/query.vue b/pages/post/query.vue index f8b2433..a02ef15 100644 --- a/pages/post/query.vue +++ b/pages/post/query.vue @@ -17,19 +17,19 @@ - - - + + - --> + @@ -56,7 +56,7 @@ - + @@ -97,6 +97,7 @@ components: { BpdSendRecieverTmp, BpdPicPreviewTmp }, data() { return { + canViewImg: false, queryOption: { billCode: '', // 运单id }, @@ -134,12 +135,36 @@ let res = await apiService.getOrderDetail({...this.searchParam, _loading: true}) // 通过对象合并才能修改父级 数据 Object.assign(this.modelInfo, res.data || {}) + // 判断是否有权限查看图片 + this.canViewImg = this.modelInfo.customerCode == this.$store.getters.userInfo.customerCode setTimeout(()=> { this.$refs.lcusRef.initData() }, 300) }, + handleViewImgCheck(){ + this.danCheckModal.show = true + this.danCheckModal.validCode = '' + let curPromise = new Promise((resolve)=> { + this.danCheckModal.submitResolve = resolve + }) + return curPromise + }, handleSubmitDanCheck() { - this.danCheckModal.show = false + let senderPhoneCode = (this.modelInfo.sender?.phone + '').substr(-4); + let recieverPhoneCode = (this.modelInfo.reciever?.phone + '').substr(-4) + let { validCode } = this.danCheckModal + if(validCode == senderPhoneCode || validCode == recieverPhoneCode){ + this.danCheckModal.show = false + this.canViewImg = true + this.showLoading() + setTimeout(()=> { + this.hideLoading() + this.danCheckModal.submitResolve(true) + }, 1500) + } else { + this.danCheckModal.validCode = '' + this.showToast('验证错误,请检查') + } } } }