share-16:07

youmengting-dev
游梦婷 1 year ago
parent 5b3d475a0a
commit 31990c8949
  1. 7
      App.vue
  2. 22
      common/share.js
  3. 20
      pages/welcome/welcome.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() {
}
}
</script>

@ -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) {

@ -102,24 +102,36 @@
return;
}
//
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("#"));
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
}
if (value == "/") {
uni.switchTab({
url: '../tabBar/home/home'
})
return
}
uni.reLaunch({
uni.navigateTo({
url: value
})
return;
return;
}
uni.switchTab({

Loading…
Cancel
Save