From 6a76ccc0ef07320b0c23e5bf7d8e8d5a2a8d6fdb Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sat, 12 Mar 2022 12:44:45 +0800 Subject: [PATCH] 未登陆不允许分享的优化 --- app.js | 12 ++++++++++-- packageA/pages/activity_share/activity_share.js | 2 +- packageA/pages/addCustomer/addCustomer.js | 2 +- packageA/pages/cardDetails/cardDetails.js | 1 + packageA/pages/cardList/cardList.js | 1 + packageA/pages/chongzhi/chongzhi.js | 2 +- packageA/pages/chongzhiDetails/chongzhiDetails.js | 2 +- packageA/pages/choujiang/choujiang.js | 2 +- packageA/pages/details_serviceCard/details_serviceCard.js | 1 + packageA/pages/distribution/card/card.js | 1 + packageA/pages/distribution/commision/commision.js | 1 + packageA/pages/distribution/goods/goods.js | 2 ++ packageA/pages/distribution/myteam/myteam.js | 1 + packageA/pages/distribution/order/order.js | 1 + packageA/pages/distribution/rank/rank.js | 1 + packageA/pages/distribution/rookie/rookie.js | 1 + packageA/pages/distribution/shop/shop.js | 2 ++ packageA/pages/goodsInfo/goodsInfo.js | 3 +++ packageA/pages/goods_share/goods_share.js | 4 ++-- packageA/pages/hongBao/hongBao.js | 5 ++--- packageA/pages/hongBaoDetails/hongBaoDetails.js | 2 +- packageA/pages/jfbuy/jfbuy.js | 2 +- packageA/pages/liveStream/liveStream.js | 2 ++ packageA/pages/liveStreamDetails/liveStreamDetails.js | 7 ++++++- packageA/pages/live_share/live_share.js | 2 +- packageA/pages/myGift/myGift.js | 2 ++ packageA/pages/myGiftDetails/myGiftDetails.js | 1 + packageA/pages/parseHtml/parseHtml.js | 2 +- packageA/pages/profile/profile.js | 3 +++ packageA/pages/prom_list/prom_list.js | 3 +++ packageA/pages/quan/quan.js | 2 +- packageA/pages/service_share/service_share.js | 2 ++ packageA/pages/user/my_service2/appment_main.js | 2 +- packageB/pages/boxes-details/boxes-details.js | 2 ++ packageB/pages/luckactivity/index/index.js | 2 ++ packageB/pages/user/Change_phone/Change_phone.js | 2 +- packageB/pages/user/binding_info/binding_info.js | 2 +- packageB/pages/user/buyDetails/buyDetails.js | 1 + packageB/pages/user/choice_guide/choice_guide.js | 1 + packageB/pages/video/index.js | 2 ++ packageB/pages/zuhegou/index/index.js | 2 ++ packageB/pages/zuhegou/list/list.js | 5 ++++- packageB/pages/zuhegou/preindex/index.js | 2 ++ packageC/pages/goods/distributionCategoryList/index.js | 2 ++ packageC/pages/goods/goodsList/goodsList.js | 7 +++++++ packageC/pages/goods/search/search.js | 4 ++++ packageC/pages/group_list/group_list.js | 1 + packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js | 1 + packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js | 5 +++++ packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 6 ++++++ packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js | 1 + packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js | 1 + packageC/pages/presell/goodsInfo/goodsInfo.js | 5 +++++ packageC/pages/presell/pregoodsInfo/goodsInfo.js | 8 +++++++- packageD/pages/AI-test-skin/history_record/history_record.js | 2 +- packageD/pages/AI-test-skin/index/aiskin.js | 1 + packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js | 1 + packageD/pages/AI-test-skin/success_result/success_result.js | 4 +++- pages/activity/pind_list/pind_list.js | 1 + pages/activity/seckill_list/seckill_list.js | 1 + pages/cart/cart_wk/cart_wk.js | 1 + pages/distribution/distribution.js | 3 ++- pages/giftpack/buygiftpack/giftpackbuy.js | 1 + pages/giftpack/giftpacklist/giftpacklist.js | 1 + pages/giftpack/mygiftpack/mygiftpack.js | 1 + pages/goods/categoryList/categoryList.js | 1 + pages/goods/goodsInfo/goodsInfo.js | 9 +++++++-- pages/goods/goodsList/goodsList.js | 4 ++++ pages/goods/search/search.js | 7 +++++-- pages/index/index/index.js | 3 +++ pages/team/team_show/team_show.js | 1 + pages/team/team_success/team_success.js | 8 ++++++++ pages/template/index.js | 1 + pages/user/assistance/assistance.js | 1 + pages/user/assistance/friend_assistance.js | 1 + pages/user/assistance/task_assistance.js | 2 +- pages/user/deposit/prepaid/msg/msg.js | 2 +- pages/user/index/index.js | 1 + pages/user/integral/integral.js | 1 + pages/user/integral/msg/msg.js | 1 + pages/user/member/bring/bring.js | 1 + pages/user/member/bring/msg/msg.js | 1 + pages/user/member/menber.js | 1 + pages/user/user_spsy/user_spsy.js | 3 +-- pages/user/userinfo/userinfo.js | 1 + pages/user/userqy/userqy.js | 1 + 86 files changed, 175 insertions(+), 34 deletions(-) diff --git a/app.js b/app.js index 5aa28a8..8cb325d 100644 --- a/app.js +++ b/app.js @@ -205,6 +205,7 @@ App({ this.getConfig(); }, + //---初始化第三方---- initExt: function () { var tt = t; @@ -842,7 +843,6 @@ App({ urls: [path] }); }, - //b是数组,t是wxml元素返回的 pre_img2(b,t){ this.globalData.no_clear=1; @@ -892,7 +892,7 @@ App({ }); }, - com_call(self) { + com_call(self) { self.getTel() .then(() => { if(self.data.store_tel) { @@ -912,6 +912,14 @@ App({ }; }); }, + + //检验能不能分享 + check_can_share(){ + if(!this.globalData.user_id) wx.hideShareMenu(); + else wx.showShareMenu(); + } + + diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index 1ea64a5..5ae58a4 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -125,7 +125,7 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () {}, + onShow: function () { getApp().check_can_share(); }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/packageA/pages/addCustomer/addCustomer.js b/packageA/pages/addCustomer/addCustomer.js index 3451b5b..9029bdf 100644 --- a/packageA/pages/addCustomer/addCustomer.js +++ b/packageA/pages/addCustomer/addCustomer.js @@ -26,7 +26,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/cardDetails/cardDetails.js b/packageA/pages/cardDetails/cardDetails.js index a4c981f..602f1d6 100644 --- a/packageA/pages/cardDetails/cardDetails.js +++ b/packageA/pages/cardDetails/cardDetails.js @@ -39,6 +39,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/cardList/cardList.js b/packageA/pages/cardList/cardList.js index 00380a6..86651bd 100644 --- a/packageA/pages/cardList/cardList.js +++ b/packageA/pages/cardList/cardList.js @@ -52,6 +52,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); let url = '/api/weshop/serviceCard/page'; let currentQuery = this.data.currentQuery; if(app.globalData.userInfo) { diff --git a/packageA/pages/chongzhi/chongzhi.js b/packageA/pages/chongzhi/chongzhi.js index 3c7af6c..01173f0 100644 --- a/packageA/pages/chongzhi/chongzhi.js +++ b/packageA/pages/chongzhi/chongzhi.js @@ -64,7 +64,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.js b/packageA/pages/chongzhiDetails/chongzhiDetails.js index 30b593c..7d780a2 100644 --- a/packageA/pages/chongzhiDetails/chongzhiDetails.js +++ b/packageA/pages/chongzhiDetails/chongzhiDetails.js @@ -105,7 +105,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/choujiang/choujiang.js b/packageA/pages/choujiang/choujiang.js index ca54bfb..ddb9846 100644 --- a/packageA/pages/choujiang/choujiang.js +++ b/packageA/pages/choujiang/choujiang.js @@ -26,7 +26,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/details_serviceCard/details_serviceCard.js b/packageA/pages/details_serviceCard/details_serviceCard.js index 1baeffc..ad5ae7d 100644 --- a/packageA/pages/details_serviceCard/details_serviceCard.js +++ b/packageA/pages/details_serviceCard/details_serviceCard.js @@ -42,6 +42,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { + getApp().check_can_share(); if (app.globalData.userInfo) { if (!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/distribution/card/card.js b/packageA/pages/distribution/card/card.js index 0a8e23a..b27ae9f 100644 --- a/packageA/pages/distribution/card/card.js +++ b/packageA/pages/distribution/card/card.js @@ -38,6 +38,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/distribution/commision/commision.js b/packageA/pages/distribution/commision/commision.js index cbfac7a..277dc75 100644 --- a/packageA/pages/distribution/commision/commision.js +++ b/packageA/pages/distribution/commision/commision.js @@ -74,6 +74,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { diff --git a/packageA/pages/distribution/goods/goods.js b/packageA/pages/distribution/goods/goods.js index ea0a47e..fd6620f 100644 --- a/packageA/pages/distribution/goods/goods.js +++ b/packageA/pages/distribution/goods/goods.js @@ -97,6 +97,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + + getApp().check_can_share(); let url = '/api/weshop/goods/page'; let currentQuery = this.data.currentQuery; if(app.globalData.userInfo) { diff --git a/packageA/pages/distribution/myteam/myteam.js b/packageA/pages/distribution/myteam/myteam.js index d7690a5..a5a5ddf 100644 --- a/packageA/pages/distribution/myteam/myteam.js +++ b/packageA/pages/distribution/myteam/myteam.js @@ -69,6 +69,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/distribution/order/order.js b/packageA/pages/distribution/order/order.js index 1b5c28d..e990e6d 100644 --- a/packageA/pages/distribution/order/order.js +++ b/packageA/pages/distribution/order/order.js @@ -78,6 +78,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/distribution/rank/rank.js b/packageA/pages/distribution/rank/rank.js index fa5e954..c066dc0 100644 --- a/packageA/pages/distribution/rank/rank.js +++ b/packageA/pages/distribution/rank/rank.js @@ -67,6 +67,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/distribution/rookie/rookie.js b/packageA/pages/distribution/rookie/rookie.js index 200b6ba..f528918 100644 --- a/packageA/pages/distribution/rookie/rookie.js +++ b/packageA/pages/distribution/rookie/rookie.js @@ -58,6 +58,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo instanceof Object) { this.setData({ userInfo: app.globalData.userInfo, diff --git a/packageA/pages/distribution/shop/shop.js b/packageA/pages/distribution/shop/shop.js index 8a6c936..d9f78d6 100644 --- a/packageA/pages/distribution/shop/shop.js +++ b/packageA/pages/distribution/shop/shop.js @@ -95,6 +95,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); + //自己登录的 if (app.globalData.userInfo && !this.data.first_leader) { if (!this.data.isLogin) { diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index 3147d58..d669536 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -668,6 +668,9 @@ Page({ //---展示--- // gid 在onload阶段已经保存在this.data中 onShow: function() { + + getApp().check_can_share(); + var that=this; var ee = this,gid = this.data.gid, i = getApp().request; this.data.is_timer = 1; diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js index 6ba5efb..5e7f82b 100644 --- a/packageA/pages/goods_share/goods_share.js +++ b/packageA/pages/goods_share/goods_share.js @@ -123,9 +123,9 @@ Page({ /*** 生命周期函数--监听页面显示***/ onShow: function () { + getApp().check_can_share(); var th=this; - - + if(app.globalData.userInfo) { this.setData({ //用来判断是否是分销商,是分销商才显示分成佣金 diff --git a/packageA/pages/hongBao/hongBao.js b/packageA/pages/hongBao/hongBao.js index 6e24e15..4d41682 100644 --- a/packageA/pages/hongBao/hongBao.js +++ b/packageA/pages/hongBao/hongBao.js @@ -76,10 +76,9 @@ Page({ */ onShow: function () { console.log('onshow'); + getApp().check_can_share(); - - - + }, /** diff --git a/packageA/pages/hongBaoDetails/hongBaoDetails.js b/packageA/pages/hongBaoDetails/hongBaoDetails.js index f74292d..49c8b06 100644 --- a/packageA/pages/hongBaoDetails/hongBaoDetails.js +++ b/packageA/pages/hongBaoDetails/hongBaoDetails.js @@ -64,7 +64,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/jfbuy/jfbuy.js b/packageA/pages/jfbuy/jfbuy.js index 95c28fc..46685b3 100644 --- a/packageA/pages/jfbuy/jfbuy.js +++ b/packageA/pages/jfbuy/jfbuy.js @@ -169,7 +169,7 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () {}, + onShow: function () { getApp().check_can_share(); }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/packageA/pages/liveStream/liveStream.js b/packageA/pages/liveStream/liveStream.js index 8197b8f..0e8184a 100644 --- a/packageA/pages/liveStream/liveStream.js +++ b/packageA/pages/liveStream/liveStream.js @@ -229,6 +229,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js index fa0de31..3dc4728 100644 --- a/packageA/pages/liveStreamDetails/liveStreamDetails.js +++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js @@ -53,6 +53,11 @@ Page({ // 分享操作表 clickShare: function () { + + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } this.setData({ showActionSheet: !this.data.showActionSheet }) @@ -570,7 +575,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/live_share/live_share.js b/packageA/pages/live_share/live_share.js index 6f63798..34f8619 100644 --- a/packageA/pages/live_share/live_share.js +++ b/packageA/pages/live_share/live_share.js @@ -44,7 +44,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/myGift/myGift.js b/packageA/pages/myGift/myGift.js index 3df4c3d..ab53025 100644 --- a/packageA/pages/myGift/myGift.js +++ b/packageA/pages/myGift/myGift.js @@ -67,6 +67,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/myGiftDetails/myGiftDetails.js b/packageA/pages/myGiftDetails/myGiftDetails.js index 011d831..07fdcff 100644 --- a/packageA/pages/myGiftDetails/myGiftDetails.js +++ b/packageA/pages/myGiftDetails/myGiftDetails.js @@ -57,6 +57,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageA/pages/parseHtml/parseHtml.js b/packageA/pages/parseHtml/parseHtml.js index 3983cc9..dea4a8b 100644 --- a/packageA/pages/parseHtml/parseHtml.js +++ b/packageA/pages/parseHtml/parseHtml.js @@ -286,7 +286,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageA/pages/profile/profile.js b/packageA/pages/profile/profile.js index f84e04e..37147cf 100644 --- a/packageA/pages/profile/profile.js +++ b/packageA/pages/profile/profile.js @@ -688,6 +688,9 @@ Page({ }, onShow: function() { + + getApp().check_can_share(); + var e = this; if (this.data.is_zy) return false; this.wait_for_store_config(); diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js index cd69fbe..ab3cc72 100644 --- a/packageA/pages/prom_list/prom_list.js +++ b/packageA/pages/prom_list/prom_list.js @@ -162,6 +162,9 @@ Page({ //---展示--- onShow: function() { + + getApp().check_can_share(); + var ee=this,th=ee,that=ee; var gid = this.data.gid,i = getApp().request; ee.data.g_buy_num = new Map(); diff --git a/packageA/pages/quan/quan.js b/packageA/pages/quan/quan.js index ca08b2e..0855002 100644 --- a/packageA/pages/quan/quan.js +++ b/packageA/pages/quan/quan.js @@ -48,7 +48,7 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { }, + onShow: function () { getApp().check_can_share(); }, /** * 生命周期函数--监听页面隐藏 diff --git a/packageA/pages/service_share/service_share.js b/packageA/pages/service_share/service_share.js index d0564c5..feb9371 100644 --- a/packageA/pages/service_share/service_share.js +++ b/packageA/pages/service_share/service_share.js @@ -97,6 +97,8 @@ Page({ /*** 生命周期函数--监听页面显示***/ onShow: function () { + getApp().check_can_share(); + var th=this; getApp().getConfig2(function(rs){ //计算等级价相关 diff --git a/packageA/pages/user/my_service2/appment_main.js b/packageA/pages/user/my_service2/appment_main.js index 6a4fee5..35961aa 100644 --- a/packageA/pages/user/my_service2/appment_main.js +++ b/packageA/pages/user/my_service2/appment_main.js @@ -26,7 +26,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageB/pages/boxes-details/boxes-details.js b/packageB/pages/boxes-details/boxes-details.js index 9513684..4895c96 100644 --- a/packageB/pages/boxes-details/boxes-details.js +++ b/packageB/pages/boxes-details/boxes-details.js @@ -51,6 +51,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { + getApp().check_can_share(); + // console.log('show~~~'); if (app.globalData.userInfo) { if (!this.data.isLogin) { diff --git a/packageB/pages/luckactivity/index/index.js b/packageB/pages/luckactivity/index/index.js index 72d8423..fa3fe5b 100644 --- a/packageB/pages/luckactivity/index/index.js +++ b/packageB/pages/luckactivity/index/index.js @@ -69,6 +69,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); + if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageB/pages/user/Change_phone/Change_phone.js b/packageB/pages/user/Change_phone/Change_phone.js index e94d533..f0d7873 100644 --- a/packageB/pages/user/Change_phone/Change_phone.js +++ b/packageB/pages/user/Change_phone/Change_phone.js @@ -211,7 +211,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { - + getApp().check_can_share(); }, /** diff --git a/packageB/pages/user/binding_info/binding_info.js b/packageB/pages/user/binding_info/binding_info.js index 69f67d3..13d389a 100644 --- a/packageB/pages/user/binding_info/binding_info.js +++ b/packageB/pages/user/binding_info/binding_info.js @@ -26,7 +26,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, /** diff --git a/packageB/pages/user/buyDetails/buyDetails.js b/packageB/pages/user/buyDetails/buyDetails.js index 6de7198..eb8a24a 100644 --- a/packageB/pages/user/buyDetails/buyDetails.js +++ b/packageB/pages/user/buyDetails/buyDetails.js @@ -40,6 +40,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageB/pages/user/choice_guide/choice_guide.js b/packageB/pages/user/choice_guide/choice_guide.js index 7b44c52..23ce6eb 100644 --- a/packageB/pages/user/choice_guide/choice_guide.js +++ b/packageB/pages/user/choice_guide/choice_guide.js @@ -19,6 +19,7 @@ Page({ onLoad: function(t) {}, onShow: function() { + getApp().check_can_share(); this.data.ismore=0;this.data.isload=0; this.setData({list:null}); this.get_list(); diff --git a/packageB/pages/video/index.js b/packageB/pages/video/index.js index 97f1008..762d968 100644 --- a/packageB/pages/video/index.js +++ b/packageB/pages/video/index.js @@ -26,6 +26,8 @@ Page({ }) }, onShow:function(){ + getApp().check_can_share(); + var goods_list = this.selectComponent("#goods_list"); //组件的id goods_list.init(); setTimeout(function() { diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js index 212bfc1..6b7ba41 100644 --- a/packageB/pages/zuhegou/index/index.js +++ b/packageB/pages/zuhegou/index/index.js @@ -160,6 +160,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); + getApp().is_Single_page(this, function () { var th = this, that = this, diff --git a/packageB/pages/zuhegou/list/list.js b/packageB/pages/zuhegou/list/list.js index 0705750..494267c 100644 --- a/packageB/pages/zuhegou/list/list.js +++ b/packageB/pages/zuhegou/list/list.js @@ -65,7 +65,10 @@ Page({ }, - onShow: function(t) { + onShow: function(t) { + + getApp().check_can_share(); + this.data.ismore=1; this.data.is_timer=1; this.data.currentPage=1; diff --git a/packageB/pages/zuhegou/preindex/index.js b/packageB/pages/zuhegou/preindex/index.js index b3946ae..90a38b2 100644 --- a/packageB/pages/zuhegou/preindex/index.js +++ b/packageB/pages/zuhegou/preindex/index.js @@ -159,6 +159,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); + getApp().is_Single_page(this, function () { var th = this, that = this, diff --git a/packageC/pages/goods/distributionCategoryList/index.js b/packageC/pages/goods/distributionCategoryList/index.js index aeab51a..bce472c 100644 --- a/packageC/pages/goods/distributionCategoryList/index.js +++ b/packageC/pages/goods/distributionCategoryList/index.js @@ -231,6 +231,8 @@ Page({ }) }, onShow: function () { + + getApp().check_can_share(); if (t.globalData.userInfo) { let currentData = { store_id: t.globalData.setting.stoid, diff --git a/packageC/pages/goods/goodsList/goodsList.js b/packageC/pages/goods/goodsList/goodsList.js index 743cbcb..76b6de1 100644 --- a/packageC/pages/goods/goodsList/goodsList.js +++ b/packageC/pages/goods/goodsList/goodsList.js @@ -119,6 +119,11 @@ Page({ } }); }, + + onShow:function () { + getApp().check_can_share(); + }, + //设置优惠券的 set_prom_list: async function (arr) { var th = this; @@ -313,4 +318,6 @@ Page({ }, + + }); \ No newline at end of file diff --git a/packageC/pages/goods/search/search.js b/packageC/pages/goods/search/search.js index 6c94200..f843a16 100644 --- a/packageC/pages/goods/search/search.js +++ b/packageC/pages/goods/search/search.js @@ -31,6 +31,10 @@ Page({ is_his: 0, }, + onShow:function () { + getApp().check_can_share(); + }, + onLoad: function (t) { this.data.rq_data = t; diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js index f39a14d..2a4cffc 100644 --- a/packageC/pages/group_list/group_list.js +++ b/packageC/pages/group_list/group_list.js @@ -44,6 +44,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js index 6c3aefc..9940f77 100644 --- a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js +++ b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js @@ -35,6 +35,7 @@ Page({ }, onShow: function() { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index f5bcddd..5b2ac21 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -106,6 +106,7 @@ Page({ }, onShow: function() { + getApp().check_can_share(); this.get_team_info(); }, @@ -1009,6 +1010,10 @@ Page({ // }, clickShare() { + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } this.setData({ share_hidden: true, }); diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index eebd0be..45f0e38 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -756,6 +756,8 @@ Page({ //---展示--- onShow: async function () { + + getApp().check_can_share(); // console.log('onshow'); var goods_list = null, th = this, that = this; var show_prew_img = this.data.show_prew_img @@ -6196,6 +6198,10 @@ Page({ }, clickShare() { + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } this.setData({ share_hidden: true, }); diff --git a/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js b/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js index af2238d..43b0f02 100644 --- a/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js +++ b/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js @@ -34,6 +34,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js b/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js index 2f6c540..17ecef7 100644 --- a/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js +++ b/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js @@ -38,6 +38,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); if(app.globalData.userInfo) { if(!this.data.isLogin) { this.setData({ diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 14dbb70..d0590c4 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -593,6 +593,7 @@ Page({ //---展示--- onShow: function () { + getApp().check_can_share(); var goods_list = null, th = this, that = this; //-- 如果是预览图片,页面不重新更新 -- @@ -3844,6 +3845,10 @@ Page({ }, clickShare() { + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } this.setData({ share_hidden: true, }); }, diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index d4302b4..ec5f20e 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -590,6 +590,8 @@ Page({ //---展示--- onShow: function () { + + getApp().check_can_share(); var goods_list = null, th = this, that = this; //-- 如果是预览图片,页面不重新更新 -- @@ -3807,7 +3809,11 @@ Page({ }, clickShare() { - this.setData({ share_hidden: true, }); + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } + this.setData({ share_hidden: true, }); }, send() { diff --git a/packageD/pages/AI-test-skin/history_record/history_record.js b/packageD/pages/AI-test-skin/history_record/history_record.js index 1d1aec6..640e4cb 100644 --- a/packageD/pages/AI-test-skin/history_record/history_record.js +++ b/packageD/pages/AI-test-skin/history_record/history_record.js @@ -304,7 +304,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); }, go_result(e) { let id = e.currentTarget.dataset.id; diff --git a/packageD/pages/AI-test-skin/index/aiskin.js b/packageD/pages/AI-test-skin/index/aiskin.js index 7024cbc..72fb316 100644 --- a/packageD/pages/AI-test-skin/index/aiskin.js +++ b/packageD/pages/AI-test-skin/index/aiskin.js @@ -43,6 +43,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); this.getHistoryData(); }, diff --git a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js index 2472a3b..c9e03d2 100644 --- a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js +++ b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js @@ -36,6 +36,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); let th = this; setTimeout(() => { th.setData({ diff --git a/packageD/pages/AI-test-skin/success_result/success_result.js b/packageD/pages/AI-test-skin/success_result/success_result.js index 46ab5df..07effe0 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.js +++ b/packageD/pages/AI-test-skin/success_result/success_result.js @@ -480,7 +480,9 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { }, + onShow: function () { + getApp().check_can_share(); + }, clickTab(e) { let { index, tab_id } = e.currentTarget.dataset; diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index cab2cae..a4b2f1f 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -65,6 +65,7 @@ Page({ }, onShow: function (t) { + getApp().check_can_share(); this.data.is_timer = 1; this.data.currentPage = 1; this.data.ismore = 1; diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index c979b9c..4c9356c 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -73,6 +73,7 @@ Page({ onShow: function (t) { + getApp().check_can_share(); this.data.is_timer = 1; this.data.currentPage = 1; var th = this; diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 2028d93..652dae1 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -70,6 +70,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); var th = this; if (th.data.isclose == 0) { wx.navigateTo({ diff --git a/pages/distribution/distribution.js b/pages/distribution/distribution.js index f249f87..a5da9c2 100644 --- a/pages/distribution/distribution.js +++ b/pages/distribution/distribution.js @@ -57,7 +57,8 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { + onShow: function () { + getApp().check_can_share(); if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ active: 2 diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index dccbaa0..54eeb67 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -79,6 +79,7 @@ Page({ this.getList(); }, onShow: function () { + getApp().check_can_share(); //--先判断会员状态-- getApp().is_Single_page(this, function () { var user_info = getApp().globalData.userInfo; diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 7e8a399..548ea43 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -73,6 +73,7 @@ Page({ }, onShow: function () { + getApp().check_can_share(); getApp().is_Single_page(this,function () { //--先判断会员状态-- var user_info = getApp().globalData.userInfo; diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 13ae8ac..a7749f9 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -78,6 +78,7 @@ Page({ this.getList(); }, onShow: function () { + getApp().check_can_share(); //--先判断会员状态-- getApp().is_Single_page(this, function () { var user_info = getApp().globalData.userInfo; diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 305c0e8..e0959b4 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -185,6 +185,7 @@ Page({ }); }, onShow:function(){ + getApp().check_can_share(); if (typeof this.getTabBar === 'function' && this.getTabBar()) { var index=getApp().getPageIndex(this); diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index b55e058..23dcac2 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -763,7 +763,7 @@ Page({ //---展示--- onShow: function () { - + getApp().check_can_share(); var goods_list = null, th = this, that = this; var show_prew_img = this.data.show_prew_img @@ -2404,7 +2404,8 @@ Page({ }, //--点击分享事件--- - onShareAppMessage: function (t) { getApp().globalData.no_clear=1; + onShareAppMessage: function (t) { + getApp().globalData.no_clear=1; var th = this; var price = th.data.sele_g.shop_price; @@ -6375,6 +6376,10 @@ Page({ }, clickShare() { + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } this.setData({ share_hidden: true, }); diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index d9c2b91..4c10c0b 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -200,6 +200,10 @@ Page({ }) }, + onShow:function () { + getApp().check_can_share(); + }, + //设置优惠券的 set_prom_list:async function(arr){ var th=this; diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js index 1909d73..2fe2124 100644 --- a/pages/goods/search/search.js +++ b/pages/goods/search/search.js @@ -139,8 +139,11 @@ Page({ // 获取历史搜索记录 this.getHistorySearch(); }, - - + + onShow:function () { + getApp().check_can_share(); + }, + changeTab: function(t) { var ord = t.currentTarget.dataset.href; var ad = t.currentTarget.dataset.ad; diff --git a/pages/index/index/index.js b/pages/index/index/index.js index aae8c23..fd5d9a2 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -292,6 +292,9 @@ Page({ }, async onShow() { + + getApp().check_can_share(); + this.getTabBar().setData({ cartGoodsNum: getApp().globalData.cartGoodsNum }) diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js index ccb5cec..398d04a 100644 --- a/pages/team/team_show/team_show.js +++ b/pages/team/team_show/team_show.js @@ -142,6 +142,7 @@ Page({ //显示加载 onShow:function(){ + getApp().check_can_share(); var tg_id = this.data.tg_id,th=this; this.init(tg_id); }, diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index 4ba41e5..7c9625d 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -86,6 +86,10 @@ Page({ } }) }, + onShow:function () { + getApp().check_can_share(); + }, + //关闭展开列表 click:function(e){ this.setData({ @@ -845,6 +849,10 @@ Page({ }, clickShare() { + if(!getApp().globalData.user_id){ + getApp().goto("/pages/togoin/togoin"); + return false; + } this.setData({ share_hidden: true, }); diff --git a/pages/template/index.js b/pages/template/index.js index 3cfd960..2f2321a 100644 --- a/pages/template/index.js +++ b/pages/template/index.js @@ -24,6 +24,7 @@ Page({ }, async onShow() { + getApp().check_can_share(); var th = this; await this.init_load(); //如果是自定义模板 diff --git a/pages/user/assistance/assistance.js b/pages/user/assistance/assistance.js index 870dfb8..43cd63f 100644 --- a/pages/user/assistance/assistance.js +++ b/pages/user/assistance/assistance.js @@ -49,6 +49,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); //--先判断会员状态-- getApp().is_Single_page(this, function () { var user_info = getApp().globalData.userInfo; diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js index 7e5df72..9454893 100644 --- a/pages/user/assistance/friend_assistance.js +++ b/pages/user/assistance/friend_assistance.js @@ -54,6 +54,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { + getApp().check_can_share(); //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js index aac604a..48f5128 100644 --- a/pages/user/assistance/task_assistance.js +++ b/pages/user/assistance/task_assistance.js @@ -147,7 +147,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { diff --git a/pages/user/deposit/prepaid/msg/msg.js b/pages/user/deposit/prepaid/msg/msg.js index 6dd0989..99706f5 100644 --- a/pages/user/deposit/prepaid/msg/msg.js +++ b/pages/user/deposit/prepaid/msg/msg.js @@ -30,7 +30,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + getApp().check_can_share(); wx.setNavigationBarTitle({ title: "支付成功", }) diff --git a/pages/user/index/index.js b/pages/user/index/index.js index dd2620b..2593f15 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -84,6 +84,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { + getApp().check_can_share(); //看一下小程序是不是过期了 getApp().getConfig2(function(config2){ if(config2 && config2.is_overdue==1){ diff --git a/pages/user/integral/integral.js b/pages/user/integral/integral.js index 77ee2e7..23f0272 100644 --- a/pages/user/integral/integral.js +++ b/pages/user/integral/integral.js @@ -307,6 +307,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); //--先判断会员状态-- var user_info = getApp().globalData.userInfo; if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { diff --git a/pages/user/integral/msg/msg.js b/pages/user/integral/msg/msg.js index 2764231..8751640 100644 --- a/pages/user/integral/msg/msg.js +++ b/pages/user/integral/msg/msg.js @@ -30,6 +30,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); wx.setNavigationBarTitle({ title: "支付成功", diff --git a/pages/user/member/bring/bring.js b/pages/user/member/bring/bring.js index 6b127fe..8e1bb94 100644 --- a/pages/user/member/bring/bring.js +++ b/pages/user/member/bring/bring.js @@ -328,6 +328,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { + getApp().check_can_share(); var th=this; this.weixin(); this.setData({ diff --git a/pages/user/member/bring/msg/msg.js b/pages/user/member/bring/msg/msg.js index 07780b1..096e2ee 100644 --- a/pages/user/member/bring/msg/msg.js +++ b/pages/user/member/bring/msg/msg.js @@ -30,6 +30,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); this.countDown(); }, countDown: function () { diff --git a/pages/user/member/menber.js b/pages/user/member/menber.js index 8eea293..a5fa887 100644 --- a/pages/user/member/menber.js +++ b/pages/user/member/menber.js @@ -20,6 +20,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + getApp().check_can_share(); var th=this; //--先判断会员状态-- var user_info = getApp().globalData.userInfo; diff --git a/pages/user/user_spsy/user_spsy.js b/pages/user/user_spsy/user_spsy.js index df3d87f..ca2c563 100644 --- a/pages/user/user_spsy/user_spsy.js +++ b/pages/user/user_spsy/user_spsy.js @@ -41,8 +41,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - - + getApp().check_can_share(); }, async getQrCode(FormId,GradeId) { const res = await getApp().request.promiseGet("/api/weshop/users/grade/wares/code/get", { diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js index 8cfde67..e2030cf 100644 --- a/pages/user/userinfo/userinfo.js +++ b/pages/user/userinfo/userinfo.js @@ -740,6 +740,7 @@ Page({ }, onShow: function() { + getApp().check_can_share(); var e = this; if (this.data.is_zy) return false; this.wait_for_store_config(); diff --git a/pages/user/userqy/userqy.js b/pages/user/userqy/userqy.js index f0a4579..58789d0 100644 --- a/pages/user/userqy/userqy.js +++ b/pages/user/userqy/userqy.js @@ -53,6 +53,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: async function () { + getApp().check_can_share(); wx.showLoading(); var cz_val=0,backClass=null,qy_list=null,gradeId=null,gradeEndDate=null,need_money=0,g_qy_list=null,GradeName='',cur_g_num=0; var gl_data=getApp().globalData; -- libgit2 0.21.4