From 27b6f29c005b59538d843c58ce6bd86729ecb4ba Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 19 Sep 2023 16:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BagMoney/components/oil-card/oil-card.vue | 7 +++++++ BagStation/pages/oilQRcode/index.vue | 10 +++++++++- components/transBlock/index.vue | 22 +++++++++++++--------- pages/tabbar/home/home.vue | 11 +++++++++-- utils/request.js | 2 +- 5 files changed, 39 insertions(+), 13 deletions(-) diff --git a/BagMoney/components/oil-card/oil-card.vue b/BagMoney/components/oil-card/oil-card.vue index 6227c7a..d6aab39 100644 --- a/BagMoney/components/oil-card/oil-card.vue +++ b/BagMoney/components/oil-card/oil-card.vue @@ -112,6 +112,13 @@ let result = JSON.parse(res.result) if (result.qrcodeText) { serve.checkQrStr(result.giveCustomerId, result.qrcodeText).then(res => { + if (res.code !== 20000) { + uni.showModal({ + title: '', + content: res.msg + }) + return + } let currentCard = this.card || [] this.$emit('buttomPopup', { ...currentCard, diff --git a/BagStation/pages/oilQRcode/index.vue b/BagStation/pages/oilQRcode/index.vue index 8e73dc5..4331b72 100644 --- a/BagStation/pages/oilQRcode/index.vue +++ b/BagStation/pages/oilQRcode/index.vue @@ -8,7 +8,7 @@ {{user.name || ''}} - {{user.userPhone || ''}} + {{phoneHandle}} @@ -36,6 +36,14 @@ created() { this.getQrStr() }, + computed: { + phoneHandle() { + let phone = this.user.userPhone + console.log('user',this.user) + if(!phone) return '' + return `${phone.substr(0,3)}****${phone.substr(-4)}` + } + }, methods: { getQrStr(reset = 0) { console.log('this.user', this.user) diff --git a/components/transBlock/index.vue b/components/transBlock/index.vue index 50188fe..ad12ac5 100644 --- a/components/transBlock/index.vue +++ b/components/transBlock/index.vue @@ -94,11 +94,13 @@ serve.giveCard({ phone: this.user.userPhone }).then(res => { - this.time = 60 - this.params.verifyCodeToken = res.data.verifyCodeToken - this.timefn() - this.isFocus = true - this.$refs.smscodePopup.open() + if(res.code === 20000) { + this.time = 60 + this.params.verifyCodeToken = res.data.verifyCodeToken + this.timefn() + this.isFocus = true + this.$refs.smscodePopup.open() + } }) } @@ -145,10 +147,12 @@ accountCardCode, ...this.params }).then(res => { - this.$refs.indexPopup.close() - this.$refs.smscodePopup.close() - this.$refs.successPopupt.open() - this.$emit('reloadCard') + if(res.code === 20000) { + this.$refs.indexPopup.close() + this.$refs.smscodePopup.close() + this.$refs.successPopupt.open() + this.$emit('reloadCard') + } }) }, diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue index 41f4b06..b5d4ec0 100644 --- a/pages/tabbar/home/home.vue +++ b/pages/tabbar/home/home.vue @@ -872,7 +872,7 @@ }, openScan() { let user = uni.getStorageSync('user') - if(!user) { + if (!user) { uni.showModal({ title: '请您登录', content: "登录星油加油才可以加油 |˛˙꒳​˙)♡", @@ -885,7 +885,7 @@ } } }) - return + return } uni.scanCode({ scanType: 'qrCode', @@ -905,6 +905,13 @@ } accountApi.checkQrStr(result.giveCustomerId, result.qrcodeText).then( res => { + if (res.code !== 20000) { + uni.showModal({ + title: '', + content: res.msg + }) + return + } let currentCard = accountResult.data[0] || [] this.$refs.transBlcok._open({ ...currentCard, diff --git a/utils/request.js b/utils/request.js index 2e10245..96a27f2 100644 --- a/utils/request.js +++ b/utils/request.js @@ -125,7 +125,7 @@ service.interceptors.response.use( }) }, 2000) } - return Promise.reject() + // return Promise.reject() } } }