diff --git a/components/NavBar/NavBar.vue b/components/NavBar/NavBar.vue index 8a332fe..eb92a50 100644 --- a/components/NavBar/NavBar.vue +++ b/components/NavBar/NavBar.vue @@ -165,7 +165,21 @@ ") 0.75%,rgba(255,177,118," + x + ") 99.78%)" }, clickIcon() { - uni.navigateBack() + // uni.navigateBack() + + const pages = getCurrentPages() + // 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回 + if (pages.length > 1) { + uni.navigateBack(1) + return; + }else{ + uni.switchTab({ + url: '/pages/card/card' + }) + } + + return; + } } } diff --git a/pages.json b/pages.json index 67867af..3707ddc 100644 --- a/pages.json +++ b/pages.json @@ -101,7 +101,7 @@ ], "globalStyle": { "navigationBarTextStyle": "white", - "navigationBarTitleText": "uni-app", + "navigationBarTitleText": "云菜窖", "navigationBarBackgroundColor": "#FE9039", "backgroundColor": "#FE9039" }, diff --git a/pages/card/card.vue b/pages/card/card.vue index 1d84a8e..befebf4 100644 --- a/pages/card/card.vue +++ b/pages/card/card.vue @@ -138,15 +138,15 @@ }, detail(item) { - if (item.state == '失效') { - // 记录 + if (item.showBtn) { + // 正常 uni.navigateTo({ - url: '/pages/card/card_record?sid=' + item.sid + url: '/pages/card/card_detail?sid=' + item.sid }) } else { - // 详情 + // 过期 已完成 uni.navigateTo({ - url: '/pages/card/card_detail?sid=' + item.sid + url: '/pages/card/card_detail2?sid=' + item.sid }) } diff --git a/pages/card/card_bind2.vue b/pages/card/card_bind2.vue index 930c419..76e1e48 100644 --- a/pages/card/card_bind2.vue +++ b/pages/card/card_bind2.vue @@ -3,17 +3,18 @@ - + - - + + - + - + - + - + 绑定云菜窖卡 - + 提货编码 - + @@ -85,6 +86,12 @@ } } }, + onUnload() { + let pages = getCurrentPages().length - 1; + wx.navigateBack({ + delta: pages + }) + }, onLoad(options) { let _this = this; wx.login({ @@ -132,8 +139,8 @@ }); if (options) { - console.log("options", options) - + console.log("options", options) + const q = decodeURIComponent(options.q) // 获取到二维码原始链接内容 console.log("二维码原始链接内容", q) diff --git a/pages/card/card_detail.vue b/pages/card/card_detail.vue index 19e0261..d3c39c2 100644 --- a/pages/card/card_detail.vue +++ b/pages/card/card_detail.vue @@ -26,6 +26,8 @@ + + {{data.pname}} @@ -112,7 +114,7 @@ - + + {{data.pname}}