From c967833534d044cb629d010641461b41260e5f02 Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Tue, 14 Oct 2025 18:29:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E7=BA=A7=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/coinsDetail/index.vue | 95 +++++++++++++++++++++++++-------------------- static/images/editRate.svg | 1 + 2 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 static/images/editRate.svg diff --git a/pages/coinsDetail/index.vue b/pages/coinsDetail/index.vue index 9b07a8c..2511440 100644 --- a/pages/coinsDetail/index.vue +++ b/pages/coinsDetail/index.vue @@ -63,8 +63,8 @@ - - + + 修改评级 @@ -74,34 +74,14 @@ - - 评级部门 - - - - 评级编号 - - - - 分数 - - - - 材质 - - - - 处理 - - - + + + + + + + + @@ -128,10 +108,6 @@ export default { }, data() { return { - newDetailItem:{ - - }, - textObj:{ 0:'进价:', '1':'售价:', @@ -145,7 +121,8 @@ export default { price: '', buying_price:'', price2:'', - isFocus:false + isFocus:false, + detailItemNew:{} } }, computed: { @@ -156,15 +133,11 @@ export default { watch: { scanCodeDetail(newVal, oldVal) { this.detailItem = { ...newVal }//更新 - this.newDetailItem = { ...newVal }//更新 } }, mounted() { if (this.scanCodeDetail && Object.keys(this.scanCodeDetail).length > 0) { this.detailItem = { ...this.scanCodeDetail } - this.$nextTick(() => { - this.newDetailItem = JSON.parse(JSON.stringify(this.scanCodeDetail)) - } ) } }, @@ -173,12 +146,9 @@ export default { if (id) { this.id = id; let detailItem = uni.getStorageSync('detail') - let newDetailItem = uni.getStorageSync('detail') if (detailItem) { this.detailItem = JSON.parse(detailItem) - this.newDetailItem = JSON.parse(newDetailItem) } - console.log(this.newDetailItem,'=newDetailItem'); this.price = this.detailItem.price; // this.price1 = this.detailItem.price1 || '' this.buying_price = this.detailItem.buying_price; @@ -221,7 +191,7 @@ export default { }); }, async onConfirm() { - const params = {...this.newDetailItem} + const params = {...this.detailItemNew} console.log('执行了'); // this.$http.req('/api/update_price', { // ...params @@ -232,6 +202,45 @@ export default { // }).catch(res => { // }); }, + async scanQrcode() { + // this.detailItemNew = {...this.detailItem} + // this.$refs.ratePopup.openPop(); + + // #ifdef MP-WEIXIN + uni.scanCode({ + scanType: ['barCode', 'qrCode'], + success: (res) => { + this.getScanQrcode(res.result) + }, + complete(res) { + if (res.errMsg === 'scanCode:ok') { + console.log('扫码成功11:', res.result, this); + } else if (res.errMsg === 'scanCode:fail cancel') { + console.log('用户取消扫码'); + } else { + uni.showToast({ + title: '扫码失败' + JSON.stringify(res.errMsg), + icon: 'none' + }) + } + } + }) + // #endif + }, + getScanQrcode(result) { + this.$http.req('/api/get_scan_code_detail', { + url: result + }, 'POST').then(data => { + if (data == -1) return + this.detailItemNew = data; + this.$set(this, 'detailItemNew', data) + setTimeout(() => { + this.isShowCoinModal = true + this.$refs.ratePopup.openPop(); + }, 500) + }).catch(res => { + }); + }, } }; diff --git a/static/images/editRate.svg b/static/images/editRate.svg new file mode 100644 index 0000000..ffa67b0 --- /dev/null +++ b/static/images/editRate.svg @@ -0,0 +1 @@ + \ No newline at end of file