From dd67108434570fe255806432ee7a1ec695db417d Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Fri, 16 May 2025 13:28:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=AA=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8B=E7=9A=84UI=E6=98=BE=E7=A4=BA=E5=8F=8A=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在多个页面中添加了未登录状态下的UI显示,包括登录提示和登录按钮。同时,优化了登录状态下的数据加载逻辑,确保只有在用户登录后才会请求相关数据。提升了用户体验和代码的可维护性。 --- pages/index/center.vue | 51 +++++- pages/index/order.vue | 57 +++++- pages_order/order/orderDetail.vue | 260 ++++++++++++++-------------- pages_order/order/verifyOrder.vue | 354 +++++++++++++++++++------------------- 4 files changed, 406 insertions(+), 316 deletions(-) diff --git a/pages/index/center.vue b/pages/index/center.vue index 1ae52a7..f171169 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -2,7 +2,14 @@ - + + + + + {{ userInfo.nickName }} @@ -63,7 +70,7 @@ - + @@ -171,14 +178,19 @@ isMerchants() { return this.userInfo.isMerchants === '1' }, + isLogin() { + return this.userInfo && this.userInfo.id + } }, data() { return { } }, onShow() { - this.$store.commit('getUserInfo') - this.$store.commit('getRiceInfo') + if(this.isLogin){ + this.$store.commit('getUserInfo') + this.$store.commit('getRiceInfo') + } }, methods: { clickNo() { @@ -209,7 +221,9 @@ // 处理扫码结果 console.log('扫码结果:', res.result); - this.$fetch('overOrder', res.result).then(() => { + this.$fetch('overOrder', { + orderId : res.result + }).then(() => { uni.showToast({ title: '核销成功', icon: 'none' @@ -258,6 +272,33 @@ text-align: center; } } + + .no-login { + margin-top: 123rpx; + align-items: center; + + &-img { + width: 115rpx; + height: auto; + margin-bottom: 20rpx; + } + + &-text { + color: #FFFFFF; + font-size: 28rpx; + margin-bottom: 40rpx; + } + + &-btn { + padding: 16rpx 60rpx; + background-color: #FFFFFF; + color: #84A73F; + font-size: 28rpx; + font-weight: bold; + border-radius: 40rpx; + box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1); + } + } .member { width: calc(100vw - 13rpx*2); diff --git a/pages/index/order.vue b/pages/index/order.vue index cb3f70c..af5e1d1 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -30,8 +30,15 @@ :current="current" @click="clickTabs"> + + + - + @@ -41,10 +48,6 @@ \ No newline at end of file diff --git a/pages_order/order/verifyOrder.vue b/pages_order/order/verifyOrder.vue index e0e0401..91b3400 100644 --- a/pages_order/order/verifyOrder.vue +++ b/pages_order/order/verifyOrder.vue @@ -1,56 +1,62 @@ \ No newline at end of file