Commit 5d058d285bcc746a154fc50dbfb6fc01e5d46033

Authored by yvan.ni
1 parent 3f92d272

首页的分享的功能~~

... ... @@ -51,7 +51,7 @@ App({
51 51 config: null, //门店参数
52 52 config2: null, //门店配置
53 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 55 buy_now: null,
56 56 picklist: null, //门店列表
57 57 wuliuprice: null, //物流价格表
... ... @@ -428,7 +428,7 @@ App({
428 428 "function" == typeof func && func(th.globalData.picklist);
429 429 }
430 430 })
431   - }
  431 + }
432 432 },
433 433  
434 434 //同步化,在调用的时候要await
... ... @@ -988,8 +988,15 @@ App({
988 988  
989 989 //检验能不能分享
990 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 106 }
107 107 }
108 108  
  109 + console.log("first_leader:"+first_leader,"onload");
  110 +
  111 +
109 112 getApp().getConfig(function (e) {
110 113 //--首页的问题--
111 114 if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {
... ... @@ -1185,8 +1188,11 @@ Page({
1185 1188 if (!store_name){
1186 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 1193 return {
1189 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 142 })
143 143 }.bind(this))
144 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 147 var userInfo = getApp().globalData.userInfo;
148 148 //是分销商才带
... ... @@ -152,8 +152,8 @@ Page({
152 152  
153 153 var ob = {
154 154 title:share_title,
155   - path: url,
156   - //query:`sence=${temp_id}`,
  155 + //path: url,
  156 + query:url,
157 157 imageUrl:this.data.url+store_config.store_logo,
158 158 };
159 159 console.log(ob);
... ...