Commit c210f9cfad8bc957faf9b5eb464caf05b4f98c14

Authored by yvan.ni
1 parent 09527301

助力分享的页面禁止右上角和复制

packageA/pages/activity_share/activity_share.js
... ... @@ -127,7 +127,10 @@ Page({
127 127 /**
128 128 * 生命周期函数--监听页面显示
129 129 */
130   - onShow: function () { getApp().check_can_share(); },
  130 + onShow: function () {
  131 + //getApp().check_can_share();
  132 + ut.close_menu();
  133 + },
131 134 /**
132 135 * 生命周期函数--监听页面隐藏
133 136 */
... ...
packageA/pages/goods_share/goods_share.js
... ... @@ -123,7 +123,8 @@ Page({
123 123  
124 124 /*** 生命周期函数--监听页面显示***/
125 125 onShow: function () {
126   - getApp().check_can_share();
  126 + //getApp().check_can_share();
  127 + ut.close_menu();
127 128 var th=this;
128 129  
129 130 if(app.globalData.userInfo) {
... ...
packageA/pages/live_share/live_share.js
... ... @@ -44,7 +44,8 @@ Page({
44 44 * 生命周期函数--监听页面显示
45 45 */
46 46 onShow: function () {
47   - getApp().check_can_share();
  47 + //getApp().check_can_share();
  48 + ut.close_menu();
48 49 },
49 50  
50 51 /**
... ...
packageA/pages/quan/quan.js
... ... @@ -48,7 +48,10 @@ Page({
48 48 /**
49 49 * 生命周期函数--监听页面显示
50 50 */
51   - onShow: function () { getApp().check_can_share(); },
  51 + onShow: function () {
  52 + // getApp().check_can_share();
  53 + ut.close_menu();
  54 + },
52 55  
53 56 /**
54 57 * 生命周期函数--监听页面隐藏
... ...
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 };
... ...