Commit c210f9cfad8bc957faf9b5eb464caf05b4f98c14
1 parent
09527301
助力分享的页面禁止右上角和复制
Showing
6 changed files
with
35 additions
and
7 deletions
packageA/pages/activity_share/activity_share.js
packageA/pages/goods_share/goods_share.js
packageA/pages/live_share/live_share.js
packageA/pages/quan/quan.js
packageA/pages/service_share/service_share.js
... | ... | @@ -97,10 +97,11 @@ Page({ |
97 | 97 | |
98 | 98 | /*** 生命周期函数--监听页面显示***/ |
99 | 99 | onShow: function () { |
100 | - getApp().check_can_share(); | |
100 | + //getApp().check_can_share(); | |
101 | + ut.close_menu(); | |
101 | 102 | |
102 | - var th=this; | |
103 | - getApp().getConfig2(function(rs){ | |
103 | + var th=this; | |
104 | + getApp().getConfig2(function(rs){ | |
104 | 105 | //计算等级价相关 |
105 | 106 | var swithc_list=rs.switch_list; |
106 | 107 | var sw_arr=JSON.parse(swithc_list); | ... | ... |
utils/util.js
... | ... | @@ -1042,5 +1042,24 @@ module.exports = { |
1042 | 1042 | paramObj[key] = value; |
1043 | 1043 | } |
1044 | 1044 | return paramObj; |
1045 | + }, | |
1046 | + close_menu(){ | |
1047 | + wx.hideShareMenu(); | |
1048 | + try{ | |
1049 | + wx.offCopyUrl() | |
1050 | + //替换掉复制链接 | |
1051 | + wx.onCopyUrl(() => { | |
1052 | + setTimeout(()=>{ | |
1053 | + wx.setClipboardData({ | |
1054 | + data: '暂不支持分享', | |
1055 | + success (res) { } | |
1056 | + }) | |
1057 | + },500) | |
1058 | + return { query: 'a=1&b=2' } | |
1059 | + }) | |
1060 | + | |
1061 | + }catch(err){ | |
1062 | + | |
1063 | + } | |
1045 | 1064 | } |
1046 | 1065 | }; | ... | ... |