Browse Source

feat(回收流程): 修改导航逻辑并添加首次访问规则提示

- 将首页的重定向逻辑从reLaunch改为navigateBack以改善用户体验
- 在回收页面添加首次访问规则提示功能
- 新增状态管理标记是否已显示过首次规则
- 在页面显示时自动检查并触发规则提示
master
前端-胡立永 2 weeks ago
parent
commit
d9f6adc528
2 changed files with 32 additions and 4 deletions
  1. +28
    -1
      pages/component/recycle.vue
  2. +4
    -3
      pages/index/index.vue

+ 28
- 1
pages/component/recycle.vue View File

@ -251,7 +251,8 @@ export default {
isUserBlacklisted: false, // isUserBlacklisted: false, //
currentProductId: null, // ID currentProductId: null, // ID
searchTimer: null, // searchTimer: null, //
isFromPickupFlow: false //
isFromPickupFlow: false, //
hasShownFirstTimeRules: false // 访
} }
}, },
computed: { computed: {
@ -970,6 +971,10 @@ export default {
}) })
return return
} }
//
this.showDetailPanel = false
this.$refs.rulePopup.openConfirmPopup(); this.$refs.rulePopup.openConfirmPopup();
}, },
handlePickupCancel() { handlePickupCancel() {
@ -1114,6 +1119,25 @@ export default {
addMoreItems() { addMoreItems() {
this.showDetailPanel = false 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() { fetchUserInfo() {
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
this.login_status = getApp().globalData.login_status; this.login_status = getApp().globalData.login_status;
@ -1314,6 +1338,9 @@ export default {
onShow() { onShow() {
// //
this.fetchUserInfo() this.fetchUserInfo()
// 访
this.checkFirstTimeRules()
const id = getApp().globalData.targetRecycleCategoryId const id = getApp().globalData.targetRecycleCategoryId
if (id) { if (id) {


+ 4
- 3
pages/index/index.vue View File

@ -208,9 +208,10 @@
url: '/pages/wxUserInfo' url: '/pages/wxUserInfo'
}); });
} else { } else {
uni.reLaunch({
url: '/pages/component/home'
});
// uni.reLaunch({
// url: '/pages/component/home'
// });
uni.navigateBack(-1)
} }
} else { } else {
uni.navigateTo({ uni.navigateTo({


Loading…
Cancel
Save