diff --git a/App.vue b/App.vue index 461472d..251d9cf 100644 --- a/App.vue +++ b/App.vue @@ -123,6 +123,12 @@ // that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/'; // that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/'; // that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/'; + + uni.setStorage({ + key: "accountType", + data: "" + }) + uni.getStorage({ key: 'openId', success(e) { @@ -239,6 +245,7 @@ // #endif }, onHide: function() { + } } diff --git a/common/share.js b/common/share.js index 303c913..74aa431 100644 --- a/common/share.js +++ b/common/share.js @@ -94,6 +94,8 @@ export default { } }, isGoHome(){ + + /* 黑名单:不允许分享 */ let arr =[ "/physical-merchants/settleAccounts/settleAccounts",//订单确认 "/physical-merchants/classify/order/pay",//收银台页 @@ -121,6 +123,26 @@ export default { // #endif }, + // #ifdef H5 + onBackPress(event){ + /* h5分享页面的回退 */ + const app = getApp(); + let str = uni.getStorageSync("accountType"); + if(str == "0000016&key"){ + if(getCurrentPages().length == 2 && getCurrentPages()[0].route == "pages/welcome/welcome"){ + + uni.switchTab({ + url:"/pages/tabBar/home/home" + }) + + return true; + } + + } + return false; + + }, + // #endif /* 小程序分享 */ // #ifdef MP-WEIXIN onShareAppMessage(res) { diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index 930a0e3..192a160 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -101,27 +101,39 @@ }) return; } - - if(app.globalData.accountType == '0000016&key' && app.globalData.h5code){ + + // 从分享页进来 + if (app.globalData.accountType == '0000016&key' && app.globalData.h5code) { let value = uni.getStorageSync('goUrl'); /* /physical-merchants/classify/goodsDetail/goodsDetail?goodsId=35#/ */ - value = value.slice(0,value.lastIndexOf("#")); + value = value.slice(0, value.lastIndexOf("#")); + - if(value == "/pages/tabBar/home/home" || value == "/pages/tabBar/category/category" || value == "/pages/tabBar/user/user"){ - uni.reLaunch({ + if (value == "/pages/tabBar/home/home" || value == "/pages/tabBar/category/category" || value == + "/pages/tabBar/user/user") { + uni.switchTab({ url: value }) - return + return } - - uni.reLaunch({ - url: value + if (value == "/") { + uni.switchTab({ + url: '../tabBar/home/home' }) - return; - - + return + } + + + uni.navigateTo({ + url: value + }) + + + + + return; } - + uni.switchTab({ url: '../tabBar/home/home' })