Commit 5d058d285bcc746a154fc50dbfb6fc01e5d46033
1 parent
3f92d272
首页的分享的功能~~
Showing
3 changed files
with
20 additions
and
7 deletions
app.js
@@ -51,7 +51,7 @@ App({ | @@ -51,7 +51,7 @@ App({ | ||
51 | config: null, //门店参数 | 51 | config: null, //门店参数 |
52 | config2: null, //门店配置 | 52 | config2: null, //门店配置 |
53 | code: null, | 53 | code: null, |
54 | - user_id:null,//6520119 qa 4687 6519901 zs 10153869 | 54 | + user_id:null,// 6520210,//6520119 qa 4687 6519901 zs 10153869 |
55 | buy_now: null, | 55 | buy_now: null, |
56 | picklist: null, //门店列表 | 56 | picklist: null, //门店列表 |
57 | wuliuprice: null, //物流价格表 | 57 | wuliuprice: null, //物流价格表 |
@@ -428,7 +428,7 @@ App({ | @@ -428,7 +428,7 @@ App({ | ||
428 | "function" == typeof func && func(th.globalData.picklist); | 428 | "function" == typeof func && func(th.globalData.picklist); |
429 | } | 429 | } |
430 | }) | 430 | }) |
431 | - } | 431 | + } |
432 | }, | 432 | }, |
433 | 433 | ||
434 | //同步化,在调用的时候要await | 434 | //同步化,在调用的时候要await |
@@ -988,8 +988,15 @@ App({ | @@ -988,8 +988,15 @@ App({ | ||
988 | 988 | ||
989 | //检验能不能分享 | 989 | //检验能不能分享 |
990 | check_can_share() { | 990 | check_can_share() { |
991 | - if (!this.globalData.user_id) wx.hideShareMenu(); | ||
992 | - else wx.showShareMenu(); | 991 | + |
992 | + var userinfo=wx.getStorageSync("userinfo"); | ||
993 | + if (!this.globalData.user_id && !userinfo) wx.hideShareMenu(); | ||
994 | + else{ | ||
995 | + wx.showShareMenu({ | ||
996 | + withShareTicket: true, | ||
997 | + menus: ["shareAppMessage", "shareTimeline"], | ||
998 | + }); | ||
999 | + } | ||
993 | }, | 1000 | }, |
994 | 1001 | ||
995 | //--- 判断是不是皮肤的商品的公共函数 --- | 1002 | //--- 判断是不是皮肤的商品的公共函数 --- |
pages/index/index/index.js
@@ -106,6 +106,9 @@ Page({ | @@ -106,6 +106,9 @@ Page({ | ||
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | + console.log("first_leader:"+first_leader,"onload"); | ||
110 | + | ||
111 | + | ||
109 | getApp().getConfig(function (e) { | 112 | getApp().getConfig(function (e) { |
110 | //--首页的问题-- | 113 | //--首页的问题-- |
111 | if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { | 114 | if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { |
@@ -1185,8 +1188,11 @@ Page({ | @@ -1185,8 +1188,11 @@ Page({ | ||
1185 | if (!store_name){ | 1188 | if (!store_name){ |
1186 | store_name = getApp().globalData.setting.appName; | 1189 | store_name = getApp().globalData.setting.appName; |
1187 | } | 1190 | } |
1191 | + var user_id=getApp().globalData.user_id; | ||
1192 | + if(!user_id) user_id=0; | ||
1188 | return { | 1193 | return { |
1189 | title: '首页-' + '-' + store_name, | 1194 | title: '首页-' + '-' + store_name, |
1195 | + query: 'first_leader='+user_id | ||
1190 | } | 1196 | } |
1191 | }, | 1197 | }, |
1192 | 1198 |
pages/template/index.js
@@ -142,7 +142,7 @@ Page({ | @@ -142,7 +142,7 @@ Page({ | ||
142 | }) | 142 | }) |
143 | }.bind(this)) | 143 | }.bind(this)) |
144 | var {share_title,temp_id,store_config} = this.data; | 144 | var {share_title,temp_id,store_config} = this.data; |
145 | - var url= `pages/template/index?sence=${temp_id}`; | 145 | + var url= `sence=${temp_id}`; |
146 | 146 | ||
147 | var userInfo = getApp().globalData.userInfo; | 147 | var userInfo = getApp().globalData.userInfo; |
148 | //是分销商才带 | 148 | //是分销商才带 |
@@ -152,8 +152,8 @@ Page({ | @@ -152,8 +152,8 @@ Page({ | ||
152 | 152 | ||
153 | var ob = { | 153 | var ob = { |
154 | title:share_title, | 154 | title:share_title, |
155 | - path: url, | ||
156 | - //query:`sence=${temp_id}`, | 155 | + //path: url, |
156 | + query:url, | ||
157 | imageUrl:this.data.url+store_config.store_logo, | 157 | imageUrl:this.data.url+store_config.store_logo, |
158 | }; | 158 | }; |
159 | console.log(ob); | 159 | console.log(ob); |