Commit 235fbfb5cc67e02d39c9eaaed1300201e89e89f8

Authored by 前端开发-罗建龙
1 parent e4002f25

群id分享

packageA/pages/jfbuy/jfbuy.js
@@ -73,7 +73,10 @@ Page({ @@ -73,7 +73,10 @@ Page({
73 page:th.data.currentPage2, 73 page:th.data.currentPage2,
74 pageSize:th.data.pageSize 74 pageSize:th.data.pageSize
75 }; 75 };
76 - 76 + //群id
  77 + if(options && options.groupchat_id){
  78 + getApp().globalData.groupchat_id=options.groupchat_id
  79 + }
77 var clientHeight = wx.getSystemInfoSync().windowHeight; 80 var clientHeight = wx.getSystemInfoSync().windowHeight;
78 var clientWidth = wx.getSystemInfoSync().windowWidth; 81 var clientWidth = wx.getSystemInfoSync().windowWidth;
79 this.data.clientHeight=clientHeight; 82 this.data.clientHeight=clientHeight;
@@ -204,8 +207,20 @@ Page({ @@ -204,8 +207,20 @@ Page({
204 pagePath += '&first_leader=' + getApp().globalData.user_id; 207 pagePath += '&first_leader=' + getApp().globalData.user_id;
205 }else{ 208 }else{
206 pagePath += '?first_leader=' + getApp().globalData.user_id; 209 pagePath += '?first_leader=' + getApp().globalData.user_id;
207 - }  
208 - } 210 + }
  211 + //群id分享
  212 + if (getApp().globalData.groupchat_id) {
  213 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  214 + }
  215 + }else{
  216 + if(pagePath.indexOf("?")>0){
  217 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  218 + }else{
  219 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  220 + }
  221 +
  222 + }
  223 +
209 return { 224 return {
210 title: store_name + '-积分购', 225 title: store_name + '-积分购',
211 path: pagePath, 226 path: pagePath,
@@ -276,10 +291,15 @@ Page({ @@ -276,10 +291,15 @@ Page({
276 var user_id=getApp().globalData.user_id; 291 var user_id=getApp().globalData.user_id;
277 if(!user_id) user_id=0; 292 if(!user_id) user_id=0;
278 if(!store_name) store_name = getApp().globalData.setting.appName; 293 if(!store_name) store_name = getApp().globalData.setting.appName;
  294 + var url=''
  295 + //群id分享
  296 + if (getApp().globalData.groupchat_id) {
  297 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  298 + }
279 299
280 return { 300 return {
281 title: store_name + '-积分购', 301 title: store_name + '-积分购',
282 - query: 'first_leader='+user_id 302 + query: 'first_leader='+user_id+url
283 } 303 }
284 }, 304 },
285 305
packageA/pages/prom_list/prom_list.js
@@ -50,6 +50,10 @@ Page({ @@ -50,6 +50,10 @@ Page({
50 var room_id=t.room_id; 50 var room_id=t.room_id;
51 this.setData({gid:goods_id}); 51 this.setData({gid:goods_id});
52 52
  53 + //群id
  54 + if(t && t.groupchat_id){
  55 + getApp().globalData.groupchat_id=t.groupchat_id
  56 + }
53 if(room_id) this.data.room_id=room_id; //房间号要存起来 57 if(room_id) this.data.room_id=room_id; //房间号要存起来
54 var ee=this,th=ee,that=ee; 58 var ee=this,th=ee,that=ee;
55 var first_leader=t.first_leader; 59 var first_leader=t.first_leader;
@@ -821,8 +825,19 @@ Page({ @@ -821,8 +825,19 @@ Page({
821 pagePath+="&goods_id="+this.data.gid+" &first_leader="+getApp().globalData.user_id; 825 pagePath+="&goods_id="+this.data.gid+" &first_leader="+getApp().globalData.user_id;
822 }else{ 826 }else{
823 pagePath+="?goods_id="+this.data.gid+"&first_leader="+getApp().globalData.user_id; 827 pagePath+="?goods_id="+this.data.gid+"&first_leader="+getApp().globalData.user_id;
824 - }  
825 - } 828 + }
  829 + //群id分享
  830 + if (getApp().globalData.groupchat_id) {
  831 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  832 + }
  833 + }else{
  834 + if(pagePath.indexOf("?")>0){
  835 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  836 + }else{
  837 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  838 + }
  839 +
  840 + }
826 841
827 console.log("111"); 842 console.log("111");
828 console.log(pagePath); 843 console.log(pagePath);
packageC/pages/group_list/group_list.js
@@ -27,7 +27,10 @@ Page({ @@ -27,7 +27,10 @@ Page({
27 */ 27 */
28 onLoad: function (options) { 28 onLoad: function (options) {
29 self = this; 29 self = this;
30 - 30 + //群id
  31 + if(options && options.groupchat_id){
  32 + getApp().globalData.groupchat_id=options.groupchat_id
  33 + }
31 app.isLogin().then(function(data) {//进入页面前已经授权登录成功 34 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
32 self.setData({ 35 self.setData({
33 userInfo: data, 36 userInfo: data,
@@ -153,7 +156,41 @@ Page({ @@ -153,7 +156,41 @@ Page({
153 /** 156 /**
154 * 用户点击右上角分享 157 * 用户点击右上角分享
155 */ 158 */
156 - onShareAppMessage: function () { getApp().globalData.no_clear=1; }, 159 + onShareAppMessage: function () {
  160 + getApp().globalData.no_clear=1;
  161 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
  162 +
  163 + var pagePath = this.route; //当前页面url
  164 +
  165 + if(!store_name) store_name = getApp().globalData.setting.appName;
  166 +
  167 + if(pagePath.indexOf('/') != 0) {
  168 + pagePath = '/' + pagePath;
  169 + }
  170 +
  171 + if(getApp().globalData.user_id){
  172 + if(pagePath.indexOf('?')>0){
  173 + pagePath += '&first_leader=' + getApp().globalData.user_id;
  174 + }else{
  175 + pagePath += '?first_leader=' + getApp().globalData.user_id;
  176 + }
  177 + //群id分享
  178 + if (getApp().globalData.groupchat_id) {
  179 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  180 + }
  181 + }else{
  182 + if(pagePath.indexOf("?")>0){
  183 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  184 + }else{
  185 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  186 + }
  187 + }
  188 +
  189 + return {
  190 + title: store_name + '-团购',
  191 + path: pagePath,
  192 + }
  193 + },
157 194
158 195
159 /** 196 /**
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
@@ -15,7 +15,10 @@ Page({ @@ -15,7 +15,10 @@ Page({
15 15
16 onLoad: function (options) { 16 onLoad: function (options) {
17 self = this; 17 self = this;
18 - 18 + //群id
  19 + if(options && options.groupchat_id){
  20 + getApp().globalData.groupchat_id=options.groupchat_id
  21 + }
19 var first_leader = options.first_leader; 22 var first_leader = options.first_leader;
20 if(first_leader) { 23 if(first_leader) {
21 app.globalData.first_leader = first_leader; 24 app.globalData.first_leader = first_leader;
@@ -204,7 +207,18 @@ Page({ @@ -204,7 +207,18 @@ Page({
204 }else{ 207 }else{
205 pagePath+="?first_leader="+getApp().globalData.user_id; 208 pagePath+="?first_leader="+getApp().globalData.user_id;
206 } 209 }
207 - } 210 + //群id分享
  211 + if (getApp().globalData.groupchat_id) {
  212 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  213 + }
  214 + }else{
  215 + if(pagePath.indexOf("?")>0){
  216 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  217 + }else{
  218 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  219 + }
  220 +
  221 + }
208 return { 222 return {
209 title: "幸运购活动列表", 223 title: "幸运购活动列表",
210 path: pagePath, 224 path: pagePath,
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -294,6 +294,10 @@ Page({ @@ -294,6 +294,10 @@ Page({
294 this.data.group_id = t.group_id; 294 this.data.group_id = t.group_id;
295 }; 295 };
296 296
  297 + //群id
  298 + if(t && t.groupchat_id){
  299 + getApp().globalData.groupchat_id=t.groupchat_id
  300 + }
297 301
298 var ee = this, 302 var ee = this,
299 that = ee, 303 that = ee,
@@ -2616,6 +2620,11 @@ Page({ @@ -2616,6 +2620,11 @@ Page({
2616 } 2620 }
2617 } 2621 }
2618 2622
  2623 + //群id分享
  2624 + if (getApp().globalData.groupchat_id) {
  2625 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  2626 + }
  2627 +
2619 return { 2628 return {
2620 title: "邀您一起参加幸运购", 2629 title: "邀您一起参加幸运购",
2621 path: pagePath, 2630 path: pagePath,
@@ -6255,6 +6264,10 @@ Page({ @@ -6255,6 +6264,10 @@ Page({
6255 if(getApp().globalData.user_id){ 6264 if(getApp().globalData.user_id){
6256 pagePath+="&first_leader="+getApp().globalData.user_id; 6265 pagePath+="&first_leader="+getApp().globalData.user_id;
6257 } 6266 }
  6267 + //群id分享
  6268 + if (getApp().globalData.groupchat_id) {
  6269 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  6270 + }
6258 6271
6259 return { 6272 return {
6260 title: this.data.data.goods_name + '-' + store_name, 6273 title: this.data.data.goods_name + '-' + store_name,
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -269,6 +269,11 @@ Page({ @@ -269,6 +269,11 @@ Page({
269 room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id 269 room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
270 //检查测肤 270 //检查测肤
271 getApp().check_skin_face(t, 0, gid); 271 getApp().check_skin_face(t, 0, gid);
  272 + //群id
  273 + if(t && t.groupchat_id){
  274 + getApp().globalData.groupchat_id=t.groupchat_id
  275 + }
  276 +
272 277
273 //-- 自定义海报 -- 278 //-- 自定义海报 --
274 getApp().request.promiseGet("/api/weshop/goods/poster/page", { 279 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
@@ -1611,6 +1616,11 @@ Page({ @@ -1611,6 +1616,11 @@ Page({
1611 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; 1616 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
1612 } 1617 }
1613 1618
  1619 + //群id分享
  1620 + if (getApp().globalData.groupchat_id) {
  1621 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  1622 + }
  1623 +
1614 var ob = { 1624 var ob = {
1615 title: price + "元 " + title, 1625 title: price + "元 " + title,
1616 path: url, 1626 path: url,
@@ -4192,8 +4202,18 @@ Page({ @@ -4192,8 +4202,18 @@ Page({
4192 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 4202 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
4193 if (!store_name) 4203 if (!store_name)
4194 store_name = getApp().globalData.setting.appName; 4204 store_name = getApp().globalData.setting.appName;
  4205 +
  4206 + var user_id=getApp().globalData.user_id;
  4207 + if(!user_id) user_id=0;
  4208 + var url=''
  4209 + //群id分享
  4210 + if (getApp().globalData.groupchat_id) {
  4211 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  4212 + }
  4213 +
4195 return { 4214 return {
4196 title: this.data.data.goods_name + '-' + store_name, 4215 title: this.data.data.goods_name + '-' + store_name,
  4216 + query: 'first_leader='+user_id+url,
4197 imageUrl: this.data.gallery[0].image_url, 4217 imageUrl: this.data.gallery[0].image_url,
4198 } 4218 }
4199 }, 4219 },
packageC/pages/presell/list/list.js
@@ -20,7 +20,10 @@ Page({ @@ -20,7 +20,10 @@ Page({
20 var th = this; 20 var th = this;
21 getApp().getConfig(); 21 getApp().getConfig();
22 this.data.act_id=t.act_id; 22 this.data.act_id=t.act_id;
23 - 23 + //群id
  24 + if(t && t.groupchat_id){
  25 + getApp().globalData.groupchat_id=t.groupchat_id
  26 + }
24 if (first_leader) { 27 if (first_leader) {
25 getApp().globalData.first_leader = first_leader; 28 getApp().globalData.first_leader = first_leader;
26 //调用接口判断是不是会员 29 //调用接口判断是不是会员
@@ -299,7 +302,17 @@ Page({ @@ -299,7 +302,17 @@ Page({
299 url += "?first_leader=" + getApp().globalData.user_id; 302 url += "?first_leader=" + getApp().globalData.user_id;
300 else 303 else
301 url += "&first_leader=" + getApp().globalData.user_id; 304 url += "&first_leader=" + getApp().globalData.user_id;
302 - } 305 +
  306 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  307 +
  308 + }else{
  309 + if(url.indexOf("?")>0){
  310 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  311 + }else{
  312 + url+="?groupchat_id="+getApp().globalData.groupchat_id
  313 + }
  314 +
  315 + }
303 //-- 如果房间分享,且不是会员分享的 -- 316 //-- 如果房间分享,且不是会员分享的 --
304 if (getApp().globalData.room_id && 317 if (getApp().globalData.room_id &&
305 this.data.data.goods_id == getApp().globalData.room_goods_id && 318 this.data.data.goods_id == getApp().globalData.room_goods_id &&
packageE/pages/cart/cart2/cart2.js
@@ -4087,7 +4087,7 @@ Page({ @@ -4087,7 +4087,7 @@ Page({
4087 4087
4088 4088
4089 var check_map = {}; 4089 var check_map = {};
4090 - 4090 + let groupchat_ids=[]
4091 //-------------让商品添加到商品列表-------------------- 4091 //-------------让商品添加到商品列表--------------------
4092 for (var k = 0; k < t_item.goods.length; k++) { 4092 for (var k = 0; k < t_item.goods.length; k++) {
4093 4093
@@ -4196,6 +4196,7 @@ Page({ @@ -4196,6 +4196,7 @@ Page({
4196 4196
4197 if(g_item.groupchat_id){ 4197 if(g_item.groupchat_id){
4198 goods.groupchat_id=g_item.groupchat_id; 4198 goods.groupchat_id=g_item.groupchat_id;
  4199 + groupchat_ids.push(g_item.groupchat_id);
4199 } 4200 }
4200 //如果有阶梯促销 4201 //如果有阶梯促销
4201 if (g_item.ladder_list_id) { 4202 if (g_item.ladder_list_id) {
@@ -4234,7 +4235,7 @@ Page({ @@ -4234,7 +4235,7 @@ Page({
4234 4235
4235 //如果房间号不为空的时候 4236 //如果房间号不为空的时候
4236 if (room_ids != "") item.room_ids = ut.sub_last(room_ids); 4237 if (room_ids != "") item.room_ids = ut.sub_last(room_ids);
4237 - if (getApp().globalData.groupchat_id) item.groupchat_ids = getApp().globalData.groupchat_id; 4238 + if (groupchat_ids && groupchat_ids.length>0) item.groupchat_ids = groupchat_ids.join(',');
4238 // if (getApp().globalData.groupchat_id) {item.groupchat_id = getApp().globalData.groupchat_id;} 4239 // if (getApp().globalData.groupchat_id) {item.groupchat_id = getApp().globalData.groupchat_id;}
4239 //处理代发商品的拆分 4240 //处理代发商品的拆分
4240 if (df_goods.length > 0) { 4241 if (df_goods.length > 0) {
pages/activity/pind_list/pind_list.js
@@ -23,6 +23,10 @@ Page({ @@ -23,6 +23,10 @@ Page({
23 23
24 //------初始化加载---------- 24 //------初始化加载----------
25 onLoad: function (t) { 25 onLoad: function (t) {
  26 + //群id
  27 + if(t && t.groupchat_id){
  28 + getApp().globalData.groupchat_id=t.groupchat_id
  29 + }
26 wx.setNavigationBarTitle({ 30 wx.setNavigationBarTitle({
27 title: "天天拼单", 31 title: "天天拼单",
28 }) 32 })
@@ -220,6 +224,17 @@ Page({ @@ -220,6 +224,17 @@ Page({
220 } else { 224 } else {
221 pagePath += "?first_leader=" + getApp().globalData.user_id; 225 pagePath += "?first_leader=" + getApp().globalData.user_id;
222 } 226 }
  227 + //群id分享
  228 + if (getApp().globalData.groupchat_id) {
  229 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  230 + }
  231 + }else{
  232 + if(pagePath.indexOf("?")>0){
  233 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  234 + }else{
  235 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  236 + }
  237 +
223 } 238 }
224 239
225 console.log("11" + pagePath); 240 console.log("11" + pagePath);
@@ -267,9 +282,14 @@ Page({ @@ -267,9 +282,14 @@ Page({
267 store_name = getApp().globalData.setting.appName; 282 store_name = getApp().globalData.setting.appName;
268 var user_id=getApp().globalData.user_id; 283 var user_id=getApp().globalData.user_id;
269 if(!user_id) user_id=0; 284 if(!user_id) user_id=0;
  285 + var url=''
  286 + //群id分享
  287 + if (getApp().globalData.groupchat_id) {
  288 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  289 + }
270 return { 290 return {
271 title: '拼团活动-' + store_name, 291 title: '拼团活动-' + store_name,
272 - query: 'first_leader='+user_id 292 + query: 'first_leader='+user_id+url
273 293
274 } 294 }
275 }, 295 },
pages/activity/seckill_list/seckill_list.js
@@ -22,6 +22,10 @@ Page({ @@ -22,6 +22,10 @@ Page({
22 22
23 //------初始化加载---------- 23 //------初始化加载----------
24 onLoad: function (t) { 24 onLoad: function (t) {
  25 + //群id
  26 + if(t && t.groupchat_id){
  27 + getApp().globalData.groupchat_id=t.groupchat_id
  28 + }
25 wx.setNavigationBarTitle({ 29 wx.setNavigationBarTitle({
26 title: "商品秒杀", 30 title: "商品秒杀",
27 }) 31 })
@@ -258,8 +262,19 @@ Page({ @@ -258,8 +262,19 @@ Page({
258 } else { 262 } else {
259 pagePath += "?first_leader=" + getApp().globalData.user_id; 263 pagePath += "?first_leader=" + getApp().globalData.user_id;
260 } 264 }
  265 + //群id分享
  266 + if (getApp().globalData.groupchat_id) {
  267 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  268 + }
  269 + }else{
  270 + if(pagePath.indexOf("?")>0){
  271 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  272 + }else{
  273 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  274 + }
261 } 275 }
262 276
  277 +
263 console.log("11" + pagePath); 278 console.log("11" + pagePath);
264 return { 279 return {
265 title: "限时秒杀", 280 title: "限时秒杀",
@@ -286,10 +301,16 @@ Page({ @@ -286,10 +301,16 @@ Page({
286 301
287 var user_id=getApp().globalData.user_id; 302 var user_id=getApp().globalData.user_id;
288 if(!user_id) user_id=0; 303 if(!user_id) user_id=0;
  304 + var url=""
  305 + //群id分享
  306 + if (getApp().globalData.groupchat_id) {
  307 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  308 + }
  309 +
289 310
290 return { 311 return {
291 title: '秒杀活动-' + store_name, 312 title: '秒杀活动-' + store_name,
292 - query: 'first_leader='+user_id 313 + query: 'first_leader='+user_id+url
293 } 314 }
294 }, 315 },
295 316
pages/goods/categoryList/categoryList.js
@@ -105,6 +105,11 @@ Page({ @@ -105,6 +105,11 @@ Page({
105 // console.log(rect); 105 // console.log(rect);
106 // }).exec() 106 // }).exec()
107 107
  108 + //群id
  109 + if(tt && tt.groupchat_id){
  110 + getApp().globalData.groupchat_id=tt.groupchat_id
  111 + }
  112 +
108 var that = this; 113 var that = this;
109 var first_leader = tt.first_leader; 114 var first_leader = tt.first_leader;
110 if (first_leader) { 115 if (first_leader) {
@@ -678,7 +683,19 @@ Page({ @@ -678,7 +683,19 @@ Page({
678 //是分销商才带 683 //是分销商才带
679 if (userInfo) { 684 if (userInfo) {
680 url += "?first_leader=" + userInfo.user_id; 685 url += "?first_leader=" + userInfo.user_id;
  686 + //群id分享
  687 + if (getApp().globalData.groupchat_id) {
  688 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  689 + }
  690 + }else{
  691 + //群id分享
  692 + if (getApp().globalData.groupchat_id) {
  693 + url+="?groupchat_id="+getApp().globalData.groupchat_id
  694 + }
681 } 695 }
  696 +
  697 +
  698 +
682 console.log("--分类分享---分享--"); 699 console.log("--分类分享---分享--");
683 console.log(url); 700 console.log(url);
684 701
@@ -1237,10 +1254,14 @@ Page({ @@ -1237,10 +1254,14 @@ Page({
1237 1254
1238 var user_id = getApp().globalData.user_id; 1255 var user_id = getApp().globalData.user_id;
1239 if (!user_id) user_id = 0; 1256 if (!user_id) user_id = 0;
1240 - 1257 + var url=''
  1258 + //群id分享
  1259 + if (getApp().globalData.groupchat_id) {
  1260 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  1261 + }
1241 return { 1262 return {
1242 title: '商品分类-' + store_name, 1263 title: '商品分类-' + store_name,
1243 - query: "first_leader=" + user_id 1264 + query: "first_leader=" + user_id+url
1244 } 1265 }
1245 } 1266 }
1246 1267
pages/goods/goodsInfo/goodsInfo.js
@@ -275,13 +275,18 @@ Page({ @@ -275,13 +275,18 @@ Page({
275 th = ee, 275 th = ee,
276 gid = t.goods_id, 276 gid = t.goods_id,
277 first_leader = t.first_leader, 277 first_leader = t.first_leader,
  278 +
278 room_id = t.room_id, 279 room_id = t.room_id,
279 room_user_share = t.room_user_share, //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id 280 room_user_share = t.room_user_share, //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
280 prom_type = t.prom_type || 0, 281 prom_type = t.prom_type || 0,
281 prom_id = t.prom_id || 0; //活动ID 282 prom_id = t.prom_id || 0; //活动ID
282 283
283 var share_openid = t.share_openid; 284 var share_openid = t.share_openid;
284 - 285 + //群id
  286 + if(t && t.groupchat_id){
  287 + getApp().globalData.groupchat_id=t.groupchat_id
  288 + }
  289 +
285 290
286 self = this; 291 self = this;
287 292
@@ -3021,6 +3026,11 @@ Page({ @@ -3021,6 +3026,11 @@ Page({
3021 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; 3026 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
3022 } 3027 }
3023 3028
  3029 + //群id分享
  3030 + if (getApp().globalData.groupchat_id) {
  3031 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  3032 + }
  3033 +
3024 var ob = { 3034 var ob = {
3025 title: price + "元 " + title, 3035 title: price + "元 " + title,
3026 path: url, 3036 path: url,
@@ -7485,6 +7495,11 @@ Page({ @@ -7485,6 +7495,11 @@ Page({
7485 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; 7495 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
7486 } 7496 }
7487 7497
  7498 + //群id分享
  7499 + if (getApp().globalData.groupchat_id) {
  7500 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  7501 + }
  7502 +
7488 return { 7503 return {
7489 title: this.data.data.goods_name + '-' + store_name, 7504 title: this.data.data.goods_name + '-' + store_name,
7490 imageUrl: this.data.gallery[0].image_url, 7505 imageUrl: this.data.gallery[0].image_url,
pages/goods/search/search.js
@@ -44,7 +44,10 @@ Page({ @@ -44,7 +44,10 @@ Page({
44 44
45 onLoad: function (t) { 45 onLoad: function (t) {
46 this.data.rq_data = t; 46 this.data.rq_data = t;
47 - 47 + //群id
  48 + if(t && t.groupchat_id){
  49 + getApp().globalData.groupchat_id=t.groupchat_id
  50 + }
48 if (t.o) { 51 if (t.o) {
49 this.data.rq_data.o = JSON.parse(t.o); 52 this.data.rq_data.o = JSON.parse(t.o);
50 }; 53 };
@@ -430,6 +433,10 @@ Page({ @@ -430,6 +433,10 @@ Page({
430 pagePath += "?first_leader=" + getApp().globalData.user_id; 433 pagePath += "?first_leader=" + getApp().globalData.user_id;
431 } 434 }
432 } 435 }
  436 + //群id分享
  437 + if (getApp().globalData.groupchat_id) {
  438 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  439 + }
433 440
434 // console.log("11-11"+pagePath); 441 // console.log("11-11"+pagePath);
435 return { 442 return {
pages/index/index/index.js
@@ -91,13 +91,19 @@ Page({ @@ -91,13 +91,19 @@ Page({
91 91
92 92
93 onLoad: async function (tt) { 93 onLoad: async function (tt) {
  94 + console.error('分享群id');
  95 + console.error(tt);
  96 + console.error('...................................');
94 wx.showShareMenu({ 97 wx.showShareMenu({
95 withShareTicket:true, 98 withShareTicket:true,
96 menus:['shareAppMessage','shareTimeline'] 99 menus:['shareAppMessage','shareTimeline']
97 }) 100 })
98 var th = this; 101 var th = this;
99 var first_leader = tt.first_leader; 102 var first_leader = tt.first_leader;
100 - 103 + //群id
  104 + if(tt && tt.groupchat_id){
  105 + getApp().globalData.groupchat_id=tt.groupchat_id
  106 + }
101 if (!first_leader && tt.scene) { 107 if (!first_leader && tt.scene) {
102 var first_leader_str = decodeURIComponent(tt.scene); 108 var first_leader_str = decodeURIComponent(tt.scene);
103 var f_arr = first_leader_str.split("_"); 109 var f_arr = first_leader_str.split("_");
@@ -929,8 +935,17 @@ Page({ @@ -929,8 +935,17 @@ Page({
929 var userInfo = getApp().globalData.userInfo; 935 var userInfo = getApp().globalData.userInfo;
930 //是分销商才带 936 //是分销商才带
931 if (userInfo) { 937 if (userInfo) {
932 - url += "?first_leader=" + userInfo.user_id;  
933 - } 938 + url += "?first_leader=" + userInfo.user_id;
  939 + //群id分享
  940 + if (getApp().globalData.groupchat_id) {
  941 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  942 + }
  943 + }else{
  944 + //群id分享
  945 + if (getApp().globalData.groupchat_id) {
  946 + url+="?groupchat_id="+getApp().globalData.groupchat_id
  947 + }
  948 + }
934 console.log("---首页---分享--"); 949 console.log("---首页---分享--");
935 var title = "商城首页" 950 var title = "商城首页"
936 //分享 951 //分享
@@ -938,7 +953,9 @@ Page({ @@ -938,7 +953,9 @@ Page({
938 title = getApp().globalData.config.store_name; 953 title = getApp().globalData.config.store_name;
939 } else if (getApp().globalData.setting.appName) { 954 } else if (getApp().globalData.setting.appName) {
940 title = getApp().globalData.setting.appName; 955 title = getApp().globalData.setting.appName;
941 - } 956 + }
  957 +
  958 +
942 959
943 var ob = { 960 var ob = {
944 title: title, 961 title: title,
@@ -1336,9 +1353,14 @@ Page({ @@ -1336,9 +1353,14 @@ Page({
1336 } 1353 }
1337 var user_id=getApp().globalData.user_id; 1354 var user_id=getApp().globalData.user_id;
1338 if(!user_id) user_id=0; 1355 if(!user_id) user_id=0;
  1356 + var url=''
  1357 + //群id分享
  1358 + if (getApp().globalData.groupchat_id) {
  1359 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  1360 + }
1339 return { 1361 return {
1340 title: '首页-' + '-' + store_name, 1362 title: '首页-' + '-' + store_name,
1341 - query: 'first_leader='+user_id 1363 + query: 'first_leader='+user_id+url
1342 } 1364 }
1343 }, 1365 },
1344 1366