From 696329e06310630aee9a422e83106713f1561ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Fri, 3 Mar 2023 16:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/CommodityDetails/CommodityDetails.vue | 26 +++++++++- pages/Personal/Personal.vue | 2 +- pages/integral/integral.vue | 54 ++++++++++++++++----- 3 files changed, 69 insertions(+), 13 deletions(-) diff --git a/pages/CommodityDetails/CommodityDetails.vue b/pages/CommodityDetails/CommodityDetails.vue index f22a9ea..35ba87a 100644 --- a/pages/CommodityDetails/CommodityDetails.vue +++ b/pages/CommodityDetails/CommodityDetails.vue @@ -354,7 +354,31 @@ //步进期 numberchange(e) { this.totalPrice = (this.updata.goodsPrice * this.updata.goodsCount).toFixed(2) - this.Paidinprice = (Number(this.totalPrice) - Number(this.coupon.couponPrice)).toFixed(2) + this.couponListtrue = [] + this.couponListfalse = [] + this.goodsDetailslist.couponList.forEach(e => { + if (this.totalPrice >= e.couponConsumePrice) { + this.couponListtrue.push(e) + } else { + this.couponListfalse.push(e) + } + }) + if (this.couponId) { + this.goodsDetailslist.couponList.forEach(e => { + if (this.couponId == e.couponId) { + if (this.totalPrice >= e.couponConsumePrice) { + this.Paidinprice = (Number(this.totalPrice) - Number(this.coupon.couponPrice)) + .toFixed(2) + } else { + this.couponId = null + this.Paidinprice = null + this.coupon = null + } + } + }) + } else { + this.Paidinprice = null + } }, buyshowtrue() { this.buyshow = true diff --git a/pages/Personal/Personal.vue b/pages/Personal/Personal.vue index 2b5199d..6f8be08 100644 --- a/pages/Personal/Personal.vue +++ b/pages/Personal/Personal.vue @@ -29,7 +29,7 @@ - + 登录 diff --git a/pages/integral/integral.vue b/pages/integral/integral.vue index 777650e..a3427ed 100644 --- a/pages/integral/integral.vue +++ b/pages/integral/integral.vue @@ -471,7 +471,6 @@ }) } }, - //跳转到全部收货地址 upaddress() { if (this.updata.receiver) { @@ -534,16 +533,49 @@ }, //点击签到 signIninfo() { - signIn(this.patientId).then(res => { - if (res.code == 200) { - this.selectPatientSignInifo(); - this.$refs.uToast.show({ - title: '今日签到成功', - type: 'success', - duration: '1000', - }) - } - }) + var that = this + const value = uni.getStorageSync('patientId'); + const value2 = uni.getStorageSync('openid'); + if (value && value2) { + AppIdentification(value).then(res => { + if (res.code == 200) { + if (res.data.loginFlag) { + signIn(value).then(res => { + if (res.code == 200) { + that.selectPatientSignInifo(); + that.$refs.uToast.show({ + title: '今日签到成功', + type: 'success', + duration: '1000', + }) + } else { + that.$refs.uToast.show({ + title: '签到失败', + type: 'error', + duration: '1000', + }) + } + }) + } else { + that.usershow = true + } + } else { + that.$refs.uToast.show({ + title: '请先登录', + type: 'error', + duration: '2000', + url: '/pages/login/login' + }) + } + }) + } else { + that.$refs.uToast.show({ + title: '请先登录', + type: 'error', + duration: '2000', + url: '/pages/login/login' + }) + } }, // 收件人 goodsList() {