From d9f6adc528ee2ad58fb08e73e0f5ab6a578cc591 Mon Sep 17 00:00:00 2001 From: hly <2783385703@qq.com> Date: Wed, 27 Aug 2025 14:38:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=9E=E6=94=B6=E6=B5=81=E7=A8=8B):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=88=AA=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A6=96=E6=AC=A1=E8=AE=BF=E9=97=AE=E8=A7=84?= =?UTF-8?q?=E5=88=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将首页的重定向逻辑从reLaunch改为navigateBack以改善用户体验 - 在回收页面添加首次访问规则提示功能 - 新增状态管理标记是否已显示过首次规则 - 在页面显示时自动检查并触发规则提示 --- pages/component/recycle.vue | 29 ++++++++++++++++++++++++++++- pages/index/index.vue | 7 ++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/pages/component/recycle.vue b/pages/component/recycle.vue index b13102c..752d350 100644 --- a/pages/component/recycle.vue +++ b/pages/component/recycle.vue @@ -251,7 +251,8 @@ export default { isUserBlacklisted: false, // 用户是否被拉黑 currentProductId: null, // 当前查看品牌的商品ID searchTimer: null, // 搜索防抖定时器 - isFromPickupFlow: false // 标记是否来自预约流程 + isFromPickupFlow: false, // 标记是否来自预约流程 + hasShownFirstTimeRules: false // 标记是否已显示过首次访问规则 } }, computed: { @@ -970,6 +971,10 @@ export default { }) return } + + // 关闭商品明细弹窗 + this.showDetailPanel = false + this.$refs.rulePopup.openConfirmPopup(); }, handlePickupCancel() { @@ -1114,6 +1119,25 @@ export default { addMoreItems() { this.showDetailPanel = false }, + + // 检查新用户首次访问规则 + checkFirstTimeRules() { + // 从本地存储检查是否已显示过首次规则 + const hasShown = uni.getStorageSync('hasShownFirstTimeRules') + if (!hasShown && !this.hasShownFirstTimeRules) { + this.showFirstTimeRulesPopup() + } + }, + + // 显示新用户首次访问规则弹窗 + showFirstTimeRulesPopup() { + // 显示价格说明弹窗 + this.showPriceInfoPopup = true + + // 标记已显示过首次规则 + this.hasShownFirstTimeRules = true + uni.setStorageSync('hasShownFirstTimeRules', true) + }, fetchUserInfo() { if (uni.getStorageSync('token')) { this.login_status = getApp().globalData.login_status; @@ -1314,6 +1338,9 @@ export default { onShow() { // 获取用户信息,检查黑名单状态 this.fetchUserInfo() + + // 检查是否为新用户首次访问,显示回收规则 + this.checkFirstTimeRules() const id = getApp().globalData.targetRecycleCategoryId if (id) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 5bd077d..eb5399f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -208,9 +208,10 @@ url: '/pages/wxUserInfo' }); } else { - uni.reLaunch({ - url: '/pages/component/home' - }); + // uni.reLaunch({ + // url: '/pages/component/home' + // }); + uni.navigateBack(-1) } } else { uni.navigateTo({