share-16:07

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

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

Loading…
Cancel
Save