From f2e9b22a4cd54705700ebb69f5f04de6a7eccce8 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 09 七月 2025 21:14:31 +0800 Subject: [PATCH] no message --- pages/pakin/pakin.vue | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 47 insertions(+), 5 deletions(-) diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index d37fb3e..a30f575 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -126,6 +126,12 @@ <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog> </uni-popup> + </view> + <!-- 骞冲簱搴撲綅鎺ㄨ崘 --> + <view> + <uni-popup ref="recommend" type="dialog"> + <uni-popup-dialog :type="msgType" mode="base" :cancelText="null" confirmText="纭" title="鎺ㄨ崘搴撲綅" :content="recomLoc"></uni-popup-dialog> + </uni-popup> </view> </view> </template> @@ -143,7 +149,8 @@ msgType1: 'success', msgType: 'success', messageText: '', - title: '', + title: '', + recomLoc: '', content: '', barcodeFocus: true, matFocus: false, @@ -340,7 +347,8 @@ this.messageToggle('error') return; } - } + } + uni.request({ url: that.baseUrl + '/pda/comb/auth', data: JSON.stringify({ @@ -355,12 +363,15 @@ success(result) { var res = result.data if (res.code === 200) { - that.resst(); that.messageText = "缁勬墭鎴愬姛" that.messageToggle('success') const innerAudioContext = uni.createInnerAudioContext(); innerAudioContext.src = '/static/music/pakinOk.mp3'; - innerAudioContext.play() + innerAudioContext.play() + if (that.barcode.indexOf('PK') >= 0) { + that.recommendLocs(that) + } + that.resst(); } else if (res.code == 403) { that.messageText = res.msg that.messageToggle('error') @@ -375,7 +386,38 @@ } } }); - }, + }, + + recommendLocs(that) { + uni.request({ + url: that.baseUrl + '/pda/recommend/locs', + method: 'GET', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { + if (res.data != null && res.data != undefined ) { + that.recomLoc = '绯荤粺鎺ㄨ崘灏嗚揣鐗╂斁鑷�:' + res.data.locNo + that.$refs.recommend.open() + } + } else if (res.code == 403) { + that.messageText = res.msg + that.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + that.messageText = res.msg + that.messageToggle('error') + } + } + }); + }, + reset(type) { this.msgType = type this.title = '璀﹀憡' -- Gitblit v1.9.1