share-16:07

youmengting-dev
游梦婷 1 year ago
parent 5b3d475a0a
commit 31990c8949
  1. 7
      App.vue
  2. 22
      common/share.js
  3. 38
      pages/welcome/welcome.vue

@ -123,6 +123,12 @@
// that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/'; // that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/';
// that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/'; // that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/';
// that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/'; // that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/';
uni.setStorage({
key: "accountType",
data: ""
})
uni.getStorage({ uni.getStorage({
key: 'openId', key: 'openId',
success(e) { success(e) {
@ -239,6 +245,7 @@
// #endif // #endif
}, },
onHide: function() { onHide: function() {
} }
} }
</script> </script>

@ -94,6 +94,8 @@ export default {
} }
}, },
isGoHome(){ isGoHome(){
/* 黑名单:不允许分享 */
let arr =[ let arr =[
"/physical-merchants/settleAccounts/settleAccounts",//订单确认 "/physical-merchants/settleAccounts/settleAccounts",//订单确认
"/physical-merchants/classify/order/pay",//收银台页 "/physical-merchants/classify/order/pay",//收银台页
@ -121,6 +123,26 @@ export default {
// #endif // #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 // #ifdef MP-WEIXIN
onShareAppMessage(res) { onShareAppMessage(res) {

@ -101,27 +101,39 @@
}) })
return; return;
} }
if(app.globalData.accountType == '0000016&key' && app.globalData.h5code){ //
if (app.globalData.accountType == '0000016&key' && app.globalData.h5code) {
let value = uni.getStorageSync('goUrl'); let value = uni.getStorageSync('goUrl');
/* /physical-merchants/classify/goodsDetail/goodsDetail?goodsId=35#/ */ /* /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"){ if (value == "/pages/tabBar/home/home" || value == "/pages/tabBar/category/category" || value ==
uni.reLaunch({ "/pages/tabBar/user/user") {
uni.switchTab({
url: value url: value
}) })
return return
} }
if (value == "/") {
uni.reLaunch({ uni.switchTab({
url: value url: '../tabBar/home/home'
}) })
return; return
}
uni.navigateTo({
url: value
})
return;
} }
uni.switchTab({ uni.switchTab({
url: '../tabBar/home/home' url: '../tabBar/home/home'
}) })

Loading…
Cancel
Save