From 89d59a0aac22e34d3dd2c452b73daa54b02f9e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89?= <814457906@qq.com> Date: Mon, 13 Nov 2023 09:57:09 +0800 Subject: [PATCH 1/2] =?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/login/login.vue | 21 ++++++--------------- pages/myinformation/myinformation.vue | 18 +++++++----------- pagesB/managefamily/managefamily.scss | 3 ++- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 44dd31a..b8688f2 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -111,12 +111,10 @@ let that = this; // console.log(that.logincode, that.phonecode) isRegistered(that.logincode, that.phonecode).then(resp => { - if(resp.data.openid && resp.data.phone){ + if (resp.data.openid && resp.data.phone) { uni.setStorageSync("openid", resp.data.openid) uni.setStorageSync("phone", resp.data.phone) - } - if (resp.data.code == '0') { that.$refs.uToast.show({ title: '未注册,请先注册', @@ -131,26 +129,19 @@ url: '/pages/register/register', }) }, 1500) - } else if(resp.data.code == '2'){ + } else if (resp.data.code == '2') { that.$refs.uToast.show({ title: '已被其他人注册, 不能再登录', type: 'error', duration: '1500', }) - - } - else if (resp.data.code == '1') { + } else if (resp.data.code == '1') { getCurrentUser(resp.data.openid).then(res => { if (res.code == 200) { - if(res.data){ - uni.setStorageSync('patientId',res.data.id) - uni.setStorageSync('userinfo',res.data) - - // uni.setStorageSync('patientId', res.data.id); - // uni.setStorageSync('userinfo', res.data); - + if (res.data) { + uni.setStorageSync('patientId', res.data.id); + uni.setStorageSync('userinfo', res.data); } - that.$refs.uToast.show({ title: '登录成功', type: 'success', diff --git a/pages/myinformation/myinformation.vue b/pages/myinformation/myinformation.vue index a114287..77942e9 100644 --- a/pages/myinformation/myinformation.vue +++ b/pages/myinformation/myinformation.vue @@ -35,7 +35,7 @@ - {{appPersonallist.score>=0?appPersonallist.score:0}} + {{appPersonallist.score>0?appPersonallist.score:0}} 行为积分 @@ -43,7 +43,7 @@ - {{appPersonallist.integral>=0?appPersonallist.integral:0}} + {{appPersonallist.integral>0?appPersonallist.integral:0}} 健康豆 @@ -51,7 +51,7 @@ - {{appPersonallist.patientCouponCount>=0?appPersonallist.patientCouponCount:0}} + {{appPersonallist.patientCouponCount>0?appPersonallist.patientCouponCount:0}} 优惠券 @@ -186,7 +186,7 @@