Commit 3b8ba57db24d2b9718734a2a6c562bd744daa673

Authored by season
2 parents 73c38c9d 2aa95b26

Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa

Showing 48 changed files with 2611 additions and 743 deletions
... ... @@ -51,7 +51,7 @@ App({
51 51 config: null, //门店参数
52 52 config2: null, //门店配置
53 53 code: null,
54   - user_id:null,//10153869,//6520352,// 10153869,// 6520352,// qa-6519858,//
  54 + user_id:null,//6520390,//6520352
55 55 // user_id:6520314,// qa-6519858,//
56 56 // user_id:14148118,// qa-6519858,//
57 57 buy_now: null,
... ... @@ -511,47 +511,60 @@ App({
511 511 get_user_store: function (func) {
512 512 var th = this;
513 513 this.getConfig2(function (conf) {
  514 +
  515 + var is_pricing_open_store=0;
  516 + var is_regstores=0;
  517 + var is_guide_storage=0;
  518 + if (conf.switch_list) {
  519 + var t_swi = JSON.parse(conf.switch_list);
  520 + //--购买门店是否默认登记门店--
  521 + is_regstores=t_swi.is_regstores;
  522 + is_pricing_open_store=t_swi.is_pricing_open_store;
  523 + is_guide_storage=t_swi.is_guide_storage;
  524 + }
  525 +
514 526 //---空会员的情况---
515 527 if (!th.globalData.userInfo) {
516   - return func(null);
  528 + //没有导购门店 和 没有开启默认导购
  529 + if(!th.globalData.guide_pick_id || !is_guide_storage) {
  530 + return func(null);
  531 + }
517 532 }
518 533 if (!th.globalData.pk_store) {
519 534 var pick_id = 0;
520 535  
521   - var is_pricing_open_store=0;
522   - var is_regstores=0;
523   - if (conf.switch_list) {
524   - var t_swi = JSON.parse(conf.switch_list);
525   - //--购买门店是否默认登记门店--
526   - is_regstores=t_swi.is_regstores;
527   - is_pricing_open_store=t_swi.is_pricing_open_store;
528   - }
  536 + //-- 如果有导购的时候,后台有默认门店只能是导购的门店的时候 --
  537 + if(th.globalData.guide_pick_id && is_guide_storage){
  538 + pick_id = th.globalData.guide_pick_id
  539 + }else {
529 540  
530   - //-- 如果是区域价格提现,现在注册门店是默认 --
531   - if(is_pricing_open_store){
  541 + //-- 如果是区域价格提现,现在注册门店是默认 --
  542 + if (is_pricing_open_store) {
532 543  
533   - //查找会员的注册的地址
534   - if (th.globalData.userInfo.pickup_id) {
535   - pick_id = th.globalData.userInfo.pickup_id;
536   - th.globalData.is_dj_pk=1;
537   - }
538   - //先找一个会员是否有设置默认的地址
539   - else if (th.globalData.userInfo.def_pickup_id) {
540   - pick_id = th.globalData.userInfo.def_pickup_id
541   - }
  544 + //查找会员的注册的地址
  545 + if (th.globalData.userInfo.pickup_id) {
  546 + pick_id = th.globalData.userInfo.pickup_id;
  547 + th.globalData.is_dj_pk = 1;
  548 + }
  549 + //先找一个会员是否有设置默认的地址
  550 + else if (th.globalData.userInfo.def_pickup_id) {
  551 + pick_id = th.globalData.userInfo.def_pickup_id
  552 + }
542 553  
543   - }else{
544   - //先找一个会员是否有设置默认的地址
545   - if (th.globalData.userInfo.def_pickup_id) {
546   - pick_id = th.globalData.userInfo.def_pickup_id
547   - }
548   - //查找会员的注册的地址
549   - else if (th.globalData.userInfo.pickup_id && is_regstores) {
550   - pick_id = th.globalData.userInfo.pickup_id
  554 + } else {
  555 + //先找一个会员是否有设置默认的地址
  556 + if (th.globalData.userInfo.def_pickup_id) {
  557 + pick_id = th.globalData.userInfo.def_pickup_id
  558 + }
  559 + //查找会员的注册的地址
  560 + else if (th.globalData.userInfo.pickup_id && is_regstores) {
  561 + pick_id = th.globalData.userInfo.pickup_id
  562 + }
551 563 }
552 564 }
553 565  
554 566  
  567 +
555 568 //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
556 569 if (pick_id == 0) return func(null);
557 570  
... ... @@ -704,6 +717,7 @@ App({
704 717 }
705 718 },
706 719  
  720 +
707 721 //清空登录时候缓存的值
708 722 onHide: function () {
709 723 var th = this;
... ... @@ -725,6 +739,7 @@ App({
725 739 th.globalData.dis_buy_obj = null; //等级卡的购买记录
726 740 th.globalData.storeFooter = null; //底部的导航
727 741 th.globalData.full_screen = null; //全屏
  742 + th.globalData.guide_pick_id = null; //分享导购门店的优化
728 743 } else {
729 744 th.globalData.no_clear = 0;
730 745 }
... ...
app.json
... ... @@ -30,6 +30,7 @@
30 30 "pages/cart/cart2_pt/cart2_pt",
31 31 "pages/cart/cart_wk/cart_wk",
32 32  
  33 +
33 34  
34 35 "pages/user/userqy/userqy",
35 36 "pages/user/user_spsy/user_spsy",
... ... @@ -217,7 +218,8 @@
217 218 "pages/user/grow_value/grow_value",
218 219 "pages/user/labels/labels",
219 220 "pages/cart/cart2/cart2",
220   - "pages/barCodeBank/barCodeBank"
  221 + "pages/barCodeBank/barCodeBank",
  222 + "pages/qy/contactMe/contactMe"
221 223 ]
222 224 }
223 225  
... ...
components/diy_store_select/diy_store_select.js
... ... @@ -54,7 +54,8 @@ Component({
54 54 fail: function(res) {
55 55 if(res.errCode == 2) {
56 56 getApp().confirmBox("请开启GPS定位", null, 25000, !1);
57   - }
  57 + }
  58 + th.set_fir_store_to_def();
58 59 }
59 60 })
60 61  
... ...
packageA/pages/cart2_ser/cart2_ser.js
... ... @@ -524,7 +524,10 @@ Page({
524 524 goods.guide_sn = res.data.data.salesman_no;
525 525 }
526 526 })
527   - }
  527 + }
  528 + if (gg.groupchat_id) {
  529 + goods.groupchat_id=gg.groupchat_id
  530 + }
528 531 item.list.push(goods);
529 532 }
530 533 }
... ... @@ -566,7 +569,11 @@ Page({
566 569 goods.guide_sn = res.data.data.salesman_no;
567 570 }
568 571 })
569   - }
  572 + }
  573 +
  574 + if(gg.groupchat_id){
  575 + goods.groupchat_id=gg.groupchat_id
  576 + }
570 577 console.log('goooooooooooooooooods', goods);
571 578 item.list.push(goods);
572 579 }
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -231,7 +231,9 @@ Page({
231 231 that = ee,
232 232 th = ee,
233 233 gid = t.goods_id,
234   - first_leader=t.first_leader;
  234 + first_leader=t.first_leader,
  235 + room_id = t.room_id,
  236 + room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
235 237  
236 238 //检查测肤
237 239 getApp().check_skin_face(t,1,gid);
... ... @@ -259,212 +261,154 @@ Page({
259 261 //调用接口判断是不是会员
260 262 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
261 263 if(res.data.code==0) {
262   - getApp().globalData.guide_id=res.data.data.id;
  264 + getApp().globalData.guide_id=res.data.data.id;
  265 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
263 266 }
264 267 })
265 268 }
266   -
267   - var c_guide_id=t.c_guide_id;
268   - if(c_guide_id){
269   - th.data.c_guide_id=c_guide_id;
270   - }
  269 +
  270 + //-- 如果有房间号 --
  271 + if (room_id) {
  272 + getApp().globalData.room_id = room_id;
  273 + getApp().globalData.room_goods_id = gid;
  274 + //如果是会员分享过来的要记录
  275 + if (room_user_share)
  276 + getApp().globalData.room_user_share = room_user_share;
  277 +
  278 + if (share_openid) {
  279 + this.get_room_share_guide(share_openid);
  280 + }
  281 + }
  282 +
  283 +
  284 + var c_guide_id=t.c_guide_id;
  285 + if(c_guide_id){
  286 + th.data.c_guide_id=c_guide_id;
  287 + }
271 288  
272 289 getApp().getConfig(function(e) {
273 290 ee.setData({sto_sele_name_1:e.store_name})
274 291 })
275 292  
276   - //----获取系统参数-----
277   - getApp().getConfig2(function (e) {
278   - ee.setData({
279   - bconfig: e,
280   - sales_rules: e.sales_rules,
281   - });
282   -
283   - if (e.categoryset.indexOf("," + 1 + ",") != -1) {
284   - ee.setData({
285   - is_show_pl: 1
286   - });
287   - }
288   - if (e.categoryset.indexOf("," + 3 + ",") != -1) {
289   - ee.setData({
290   - is_show_pp: 1
291   - });
292   - }
293   - if (e.categoryset.indexOf("," + 2 + ",") != -1) {
294   - ee.setData({
295   - is_show_gb: 1
296   - });
297   - }
298   - // console.log(e);
299   - var json_d = JSON.parse(e.switch_list);
300   - ee.setData({
301   - store_config: e,
302   - sys_switch: json_d,
303   - is_closecoupon: json_d.is_closecoupon,
304   - is_newsales_rules: json_d.is_newsales_rules
305   - });
306   - ee.init(gid);
307   -
308   - //------几人评价-------
309   - //n.init(th, "", "comments");
310   -
311   - th.requestCardNum(), wx.pageScrollTo && th.setData({
312   - supportPageScroll: !0
313   - });
314   -
315   - //计算等级价相关
316   - // var swithc_list = e.switch_list;
317   - // var sw_arr = JSON.parse(swithc_list);
318   - // //---如果后台又开等级卡的开关---
319   - // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
320   - // th.setData({ rank_switch: true });
321   - // //---回调卡的列表---
322   - // th.getPlusCardType(function (ob) {
323   - // th.setData({ card_list: ob.card_list });
324   - // var ti = setInterval(function () {
325   - // var user = getApp().globalData.userInfo;
326   - // if (!user) return false;
327   - // clearInterval(ti);
328   - // if (user.card_field && user['card_expiredate']) {
329   - // var str = user['card_expiredate'].replace(/-/g, '/');
330   - // var end = new Date(str);
331   - // end = Date.parse(end) / 1000;
332   - // var now = ut.gettimestamp();
333   - // //--- 判断是等级会员,且在有效期范围内 ---
334   - // if (user.card_field && now < end) {
335   - // var card_name = ob.name_map.get(user.card_field);
336   - // //if(card_name.length>6) card_name=card_name.substring(0,6);
337   -
338   - // var is_near_date = 0;
339   - // if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
340   - // th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
341   - // }
342   - // }
343   - // }, 500)
344   - // })
345   - // }
346   -
347   - }, 1);
  293 + //----获取系统参数-----
  294 + getApp().getConfig2(function (e) {
  295 + ee.setData({
  296 + bconfig: e,
  297 + sales_rules: e.sales_rules,
  298 + });
348 299  
349   - //获取用户设备信息,屏幕宽度
350   - wx.getSystemInfo({
351   - success: res => {
352   - that.setData({
353   - screenWidth: res.screenWidth
354   - })
355   - }
356   - });
357   -
358   - //获取用户的默认门店
359   - getApp().get_user_store(function(e) {
360   - console.log('get_user_store');
361   - console.log("999999999");
  300 + if (e.categoryset.indexOf("," + 1 + ",") != -1) {
  301 + ee.setData({
  302 + is_show_pl: 1
  303 + });
  304 + }
  305 + if (e.categoryset.indexOf("," + 3 + ",") != -1) {
  306 + ee.setData({
  307 + is_show_pp: 1
  308 + });
  309 + }
  310 + if (e.categoryset.indexOf("," + 2 + ",") != -1) {
  311 + ee.setData({
  312 + is_show_gb: 1
  313 + });
  314 + }
  315 + // console.log(e);
  316 + var json_d = JSON.parse(e.switch_list);
  317 + ee.setData({
  318 + store_config: e,
  319 + sys_switch: json_d,
  320 + is_closecoupon: json_d.is_closecoupon,
  321 + is_newsales_rules: json_d.is_newsales_rules
  322 + });
  323 + ee.init(gid);
362 324  
  325 + //------几人评价-------
  326 + //n.init(th, "", "comments");
363 327  
364   - if(!e) {
365   - th.data.fir_def_store={}; //赋值空对象
366   - return false;
367   - }
  328 + th.requestCardNum(), wx.pageScrollTo && th.setData({
  329 + supportPageScroll: !0
  330 + });
368 331  
369   - console.log("000000");
  332 + //计算等级价相关
  333 + // var swithc_list = e.switch_list;
  334 + // var sw_arr = JSON.parse(swithc_list);
  335 + // //---如果后台又开等级卡的开关---
  336 + // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  337 + // th.setData({ rank_switch: true });
  338 + // //---回调卡的列表---
  339 + // th.getPlusCardType(function (ob) {
  340 + // th.setData({ card_list: ob.card_list });
  341 + // var ti = setInterval(function () {
  342 + // var user = getApp().globalData.userInfo;
  343 + // if (!user) return false;
  344 + // clearInterval(ti);
  345 + // if (user.card_field && user['card_expiredate']) {
  346 + // var str = user['card_expiredate'].replace(/-/g, '/');
  347 + // var end = new Date(str);
  348 + // end = Date.parse(end) / 1000;
  349 + // var now = ut.gettimestamp();
  350 + // //--- 判断是等级会员,且在有效期范围内 ---
  351 + // if (user.card_field && now < end) {
  352 + // var card_name = ob.name_map.get(user.card_field);
  353 + // //if(card_name.length>6) card_name=card_name.substring(0,6);
  354 +
  355 + // var is_near_date = 0;
  356 + // if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
  357 + // th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
  358 + // }
  359 + // }
  360 + // }, 500)
  361 + // })
  362 + // }
  363 +
  364 + }, 1);
  365 +
  366 + //获取用户设备信息,屏幕宽度
  367 + wx.getSystemInfo({
  368 + success: res => {
  369 + that.setData({
  370 + screenWidth: res.screenWidth
  371 + })
  372 + }
  373 + });
370 374  
371   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  375 + },
372 376  
373   - var ee=JSON.parse(JSON.stringify(e));
  377 + //-- 获取直播的分享人的导购信息 --
  378 + async get_room_share_guide(share_openid) {
374 379  
  380 + var url = "/api/weshop/users/page";
  381 + var first_leader = 0;
375 382  
376   - console.log(e);
  383 + //调用接口判断是不是会员
  384 + await getApp().request.promiseGet(url, {
  385 + data: {
  386 + stoid: os.stoid,
  387 + weapp_openid: share_openid
  388 + }
  389 + }).then(res => {
  390 + if (ut.ajax_ok(res)) {
  391 + first_leader = res.data.data.pageData[0].user_id;
  392 + getApp().globalData.guide_id = res.data.data.id;
  393 + }
  394 + })
377 395  
378   - //--定时器推迟一下--
379   - setTimeout(function () {
380   - if(!th.data.data){
381   - return false;
382   - }
383   - var ser_card=th.data.data;
384   - //--如果默认门店不在等级卡的默认们店以内
385   - if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){
386   - ee.is_no_dis=1;
387   - }
  396 + if (!first_leader) return false;
388 397  
389   - var appd=getApp().globalData;
390   - var w_time = setInterval(function() {
391   - if (that.data.is_get_local_ok == 0) return false;
392   - clearInterval(w_time);
393   - var distance = null;
394   - var e=JSON.parse(JSON.stringify(ee));
395   -
396   - //如果有开启近距离的话,同时距离优不一样了
397   - if (that.data.lat != null) {
398   - //如果经纬度有变化的话
399   - if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
400   - that.data.fir_def_store=e;
401   - that.setData({
402   - def_pick_store: e,
403   - sto_sele_name: e.pickup_name,
404   - sto_sele_id: e.pickup_id,
405   - sto_sele_distr: e.distr_type,
406   - sto_sele_keyid:e.keyid,
407   - })
408   - }else{
409   - //要用接口是获取距离,js的计算不准
410   - getApp().request.promiseGet("/api/weshop/pickup/list",{
411   - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon, is_pos: 1},
412   - }).then(res=>{
413   - if(ut.ajax_ok(res)){
414   - e=res.data.data.pageData[0];
415   - if (e){
416   - e.is_no_dis=ee.is_no_dis;
417   - appd.pk_store=e;
418   - that.data.fir_def_store=e;
419   -
420   - console.log('get_user_store--2');
421   - console.log(e);
422   -
423   - that.setData({
424   - def_pick_store: e,
425   - sto_sele_name: e.pickup_name,
426   - sto_sele_id: e.pickup_id,
427   - sto_sele_distr: e.distr_type,
428   - sto_sele_keyid:e.keyid,
429   - })
430   - }
  398 + getApp().globalData.first_leader = first_leader;
431 399  
432   - }
433   - })
  400 + //调用接口判断是不是会员
  401 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  402 + if (res.data.code == 0) {
  403 + getApp().globalData.guide_id = res.data.data.id;
  404 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
434 405 }
  406 + })
435 407  
436   - //e.distance = distance;
437   - appd.lat=that.data.lat;
438   - appd.lon=that.data.lon;
439   -
440   - } else {
441   - if (e) {
442   -
  408 + },
443 409  
444   - console.log('get_user_store3---');
445   - console.log(e);
446 410  
447   - e.distance = null;
448   - that.data.fir_def_store=e;
449   - that.setData({
450   - def_pick_store: e,
451   - sto_sele_name: e.pickup_name,
452   - sto_sele_id: e.pickup_id,
453   - sto_sele_distr: e.distr_type,
454   - sto_sele_keyid:e.keyid,
455   - })
456   - }
457   - }
458   - }, 500)
459   - },1500)
460   -
461   - });
462   -
463   -
464   - },
465   -
466   -
467   - onReady() {
  411 + onReady() {
468 412 // 用于控制保障服务折叠图标的显示
469 413 setTimeout(() => {
470 414 wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => {
... ... @@ -671,19 +615,150 @@ Page({
671 615  
672 616 },
673 617  
  618 + //检测有没有导购分享的门店
  619 + check_guide(func){
  620 + var first_leader=getApp().globalData.first_leader;
  621 + if(!first_leader){
  622 + func();
  623 + return false;
  624 + }
  625 + if(this.data.is_geted_guide_pick){
  626 + func();
  627 + return false;
  628 + }
  629 +
  630 + if(getApp().globalData.guide_pick_id){
  631 + func();
  632 + return false;
  633 + }
  634 + var th=this;
  635 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  636 + if (res.data.code == 0) {
  637 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  638 + }
  639 + th.data.is_geted_guide_pick=1;
  640 + func();
  641 + })
  642 + },
  643 +
674 644 //---展示---
675 645 // gid 在onload阶段已经保存在this.data中
676 646 onShow: function() {
677 647  
678 648 getApp().check_can_share();
679 649  
680   - var that=this;
  650 + var that=this;var th=this;
681 651 var ee = this,gid = this.data.gid, i = getApp().request;
682 652 this.data.is_timer = 1;
683   - this.wait_for_store_config();
684   -
685 653  
686   -
  654 + //获取用户的默认门店
  655 + th.check_guide(()=>{
  656 + getApp().get_user_store(function(e) {
  657 + console.log('get_user_store');
  658 + console.log("999999999");
  659 +
  660 +
  661 + if(!e) {
  662 + th.data.fir_def_store={}; //赋值空对象
  663 + return false;
  664 + }
  665 +
  666 + console.log("000000");
  667 +
  668 + if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  669 +
  670 + var ee=JSON.parse(JSON.stringify(e));
  671 +
  672 +
  673 + console.log(e);
  674 +
  675 + //--定时器推迟一下--
  676 + setTimeout(function () {
  677 + if(!th.data.data){
  678 + return false;
  679 + }
  680 + var ser_card=th.data.data;
  681 + //--如果默认门店不在等级卡的默认们店以内
  682 + if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){
  683 + ee.is_no_dis=1;
  684 + }
  685 +
  686 + var appd=getApp().globalData;
  687 + var w_time = setInterval(function() {
  688 + if (that.data.is_get_local_ok == 0) return false;
  689 + clearInterval(w_time);
  690 + var distance = null;
  691 + var e=JSON.parse(JSON.stringify(ee));
  692 +
  693 + //如果有开启近距离的话,同时距离优不一样了
  694 + if (that.data.lat != null) {
  695 + //如果经纬度有变化的话
  696 + if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
  697 + that.data.fir_def_store=e;
  698 + that.setData({
  699 + def_pick_store: e,
  700 + sto_sele_name: e.pickup_name,
  701 + sto_sele_id: e.pickup_id,
  702 + sto_sele_distr: e.distr_type,
  703 + sto_sele_keyid:e.keyid,
  704 + })
  705 + }else{
  706 + //要用接口是获取距离,js的计算不准
  707 + getApp().request.promiseGet("/api/weshop/pickup/list",{
  708 + data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon, is_pos: 1},
  709 + }).then(res=>{
  710 + if(ut.ajax_ok(res)){
  711 + e=res.data.data.pageData[0];
  712 + if (e){
  713 + e.is_no_dis=ee.is_no_dis;
  714 + appd.pk_store=e;
  715 + that.data.fir_def_store=e;
  716 +
  717 + console.log('get_user_store--2');
  718 + console.log(e);
  719 +
  720 + that.setData({
  721 + def_pick_store: e,
  722 + sto_sele_name: e.pickup_name,
  723 + sto_sele_id: e.pickup_id,
  724 + sto_sele_distr: e.distr_type,
  725 + sto_sele_keyid:e.keyid,
  726 + })
  727 + }
  728 +
  729 + }
  730 + })
  731 + }
  732 +
  733 + //e.distance = distance;
  734 + appd.lat=that.data.lat;
  735 + appd.lon=that.data.lon;
  736 +
  737 + } else {
  738 + if (e) {
  739 +
  740 +
  741 + console.log('get_user_store3---');
  742 + console.log(e);
  743 +
  744 + e.distance = null;
  745 + that.data.fir_def_store=e;
  746 + that.setData({
  747 + def_pick_store: e,
  748 + sto_sele_name: e.pickup_name,
  749 + sto_sele_id: e.pickup_id,
  750 + sto_sele_distr: e.distr_type,
  751 + sto_sele_keyid:e.keyid,
  752 + })
  753 + }
  754 + }
  755 + }, 500)
  756 + },1500)
  757 +
  758 + });
  759 + })
  760 +
  761 + this.wait_for_store_config();
687 762  
688 763 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
689 764 failRollback: !0,
... ... @@ -981,8 +1056,11 @@ Page({
981 1056 };
982 1057 newd['pick_name'] = th.data.sto_sele_name;
983 1058 newd['guide_id'] = getApp().globalData.guide_id;
984   - newd['guide_type']=0;
985   -
  1059 + newd['guide_type']=0;
  1060 +
  1061 + if(getApp().globalData.groupchat_id){
  1062 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1063 + }
986 1064 if(this.data.prom_type && this.data.prom_type == 1) {
987 1065 newd['prom_type'] = this.data.prom_type;
988 1066 newd['prom_id'] = this.data.prom_id;
... ... @@ -1012,6 +1090,9 @@ Page({
1012 1090 newd['guide_id'] = getApp().globalData.guide_id;
1013 1091 newd['guide_type']=0;
1014 1092 };
  1093 + if(getApp().globalData.groupchat_id){
  1094 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1095 + }
1015 1096 // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
1016 1097 if(th.data.options.prom_type == 1) {
1017 1098 newd['prom_type'] = th.data.options.prom_type;
... ... @@ -1139,6 +1220,9 @@ Page({
1139 1220 updata['guide_id'] = getApp().globalData.guide_id;
1140 1221 updata['guide_type'] = 1;
1141 1222 }
  1223 + if(getApp().globalData.groupchat_id){
  1224 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  1225 + }
1142 1226 getApp().request.put("/api/weshop/cartService/update", {
1143 1227 data: updata,
1144 1228 success: function(t) {
... ... @@ -1404,7 +1488,9 @@ Page({
1404 1488 d.guide_id=getApp().globalData.guide_id;
1405 1489 d.guide_type=2;
1406 1490 }
1407   -
  1491 + if(getApp().globalData.groupchat_id){
  1492 + d.groupchat_id = getApp().globalData.groupchat_id;
  1493 + }
1408 1494 i.post("/api/weshop/goodscollect/save", { //添加收藏
1409 1495 data: d,
1410 1496 success: function(e) {
... ... @@ -2494,6 +2580,15 @@ Page({
2494 2580 var ind=ee.currentTarget.dataset.ind;
2495 2581 var bconfig = th.data.bconfig;
2496 2582  
  2583 + //--先判断会员状态--
  2584 + var user_info = getApp().globalData.userInfo;
  2585 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  2586 + wx.navigateTo({
  2587 + url: '/packageE/pages/togoin/togoin',
  2588 + })
  2589 + return false;
  2590 + }
  2591 +
2497 2592  
2498 2593 //如果开启了,则不在选择门店
2499 2594 if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){
... ... @@ -3880,7 +3975,9 @@ Page({
3880 3975 if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
3881 3976 }
3882 3977 }
3883   -
  3978 + if(getApp().globalData.groupchat_id){
  3979 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  3980 + }
3884 3981 //让商品带上房间号
3885 3982 //让商品带上房间号
3886 3983 if (th.data.sys_switch.is_skuroom_id == 1) {
... ... @@ -4200,7 +4297,9 @@ Page({
4200 4297 updata['guide_type'] = 0;
4201 4298 }
4202 4299 }
4203   -
  4300 + if(getApp().globalData.groupchat_id){
  4301 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  4302 + }
4204 4303 i.put("/api/weshop/cart/update", {
4205 4304 data: updata,
4206 4305 success: function (t) {
... ...
packageA/pages/jfbuy/jfbuy.js
... ... @@ -73,7 +73,10 @@ Page({
73 73 page:th.data.currentPage2,
74 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 80 var clientHeight = wx.getSystemInfoSync().windowHeight;
78 81 var clientWidth = wx.getSystemInfoSync().windowWidth;
79 82 this.data.clientHeight=clientHeight;
... ... @@ -204,8 +207,20 @@ Page({
204 207 pagePath += '&first_leader=' + getApp().globalData.user_id;
205 208 }else{
206 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 224 return {
210 225 title: store_name + '-积分购',
211 226 path: pagePath,
... ... @@ -276,10 +291,15 @@ Page({
276 291 var user_id=getApp().globalData.user_id;
277 292 if(!user_id) user_id=0;
278 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 300 return {
281 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/liveStreamDetails/liveStreamDetails.js
... ... @@ -523,7 +523,8 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
523 523 if(res.data.code==0){
524 524 getApp().globalData.guide_id=res.data.data.id;
525 525 getApp().globalData.staffId=staffId;
526   - getApp().globalData.storageId=storageId;
  526 + getApp().globalData.storageId=storageId;
  527 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
527 528 }
528 529 })
529 530 }
... ...
packageA/pages/my_service/appment_main.js
... ... @@ -344,6 +344,16 @@ Page({
344 344 },
345 345 //确认选择门店
346 346 choice_store: function() {
  347 +
  348 + //--先判断会员状态--
  349 + var user_info = getApp().globalData.userInfo;
  350 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  351 + wx.navigateTo({
  352 + url: '/packageE/pages/togoin/togoin',
  353 + })
  354 + return false;
  355 + }
  356 +
347 357 var th = this;
348 358 var index = th.data.fir_pick_index;
349 359 var store_name = th.data.store_list[index].StorageName;
... ... @@ -575,6 +585,7 @@ Page({
575 585 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{
576 586         if(res.data.code==0){
577 587           getApp().globalData.guide_id=res.data.data.id;
  588 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
578 589  
579 590 getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', {
580 591 data: {
... ...
packageA/pages/prom_list/prom_list.js
... ... @@ -50,6 +50,10 @@ Page({
50 50 var room_id=t.room_id;
51 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 57 if(room_id) this.data.room_id=room_id; //房间号要存起来
54 58 var ee=this,th=ee,that=ee;
55 59 var first_leader=t.first_leader;
... ... @@ -59,6 +63,7 @@ Page({
59 63 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
60 64 if(res.data.code==0){
61 65 getApp().globalData.guide_id=res.data.data.id;
  66 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
62 67 }
63 68 })
64 69 }
... ... @@ -85,91 +90,128 @@ Page({
85 90 }
86 91 });
87 92  
88   - //获取用户的默认门店
89   - getApp().get_user_store(function(ee) {
90   - if(!ee) {
91   - th.data.fir_def_store={}; //赋值空对象
92   - return false;
93   - }
94 93  
95   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
96   -
97   - var appd=getApp().globalData;
98   - var w_time = setInterval(function() {
99   - if (that.data.is_get_local_ok == 0) return false;
100   - if (!that.data.data) return false;
101   - clearInterval(w_time);
102   - var distance = null;
103   - var e=JSON.parse(JSON.stringify(ee));
104   -
105   - if(th.data.data) var g_distr_type=th.data.data.distr_type;
106   - e.is_no_dis=0;
107   - if(e.distr_type!=0 && g_distr_type!=0 && e.distr_type!=g_distr_type ){
108   - e.is_no_dis=1;
  94 +
  95 + },
  96 +
  97 + //检测有没有导购分享的门店
  98 + check_guide(func){
  99 + var first_leader=getApp().globalData.first_leader;
  100 + if(!first_leader){
  101 + func();
  102 + return false;
  103 + }
  104 + if(this.data.is_geted_guide_pick){
  105 + func();
  106 + return false;
  107 + }
  108 +
  109 + if(getApp().globalData.guide_pick_id){
  110 + func();
  111 + return false;
  112 + }
  113 + var th=this;
  114 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  115 + if (res.data.code == 0) {
  116 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  117 + }
  118 + th.data.is_geted_guide_pick=1;
  119 + func();
  120 + })
  121 + },
  122 +
  123 + //---展示---
  124 + onShow: function() {
  125 +
  126 + getApp().check_can_share();
  127 + var ee=this,th=ee,that=ee;
  128 +
  129 + //先获取一下导购的门店
  130 + this.check_guide(()=> {
  131 + //获取用户的默认门店
  132 + getApp().get_user_store(function (ee) {
  133 + if (!ee) {
  134 + th.data.fir_def_store = {}; //赋值空对象
  135 + return false;
109 136 }
110 137  
111   - //如果有开启近距离的话,同时距离优不一样了
112   - if (that.data.lat != null) {
113   - //如果经纬度有变化的话
114   - if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
115   - that.data.fir_def_store=e;
116   - that.setData({
117   - def_pick_store: e,
118   - sto_sele_name: e.pickup_name,
119   - sto_sele_id: e.pickup_id,
120   - sto_sele_distr: e.distr_type
121   - })
122   - }else{
123   - //要用接口是获取距离,js的计算不准
124   - getApp().request.promiseGet("/api/weshop/pickup/list",{
125   - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon,is_pos: 1},
126   - }).then(res=>{
127   - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
128   - e=res.data.data.pageData[0];
129   - if (e){
130   - appd.pk_store=e;
131   - that.data.fir_def_store=e;
132   - that.setData({
133   - def_pick_store: e,
134   - sto_sele_name: e.pickup_name,
135   - sto_sele_id: e.pickup_id,
136   - sto_sele_distr: e.distr_type
137   - })
138   - }
  138 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
139 139  
140   - }
141   - })
  140 + var appd = getApp().globalData;
  141 + var w_time = setInterval(function () {
  142 + if (that.data.is_get_local_ok == 0) return false;
  143 + if (!that.data.data) return false;
  144 + clearInterval(w_time);
  145 + var distance = null;
  146 + var e = JSON.parse(JSON.stringify(ee));
  147 +
  148 + if (th.data.data) var g_distr_type = th.data.data.distr_type;
  149 + e.is_no_dis = 0;
  150 + if (e.distr_type != 0 && g_distr_type != 0 && e.distr_type != g_distr_type) {
  151 + e.is_no_dis = 1;
142 152 }
143 153  
144   - //e.distance = distance;
145   - appd.lat=that.data.lat;
146   - appd.lon=that.data.lon;
  154 + //如果有开启近距离的话,同时距离优不一样了
  155 + if (that.data.lat != null) {
  156 + //如果经纬度有变化的话
  157 + if (appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  158 + that.data.fir_def_store = e;
  159 + that.setData({
  160 + def_pick_store: e,
  161 + sto_sele_name: e.pickup_name,
  162 + sto_sele_id: e.pickup_id,
  163 + sto_sele_distr: e.distr_type
  164 + })
  165 + } else {
  166 + //要用接口是获取距离,js的计算不准
  167 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  168 + data: {
  169 + store_id: os.stoid,
  170 + pickup_id: e.pickup_id,
  171 + lat: th.data.lat,
  172 + lon: th.data.lon,
  173 + is_pos: 1
  174 + },
  175 + }).then(res => {
  176 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) {
  177 + e = res.data.data.pageData[0];
  178 + if (e) {
  179 + appd.pk_store = e;
  180 + that.data.fir_def_store = e;
  181 + that.setData({
  182 + def_pick_store: e,
  183 + sto_sele_name: e.pickup_name,
  184 + sto_sele_id: e.pickup_id,
  185 + sto_sele_distr: e.distr_type
  186 + })
  187 + }
147 188  
148   - }else{
149   - if (e) {
150   - e.distance = null;
151   - that.data.fir_def_store=e;
152   - that.setData({
153   - def_pick_store: e,
154   - sto_sele_name: e.pickup_name,
155   - sto_sele_id: e.pickup_id,
156   - sto_sele_distr: e.distr_type
157   - })
158   - }
159   - }
  189 + }
  190 + })
  191 + }
160 192  
161   - }, 500)
162   - });
163   -
164   - },
  193 + //e.distance = distance;
  194 + appd.lat = that.data.lat;
  195 + appd.lon = that.data.lon;
165 196  
166   - //---展示---
167   - onShow: function() {
  197 + } else {
  198 + if (e) {
  199 + e.distance = null;
  200 + that.data.fir_def_store = e;
  201 + that.setData({
  202 + def_pick_store: e,
  203 + sto_sele_name: e.pickup_name,
  204 + sto_sele_id: e.pickup_id,
  205 + sto_sele_distr: e.distr_type
  206 + })
  207 + }
  208 + }
168 209  
169   - getApp().check_can_share();
  210 + }, 500)
  211 + });
  212 + })
170 213  
171   - var ee=this,th=ee,that=ee;
172   - var gid = this.data.gid,i = getApp().request;
  214 + var gid = this.data.gid,i = getApp().request;
173 215 ee.data.g_buy_num = new Map();
174 216 this.wait_for_store_config();
175 217 clearTimeout(ot);
... ... @@ -821,8 +863,19 @@ Page({
821 863 pagePath+="&goods_id="+this.data.gid+" &first_leader="+getApp().globalData.user_id;
822 864 }else{
823 865 pagePath+="?goods_id="+this.data.gid+"&first_leader="+getApp().globalData.user_id;
824   - }
825   - }
  866 + }
  867 + //群id分享
  868 + if (getApp().globalData.groupchat_id) {
  869 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  870 + }
  871 + }else{
  872 + if(pagePath.indexOf("?")>0){
  873 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  874 + }else{
  875 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  876 + }
  877 +
  878 + }
826 879  
827 880 console.log("111");
828 881 console.log(pagePath);
... ... @@ -1403,6 +1456,16 @@ Page({
1403 1456  
1404 1457 // 选择门店
1405 1458 choice_store: function(ee) {
  1459 +
  1460 + //--先判断会员状态--
  1461 + var user_info = getApp().globalData.userInfo;
  1462 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1463 + wx.navigateTo({
  1464 + url: '/packageE/pages/togoin/togoin',
  1465 + })
  1466 + return false;
  1467 + }
  1468 +
1406 1469 var th = this;
1407 1470 var ind=ee.currentTarget.dataset.ind;
1408 1471 var bconfig = th.data.bconfig;
... ...
packageA/pages/quan_list/quan_list.js
... ... @@ -24,6 +24,20 @@ Page({
24 24 //------初始化加载----------
25 25 onLoad: function (t) {
26 26 var th = this;
  27 +
  28 + var first_leader=t.first_leader;
  29 + if(first_leader){
  30 + //-- user_id代过来免登录 --
  31 + getApp().globalData.first_leader=first_leader;
  32 + //调用接口判断是不是会员
  33 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  34 + if(res.data.code==0){
  35 + getApp().globalData.guide_id=res.data.data.id;
  36 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  37 + }
  38 + })
  39 + }
  40 +
27 41 getApp().getConfig2(function (conf) {
28 42 if (conf.couponset) conf.couponset = conf.couponset.replace(/\<img/g, '<img style="width:100%;height:auto;display:block"');
29 43 th.setData({ config2: conf });
... ...
packageA/pages/quan_pro/quan_pro.js
... ... @@ -29,6 +29,7 @@ Page({
29 29 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
30 30 if(res.data.code==0){
31 31 getApp().globalData.guide_id=res.data.data.id;
  32 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
32 33 }
33 34 })
34 35 }
... ...
packageB/pages/zuhegou/index/index.js
... ... @@ -153,11 +153,39 @@ Page({
153 153 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
154 154 if (res.data.code == 0) {
155 155 getApp().globalData.guide_id = res.data.data.id;
  156 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
156 157 }
157 158 })
158 159 }
159 160 },
160 161  
  162 + //检测有没有导购分享的门店
  163 + check_guide(func){
  164 + var first_leader=getApp().globalData.first_leader;
  165 + if(!first_leader){
  166 + func();
  167 + return false;
  168 + }
  169 + if(this.data.is_geted_guide_pick){
  170 + func();
  171 + return false;
  172 + }
  173 +
  174 + if(getApp().globalData.guide_pick_id){
  175 + func();
  176 + return false;
  177 + }
  178 + var th=this;
  179 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  180 + if (res.data.code == 0) {
  181 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  182 + }
  183 + th.data.is_geted_guide_pick=1;
  184 + func();
  185 + })
  186 + },
  187 +
  188 +
161 189 /**
162 190 * 生命周期函数--监听页面显示
163 191 */
... ... @@ -259,59 +287,61 @@ Page({
259 287 })
260 288 })
261 289  
262   - //获取用户的默认门店
263   - getApp().get_user_store(function (e) {
264   - if (!e) {
265   - th.data.fir_def_store = {}; //赋值空对象
266   - return false;
267   - }
268   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  290 + th.check_guide(()=>{
  291 + //获取用户的默认门店
  292 + getApp().get_user_store(function (e) {
  293 + if (!e) {
  294 + th.data.fir_def_store = {}; //赋值空对象
  295 + return false;
  296 + }
  297 + if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
269 298  
270   - var ee = JSON.parse(JSON.stringify(e));
271   - var appd = getApp().globalData;
272   - //-- 等待定位系统的开启 --
273   - th.waitfor2(15, 'is_get_local_ok', function () {
  299 + var ee = JSON.parse(JSON.stringify(e));
  300 + var appd = getApp().globalData;
  301 + //-- 等待定位系统的开启 --
  302 + th.waitfor2(15, 'is_get_local_ok', function () {
274 303  
275   - if (!th.data.is_get_local_ok) return false;
  304 + if (!th.data.is_get_local_ok) return false;
276 305  
277   - var e = JSON.parse(JSON.stringify(ee));
278   - //如果有开启近距离的话,同时距离优不一样了
279   - if (that.data.lat != null) {
280   - //如果经纬度有变化的话
281   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
282   - that.set_def_storage(e);
283   - } else {
284   - //要用接口是获取距离,js的计算不准
285   - getApp().request.promiseGet("/api/weshop/pickup/list", {
286   - data: {
287   - store_id: os.stoid,
288   - pickup_id: e.pickup_id,
289   - is_pos: 1,
290   - lat: th.data.lat,
291   - lon: th.data.lon
292   - },
293   - }).then(res => {
294   - if (res.data.code == 0) {
295   - e = res.data.data.pageData[0];
296   - if (e) {
297   - e.is_no_dis = ee.is_no_dis;
298   - appd.pk_store = e;
299   - that.set_def_storage(e);
300   - }
  306 + var e = JSON.parse(JSON.stringify(ee));
  307 + //如果有开启近距离的话,同时距离优不一样了
  308 + if (that.data.lat != null) {
  309 + //如果经纬度有变化的话
  310 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  311 + that.set_def_storage(e);
  312 + } else {
  313 + //要用接口是获取距离,js的计算不准
  314 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  315 + data: {
  316 + store_id: os.stoid,
  317 + pickup_id: e.pickup_id,
  318 + is_pos: 1,
  319 + lat: th.data.lat,
  320 + lon: th.data.lon
  321 + },
  322 + }).then(res => {
  323 + if (res.data.code == 0) {
  324 + e = res.data.data.pageData[0];
  325 + if (e) {
  326 + e.is_no_dis = ee.is_no_dis;
  327 + appd.pk_store = e;
  328 + that.set_def_storage(e);
  329 + }
301 330  
302   - }
303   - })
304   - }
305   - appd.lat = that.data.lat;
306   - appd.lon = that.data.lon;
307   - } else {
308   - if (e) {
309   - e.distance = null;
310   - that.set_def_storage(e);
  331 + }
  332 + })
  333 + }
  334 + appd.lat = that.data.lat;
  335 + appd.lon = that.data.lon;
  336 + } else {
  337 + if (e) {
  338 + e.distance = null;
  339 + that.set_def_storage(e);
  340 + }
311 341 }
312   - }
313   - })
314   - });
  342 + })
  343 + });
  344 + })
315 345  
316 346 //----获取系统参数-----
317 347 getApp().getConfig2(function (e) {
... ...
packageB/pages/zuhegou/list/list.js
... ... @@ -36,6 +36,7 @@ Page({
36 36 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
37 37 if (res.data.code == 0) {
38 38 getApp().globalData.guide_id = res.data.data.id;
  39 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
39 40 }
40 41 })
41 42 }
... ...
packageB/pages/zuhegou/preindex/index.js
... ... @@ -150,11 +150,39 @@ Page({
150 150 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
151 151 if (res.data.code == 0) {
152 152 getApp().globalData.guide_id = res.data.data.id;
  153 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
153 154 }
154 155 })
155 156 }
156 157 },
157 158  
  159 +
  160 + //检测有没有导购分享的门店
  161 + check_guide(func){
  162 + var first_leader=getApp().globalData.first_leader;
  163 + if(!first_leader){
  164 + func();
  165 + return false;
  166 + }
  167 + if(this.data.is_geted_guide_pick){
  168 + func();
  169 + return false;
  170 + }
  171 +
  172 + if(getApp().globalData.guide_pick_id){
  173 + func();
  174 + return false;
  175 + }
  176 + var th=this;
  177 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  178 + if (res.data.code == 0) {
  179 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  180 + }
  181 + th.data.is_geted_guide_pick=1;
  182 + func();
  183 + })
  184 + },
  185 +
158 186 /**
159 187 * 生命周期函数--监听页面显示
160 188 */
... ... @@ -253,60 +281,63 @@ Page({
253 281 })
254 282 })
255 283  
256   - //获取用户的默认门店
257   - getApp().get_user_store(function (e) {
258   - if (!e) {
259   - th.data.fir_def_store = {}; //赋值空对象
260   - return false;
261   - }
  284 + //先获取一下导购的门店
  285 + th.check_guide(()=> {
  286 + //获取用户的默认门店
  287 + getApp().get_user_store(function (e) {
  288 + if (!e) {
  289 + th.data.fir_def_store = {}; //赋值空对象
  290 + return false;
  291 + }
262 292  
263   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  293 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
264 294  
265   - var ee = JSON.parse(JSON.stringify(e));
266   - var appd = getApp().globalData;
267   - //-- 等待定位系统的开启 --
268   - th.waitfor2(15, 'is_get_local_ok', function () {
  295 + var ee = JSON.parse(JSON.stringify(e));
  296 + var appd = getApp().globalData;
  297 + //-- 等待定位系统的开启 --
  298 + th.waitfor2(15, 'is_get_local_ok', function () {
269 299  
270   - if (!th.data.is_get_local_ok) return false;
  300 + if (!th.data.is_get_local_ok) return false;
271 301  
272   - var e = JSON.parse(JSON.stringify(ee));
273   - //如果有开启近距离的话,同时距离优不一样了
274   - if (that.data.lat != null) {
275   - //如果经纬度有变化的话
276   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
277   - that.set_def_storage(e);
278   - } else {
279   - //要用接口是获取距离,js的计算不准
280   - getApp().request.promiseGet("/api/weshop/pickup/list", {
281   - data: {
282   - store_id: os.stoid,
283   - pickup_id: e.pickup_id,
284   - is_pos: 1,
285   - lat: th.data.lat,
286   - lon: th.data.lon
287   - },
288   - }).then(res => {
289   - if (res.data.code == 0) {
290   - e = res.data.data.pageData[0];
291   - if (e) {
292   - e.is_no_dis = ee.is_no_dis;
293   - appd.pk_store = e;
294   - that.set_def_storage(e);
295   - }
  302 + var e = JSON.parse(JSON.stringify(ee));
  303 + //如果有开启近距离的话,同时距离优不一样了
  304 + if (that.data.lat != null) {
  305 + //如果经纬度有变化的话
  306 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  307 + that.set_def_storage(e);
  308 + } else {
  309 + //要用接口是获取距离,js的计算不准
  310 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  311 + data: {
  312 + store_id: os.stoid,
  313 + pickup_id: e.pickup_id,
  314 + is_pos: 1,
  315 + lat: th.data.lat,
  316 + lon: th.data.lon
  317 + },
  318 + }).then(res => {
  319 + if (res.data.code == 0) {
  320 + e = res.data.data.pageData[0];
  321 + if (e) {
  322 + e.is_no_dis = ee.is_no_dis;
  323 + appd.pk_store = e;
  324 + that.set_def_storage(e);
  325 + }
296 326  
297   - }
298   - })
299   - }
300   - appd.lat = that.data.lat;
301   - appd.lon = that.data.lon;
302   - } else {
303   - if (e) {
304   - e.distance = null;
305   - that.set_def_storage(e);
  327 + }
  328 + })
  329 + }
  330 + appd.lat = that.data.lat;
  331 + appd.lon = that.data.lon;
  332 + } else {
  333 + if (e) {
  334 + e.distance = null;
  335 + that.set_def_storage(e);
  336 + }
306 337 }
307   - }
308   - })
309   - });
  338 + })
  339 + });
  340 + })
310 341  
311 342 //----获取系统参数-----
312 343 getApp().getConfig2(function (e) {
... ...
packageC/pages/goods/goodsList/goodsList.js
... ... @@ -38,6 +38,7 @@ Page({
38 38 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
39 39 if (res.data.code == 0) {
40 40 getApp().globalData.guide_id = res.data.data.id;
  41 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
41 42 }
42 43 })
43 44 }
... ...
packageC/pages/goods/search/search.js
... ... @@ -46,6 +46,7 @@ Page({
46 46 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
47 47 if (res.data.code == 0) {
48 48 getApp().globalData.guide_id = res.data.data.id;
  49 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
49 50 }
50 51 })
51 52 }
... ...
packageC/pages/group_list/group_list.js
... ... @@ -26,7 +26,25 @@ Page({
26 26 * 生命周期函数--监听页面加载
27 27 */
28 28 onLoad: function (options) {
  29 +
29 30 self = this;
  31 + //群id
  32 + if(options && options.groupchat_id){
  33 + getApp().globalData.groupchat_id=options.groupchat_id
  34 + }
  35 + self = this;
  36 + var first_leader = options.first_leader;
  37 +
  38 + if (first_leader) {
  39 + getApp().globalData.first_leader = first_leader;
  40 + //调用接口判断是不是会员
  41 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  42 + if (res.data.code == 0) {
  43 + getApp().globalData.guide_id = res.data.data.id;
  44 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  45 + }
  46 + })
  47 + }
30 48  
31 49 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
32 50 self.setData({
... ... @@ -153,7 +171,66 @@ Page({
153 171 /**
154 172 * 用户点击右上角分享
155 173 */
156   - onShareAppMessage: function () { getApp().globalData.no_clear=1; },
  174 + onShareAppMessage: function () {
  175 + getApp().globalData.no_clear=1;
  176 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
  177 +
  178 + var pagePath = this.route; //当前页面url
  179 +
  180 + if(!store_name) store_name = getApp().globalData.setting.appName;
  181 +
  182 + if(pagePath.indexOf('/') != 0) {
  183 + pagePath = '/' + pagePath;
  184 + }
  185 +
  186 + if(getApp().globalData.user_id){
  187 + if(pagePath.indexOf('?')>0){
  188 + pagePath += '&first_leader=' + getApp().globalData.user_id;
  189 + }else{
  190 + pagePath += '?first_leader=' + getApp().globalData.user_id;
  191 + }
  192 + //群id分享
  193 + if (getApp().globalData.groupchat_id) {
  194 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  195 + }
  196 + }else{
  197 + if(pagePath.indexOf("?")>0){
  198 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  199 + }else{
  200 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  201 + }
  202 + }
  203 +
  204 + return {
  205 + title: store_name + '-团购',
  206 + path: pagePath,
  207 + }
  208 + },
  209 +
  210 + onShareAppMessage: function () {
  211 + getApp().globalData.no_clear=1;
  212 + var curPage = this;
  213 + var pagePath = curPage.route; //当前页面url
  214 + if (pagePath.indexOf('/') != 0) {
  215 + pagePath = '/' + pagePath;
  216 + }
  217 + if (getApp().globalData.user_id) {
  218 +
  219 + if (pagePath.indexOf("?") > 0) {
  220 + pagePath += "&first_leader=" + getApp().globalData.user_id;
  221 + } else {
  222 + pagePath += "?first_leader=" + getApp().globalData.user_id;
  223 + }
  224 + }
  225 +
  226 + console.log("11" + pagePath);
  227 + return {
  228 + title: "团购",
  229 + path: pagePath,
  230 + }
  231 +
  232 + },
  233 +
157 234  
158 235  
159 236 /**
... ...
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
... ... @@ -15,16 +15,20 @@ Page({
15 15  
16 16 onLoad: function (options) {
17 17 self = this;
18   -
  18 + //群id
  19 + if(options && options.groupchat_id){
  20 + getApp().globalData.groupchat_id=options.groupchat_id
  21 + }
19 22 var first_leader = options.first_leader;
20 23 if(first_leader) {
21 24 app.globalData.first_leader = first_leader;
22 25 //调用接口判断是不是会员
23   - // app.request.promiseGet("/api/weshop/shoppingGuide/get/" + app.globalData.setting.stoid + "/" + first_leader, {}).then(res => {
24   - // if (res.data.code == 0) {
25   - // getApp().globalData.guide_id = res.data.data.id;
26   - // }
27   - // })
  26 + app.request.promiseGet("/api/weshop/shoppingGuide/get/" + app.globalData.setting.stoid + "/" + first_leader, {}).then(res => {
  27 + if (res.data.code == 0) {
  28 + getApp().globalData.guide_id = res.data.data.id;
  29 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  30 + }
  31 + })
28 32 };
29 33  
30 34 app.isLogin().then(function(data) {
... ... @@ -204,7 +208,18 @@ Page({
204 208 }else{
205 209 pagePath+="?first_leader="+getApp().globalData.user_id;
206 210 }
207   - }
  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 + }
208 223 return {
209 224 title: "幸运购活动列表",
210 225 path: pagePath,
... ...
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... ... @@ -1226,6 +1226,10 @@ Page({
1226 1226 }
1227 1227 })
1228 1228 }
  1229 + if(gg.groupchat_id){
  1230 + goods.groupchat_id=gg.groupchat_id
  1231 + item.groupchat_ids=gg.groupchat_id
  1232 + }
1229 1233  
1230 1234 //--商品的房间号--
1231 1235 if (gg.room_id && gg.room_id > 0) {
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -283,7 +283,8 @@ Page({
283 283 canBuy: false,
284 284 btnHidden: false,
285 285  
286   - hiddenCS: true,
  286 + hiddenCS: true,
  287 + is_get_guide:0,
287 288 },
288 289  
289 290 //------初始化加载----------
... ... @@ -294,6 +295,10 @@ Page({
294 295 this.data.group_id = t.group_id;
295 296 };
296 297  
  298 + //群id
  299 + if(t && t.groupchat_id){
  300 + getApp().globalData.groupchat_id=t.groupchat_id
  301 + }
297 302  
298 303 var ee = this,
299 304 that = ee,
... ... @@ -305,6 +310,8 @@ Page({
305 310 prom_type = t.prom_type,
306 311 prom_id = t.group_id; //活动ID
307 312  
  313 + var share_openid = t.share_openid;
  314 +
308 315 if (prom_type) {
309 316 // this.data.prom_type = prom_type;
310 317 // this.data.prom_id = prom_id;
... ... @@ -393,6 +400,7 @@ Page({
393 400 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
394 401 if (res.data.code == 0) {
395 402 getApp().globalData.guide_id = res.data.data.id;
  403 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
396 404 }
397 405 })
398 406 }
... ... @@ -404,6 +412,10 @@ Page({
404 412 //如果是会员分享过来的要记录
405 413 if (room_user_share)
406 414 getApp().globalData.room_user_share = room_user_share;
  415 +
  416 + if (share_openid) {
  417 + this.get_room_share_guide(share_openid);
  418 + }
407 419 }
408 420  
409 421 var c_guide_id = t.c_guide_id;
... ... @@ -502,64 +514,7 @@ Page({
502 514 }
503 515 });
504 516  
505   - //获取用户的默认门店
506   - getApp().get_user_store(function (e) {
507   - if (!e) {
508   - th.data.fir_def_store = {}; //赋值空对象
509   - return false;
510   - }
511   -
512   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
513   - var ee = JSON.parse(JSON.stringify(e));
514   - //--定时器推迟一下--
515   - setTimeout(function () {
516   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
517   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
518   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
519   - ee.is_no_dis = 1;
520   - }
521   -
522   - var appd = getApp().globalData;
523   - var w_time = setInterval(function () {
524   - if (that.data.is_get_local_ok == 0) return false;
525   - clearInterval(w_time);
526   - var distance = null;
527   - var e = JSON.parse(JSON.stringify(ee));
528   -
529   - //如果有开启近距离的话,同时距离优不一样了
530   - if (that.data.lat != null) {
531   - //如果经纬度有变化的话
532   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
533   - that.set_def_storage(e);
534   - } else {
535   - //要用接口是获取距离,js的计算不准
536   - getApp().request.promiseGet("/api/weshop/pickup/list", {
537   - data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
538   - }).then(res => {
539   - if (res.data.code == 0) {
540   - e = res.data.data.pageData[0];
541   - if (e) {
542   - e.is_no_dis = ee.is_no_dis;
543   - appd.pk_store = e;
544   - that.set_def_storage(e);
545   - }
546   -
547   - }
548   - })
549   - }
550   - //e.distance = distance;
551   - appd.lat = that.data.lat;
552   - appd.lon = that.data.lon;
553 517  
554   - } else {
555   - if (e) {
556   - e.distance = null;
557   - that.set_def_storage(e);
558   - }
559   - }
560   - }, 500)
561   - }, 700)
562   - });
563 518  
564 519 //更新点击量
565 520 //noinspection JSUnresolvedFunction
... ... @@ -581,6 +536,39 @@ Page({
581 536 }
582 537 },
583 538  
  539 + //-- 获取直播的分享人的导购信息 --
  540 + async get_room_share_guide(share_openid) {
  541 +
  542 + var url = "/api/weshop/users/page";
  543 + var first_leader = 0;
  544 +
  545 + //调用接口判断是不是会员
  546 + await getApp().request.promiseGet(url, {
  547 + data: {
  548 + stoid: os.stoid,
  549 + weapp_openid: share_openid
  550 + }
  551 + }).then(res => {
  552 + if (ut.ajax_ok(res)) {
  553 + first_leader = res.data.data.pageData[0].user_id;
  554 + getApp().globalData.guide_id = res.data.data.id;
  555 + }
  556 + })
  557 +
  558 + if (!first_leader) return false;
  559 +
  560 + getApp().globalData.first_leader = first_leader;
  561 +
  562 + //调用接口判断是不是会员
  563 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  564 + if (res.data.code == 0) {
  565 + getApp().globalData.guide_id = res.data.data.id;
  566 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  567 + }
  568 + })
  569 +
  570 + },
  571 +
584 572  
585 573 //--- 设置一下默认库存的数量 ----
586 574 set_def_storage(ee) {
... ... @@ -801,15 +789,6 @@ Page({
801 789 })
802 790  
803 791  
804   -
805   -
806   -
807   -
808   -
809   -
810   -
811   -
812   -
813 792 ee.setData({
814 793 gallery: gallery,
815 794 is_collect: is_collect,
... ... @@ -823,10 +802,99 @@ Page({
823 802  
824 803 },
825 804  
  805 + //检测有没有导购分享的门店
  806 + check_guide(func){
  807 + var first_leader=getApp().globalData.first_leader;
  808 + if(!first_leader){
  809 + func();
  810 + return false;
  811 + }
  812 + if(this.data.is_geted_guide_pick){
  813 + func();
  814 + return false;
  815 + }
  816 +
  817 + if(getApp().globalData.guide_pick_id){
  818 + func();
  819 + return false;
  820 + }
  821 + var th=this;
  822 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  823 + if (res.data.code == 0) {
  824 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  825 + }
  826 + th.data.is_geted_guide_pick=1;
  827 + func();
  828 + })
  829 + },
  830 +
  831 +
  832 + get_user_sto(){
  833 + var th=this;var that=this;
  834 + //获取用户的默认门店
  835 + getApp().get_user_store(function (e) {
  836 + if (!e) {
  837 + th.data.fir_def_store = {}; //赋值空对象
  838 + return false;
  839 + }
  840 +
  841 + if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  842 + var ee = JSON.parse(JSON.stringify(e));
  843 + //--定时器推迟一下--
  844 + setTimeout(function () {
  845 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  846 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  847 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  848 + ee.is_no_dis = 1;
  849 + }
  850 +
  851 + var appd = getApp().globalData;
  852 + var w_time = setInterval(function () {
  853 + if (that.data.is_get_local_ok == 0) return false;
  854 + clearInterval(w_time);
  855 + var distance = null;
  856 + var e = JSON.parse(JSON.stringify(ee));
  857 +
  858 + //如果有开启近距离的话,同时距离优不一样了
  859 + if (that.data.lat != null) {
  860 + //如果经纬度有变化的话
  861 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  862 + that.set_def_storage(e);
  863 + } else {
  864 + //要用接口是获取距离,js的计算不准
  865 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  866 + data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
  867 + }).then(res => {
  868 + if (res.data.code == 0) {
  869 + e = res.data.data.pageData[0];
  870 + if (e) {
  871 + e.is_no_dis = ee.is_no_dis;
  872 + appd.pk_store = e;
  873 + that.set_def_storage(e);
  874 + }
  875 +
  876 + }
  877 + })
  878 + }
  879 + //e.distance = distance;
  880 + appd.lat = that.data.lat;
  881 + appd.lon = that.data.lon;
  882 +
  883 + } else {
  884 + if (e) {
  885 + e.distance = null;
  886 + that.set_def_storage(e);
  887 + }
  888 + }
  889 + }, 500)
  890 + }, 700)
  891 + });
  892 + },
  893 +
826 894 //---展示---
827 895 onShow: async function () {
828 896  
829   - getApp().check_can_share();
  897 + getApp().check_can_share();
830 898 // console.log('onshow');
831 899 var goods_list = null, th = this, that = this;
832 900 var show_prew_img = this.data.show_prew_img
... ... @@ -835,6 +903,16 @@ Page({
835 903 return false;
836 904 }
837 905  
  906 + if (this.data.show_video) {
  907 + this.data.show_video = 0;
  908 + return false;
  909 + }
  910 +
  911 + //先获取一下导购的门店
  912 + th.check_guide(()=> {
  913 + th.get_user_sto();
  914 + })
  915 +
838 916 // 判断活动是否暂停
839 917 //获取单个活动成团信息
840 918 await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {
... ... @@ -1436,7 +1514,9 @@ Page({
1436 1514 if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
1437 1515 }
1438 1516 }
1439   -
  1517 + if(getApp().globalData.groupchat_id){
  1518 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1519 + }
1440 1520 //让商品带上房间号
1441 1521 //让商品带上房间号
1442 1522 if (th.data.sys_switch.is_skuroom_id == 1) {
... ... @@ -1542,7 +1622,9 @@ Page({
1542 1622 if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
1543 1623 }
1544 1624 }
1545   -
  1625 + if(getApp().globalData.groupchat_id){
  1626 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1627 + }
1546 1628 //让商品带上房间号
1547 1629 if (th.data.sys_switch.is_skuroom_id == 1) {
1548 1630 if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
... ... @@ -1818,7 +1900,9 @@ Page({
1818 1900 updata['guide_type'] = 0;
1819 1901 }
1820 1902 }
1821   -
  1903 + if(getApp().globalData.groupchat_id){
  1904 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  1905 + }
1822 1906 i.put("/api/weshop/cart/update", {
1823 1907 data: updata,
1824 1908 success: function (t) {
... ... @@ -2390,7 +2474,9 @@ Page({
2390 2474 d.guide_id = getApp().globalData.guide_id;
2391 2475 d.guide_type = 2;
2392 2476 }
2393   -
  2477 + if(getApp().globalData.groupchat_id){
  2478 + d.groupchat_id = getApp().globalData.groupchat_id;
  2479 + }
2394 2480 i.post("/api/weshop/goodscollect/save", { //添加收藏
2395 2481 data: d,
2396 2482 success: function (e) {
... ... @@ -2608,6 +2694,11 @@ Page({
2608 2694 }
2609 2695 }
2610 2696  
  2697 + //群id分享
  2698 + if (getApp().globalData.groupchat_id) {
  2699 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  2700 + }
  2701 +
2611 2702 return {
2612 2703 title: "邀您一起参加幸运购",
2613 2704 path: pagePath,
... ... @@ -4363,7 +4454,9 @@ Page({
4363 4454  
4364 4455 }
4365 4456 }
4366   -
  4457 + if(getApp().globalData.groupchat_id){
  4458 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  4459 + }
4367 4460 //让商品带上房间号
4368 4461 if (th.data.sys_switch.is_skuroom_id == 1) {
4369 4462 if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
... ... @@ -4752,7 +4845,9 @@ Page({
4752 4845 if (getApp().globalData.guide_id) {
4753 4846 pdata.guide_id = getApp().globalData.guide_id;
4754 4847 }
4755   -
  4848 + if(getApp().globalData.groupchat_id){
  4849 + pdata.groupchat_id = getApp().globalData.groupchat_id;
  4850 + }
4756 4851 var app = getApp(),
4757 4852 th = this;
4758 4853 app.request.post("/api/weshop/couponList/saveCouponList", {
... ... @@ -5452,6 +5547,16 @@ Page({
5452 5547  
5453 5548 // 选择门店
5454 5549 choice_store: function (ee) {
  5550 +
  5551 + //--先判断会员状态--
  5552 + var user_info = getApp().globalData.userInfo;
  5553 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  5554 + wx.navigateTo({
  5555 + url: '/packageE/pages/togoin/togoin',
  5556 + })
  5557 + return false;
  5558 + }
  5559 +
5455 5560 var th = this;
5456 5561 var ind = ee.currentTarget.dataset.ind;
5457 5562 var bconfig = th.data.bconfig;
... ... @@ -6161,6 +6266,14 @@ Page({
6161 6266 getApp().pre_img(this.data.sele_g.original_img);
6162 6267 },
6163 6268  
  6269 + screenChange: function (e) {
  6270 + let fullScreen = e.detail.fullScreen //值true为进入全屏,false为退出全屏
  6271 + if (fullScreen) { //退出全屏
  6272 + getApp().globalData.no_clear = 1;
  6273 + this.data.show_video = 1;
  6274 + }
  6275 + },
  6276 +
6164 6277 is_show_more_buy: function () {
6165 6278 var prom_goods = this.data.prom_goods;
6166 6279 var per_price = this.data.sele_g.shop_price
... ... @@ -6243,6 +6356,10 @@ Page({
6243 6356 if(getApp().globalData.user_id){
6244 6357 pagePath+="&first_leader="+getApp().globalData.user_id;
6245 6358 }
  6359 + //群id分享
  6360 + if (getApp().globalData.groupchat_id) {
  6361 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  6362 + }
6246 6363  
6247 6364 return {
6248 6365 title: this.data.data.goods_name + '-' + store_name,
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... ... @@ -47,7 +47,7 @@
47 47 </image>
48 48 </view>
49 49 <view wx:else>
50   - <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
  50 + <video bindfullscreenchange="screenChange" class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
51 51 </view>
52 52 </swiper-item>
53 53 <swiper-item wx:for="{{gallery}}" wx:key="gallery">
... ...
packageC/pages/presell/cart/cart2_pre.js
... ... @@ -811,7 +811,10 @@ Page({
811 811 }
812 812 })
813 813 }
814   -
  814 + if(gg.groupchat_id){
  815 + goods.groupchat_id=gg.groupchat_id
  816 + item.groupchat_ids=gg.groupchat_id
  817 + }
815 818 //--商品的房间号--
816 819 if (gg.room_id && gg.room_id > 0) {
817 820 item.room_ids = gg.room_id;
... ...
packageC/pages/presell/goodsInfo/goodsInfo.js
... ... @@ -267,8 +267,16 @@ Page({
267 267 first_leader = t.first_leader,
268 268 room_id = t.room_id,
269 269 room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
  270 +
  271 + var share_openid = t.share_openid;
  272 +
270 273 //检查测肤
271 274 getApp().check_skin_face(t, 0, gid);
  275 + //群id
  276 + if(t && t.groupchat_id){
  277 + getApp().globalData.groupchat_id=t.groupchat_id
  278 + }
  279 +
272 280  
273 281 //-- 自定义海报 --
274 282 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
... ... @@ -327,6 +335,7 @@ Page({
327 335 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
328 336 if (res.data.code == 0) {
329 337 getApp().globalData.guide_id = res.data.data.id;
  338 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
330 339 }
331 340 })
332 341 }
... ... @@ -338,6 +347,11 @@ Page({
338 347 //如果是会员分享过来的要记录
339 348 if (room_user_share)
340 349 getApp().globalData.room_user_share = room_user_share;
  350 +
  351 + if (share_openid) {
  352 + this.get_room_share_guide(share_openid);
  353 + }
  354 +
341 355 }
342 356  
343 357 var c_guide_id = t.c_guide_id;
... ... @@ -438,6 +452,38 @@ Page({
438 452 })
439 453 },
440 454  
  455 + async get_room_share_guide(share_openid) {
  456 +
  457 + var url = "/api/weshop/users/page";
  458 + var first_leader = 0;
  459 +
  460 + //调用接口判断是不是会员
  461 + await getApp().request.promiseGet(url, {
  462 + data: {
  463 + stoid: os.stoid,
  464 + weapp_openid: share_openid
  465 + }
  466 + }).then(res => {
  467 + if (ut.ajax_ok(res)) {
  468 + first_leader = res.data.data.pageData[0].user_id;
  469 + getApp().globalData.guide_id = res.data.data.id;
  470 + }
  471 + })
  472 +
  473 + if (!first_leader) return false;
  474 +
  475 + getApp().globalData.first_leader = first_leader;
  476 +
  477 + //调用接口判断是不是会员
  478 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  479 + if (res.data.code == 0) {
  480 + getApp().globalData.guide_id = res.data.data.id;
  481 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  482 + }
  483 + })
  484 +
  485 + },
  486 +
441 487 //--- 设置一下默认库存的数量 ----
442 488 set_def_storage(ee) {
443 489 var that = this, th = this;
... ... @@ -622,6 +668,32 @@ Page({
622 668  
623 669 },
624 670  
  671 + //检验导购门店
  672 + check_guide(func){
  673 + var first_leader=getApp().globalData.first_leader;
  674 + if(!first_leader){
  675 + func();
  676 + return false;
  677 + }
  678 + if(this.data.is_geted_guide_pick){
  679 + func();
  680 + return false;
  681 + }
  682 +
  683 + if(getApp().globalData.guide_pick_id){
  684 + func();
  685 + return false;
  686 + }
  687 + var th=this;
  688 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  689 + if (res.data.code == 0) {
  690 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  691 + }
  692 + th.data.is_geted_guide_pick=1;
  693 + func();
  694 + })
  695 + },
  696 +
625 697 //---展示---
626 698 onShow: function () {
627 699 getApp().check_can_share();
... ... @@ -702,68 +774,70 @@ Page({
702 774 ee.data.sele_g_id = t.data.data.goods_id;
703 775 ee.data.sele_g = t.data.data;
704 776  
705   - //获取用户的默认门店
706   - getApp().get_user_store(function (e) {
707   - if (!e) {
708   - th.data.fir_def_store = {}; //赋值空对象
709   - return false;
710   - }
711   - if (getApp().globalData.is_dj_pk) th.setData({ has_def: 1 })
  777 + //检测一下分享导购的门店
  778 + ee.check_guide(() => {
  779 + //获取用户的默认门店
  780 + getApp().get_user_store(function (e) {
  781 + if (!e) {
  782 + th.data.fir_def_store = {}; //赋值空对象
  783 + return false;
  784 + }
  785 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
712 786  
713   - var ee = JSON.parse(JSON.stringify(e));
  787 + var ee = JSON.parse(JSON.stringify(e));
714 788  
715   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
716   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
717   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
718   - ee.is_no_dis = 1;
719   - }
  789 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  790 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  791 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  792 + ee.is_no_dis = 1;
  793 + }
720 794  
721   - var appd = getApp().globalData;
722   - var w_time = setInterval(function () {
723   - if (that.data.is_get_local_ok == 0) return false;
724   - clearInterval(w_time);
725   - var e = JSON.parse(JSON.stringify(ee));
  795 + var appd = getApp().globalData;
  796 + var w_time = setInterval(function () {
  797 + if (that.data.is_get_local_ok == 0) return false;
  798 + clearInterval(w_time);
  799 + var e = JSON.parse(JSON.stringify(ee));
726 800  
727   - //如果有开启近距离的话,同时距离优不一样了
728   - if (that.data.lat != null) {
729   - //如果经纬度有变化的话
730   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
731   - that.set_def_storage(e);
  801 + //如果有开启近距离的话,同时距离优不一样了
  802 + if (that.data.lat != null) {
  803 + //如果经纬度有变化的话
  804 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  805 + that.set_def_storage(e);
732 806  
733   - } else {
734   - //要用接口是获取距离,js的计算不准
735   - getApp().request.promiseGet("/api/weshop/pickup/list", {
736   - data: {
737   - store_id: os.stoid,
738   - pickup_id: e.pickup_id,
739   - is_pos: 1,
740   - lat: th.data.lat,
741   - lon: th.data.lon
742   - },
743   - }).then(res => {
744   - if (res.data.code == 0) {
745   - e = res.data.data.pageData[0];
746   - if (e) {
747   - e.is_no_dis = ee.is_no_dis;
748   - appd.pk_store = e;
749   - that.set_def_storage(e);
750   - }
  807 + } else {
  808 + //要用接口是获取距离,js的计算不准
  809 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  810 + data: {
  811 + store_id: os.stoid,
  812 + pickup_id: e.pickup_id,
  813 + is_pos: 1,
  814 + lat: th.data.lat,
  815 + lon: th.data.lon
  816 + },
  817 + }).then(res => {
  818 + if (res.data.code == 0) {
  819 + e = res.data.data.pageData[0];
  820 + if (e) {
  821 + e.is_no_dis = ee.is_no_dis;
  822 + appd.pk_store = e;
  823 + that.set_def_storage(e);
  824 + }
751 825  
752   - }
753   - })
754   - }
755   - appd.lat = that.data.lat;
756   - appd.lon = that.data.lon;
  826 + }
  827 + })
  828 + }
  829 + appd.lat = that.data.lat;
  830 + appd.lon = that.data.lon;
757 831  
758   - } else {
759   - if (e) {
760   - e.distance = null;
761   - that.set_def_storage(e);
  832 + } else {
  833 + if (e) {
  834 + e.distance = null;
  835 + that.set_def_storage(e);
  836 + }
762 837 }
763   - }
764   - }, 500)
765   - });
766   -
  838 + }, 500)
  839 + });
  840 + })
767 841  
768 842  
769 843 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
... ... @@ -1054,6 +1128,10 @@ Page({
1054 1128 }
1055 1129 }
1056 1130  
  1131 + if(getApp().globalData.groupchat_id){
  1132 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1133 + }
  1134 +
1057 1135 //让商品带上房间号
1058 1136 if (th.data.sys_switch.is_skuroom_id == 1) {
1059 1137 if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
... ... @@ -1133,7 +1211,9 @@ Page({
1133 1211 updata['guide_type'] = 0;
1134 1212 }
1135 1213 }
1136   -
  1214 + if(getApp().globalData.groupchat_id){
  1215 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  1216 + }
1137 1217 i.put("/api/weshop/cart/update", {
1138 1218 data: updata,
1139 1219 success: function (t) {
... ... @@ -1450,7 +1530,9 @@ Page({
1450 1530 d.guide_id = getApp().globalData.guide_id;
1451 1531 d.guide_type = 2;
1452 1532 }
1453   -
  1533 + if(getApp().globalData.groupchat_id){
  1534 + d.groupchat_id= getApp().globalData.groupchat_id;
  1535 + }
1454 1536 i.post("/api/weshop/goodscollect/save", { //添加收藏
1455 1537 data: d,
1456 1538 success: function (e) {
... ... @@ -1603,6 +1685,11 @@ Page({
1603 1685 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
1604 1686 }
1605 1687  
  1688 + //群id分享
  1689 + if (getApp().globalData.groupchat_id) {
  1690 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  1691 + }
  1692 +
1606 1693 var ob = {
1607 1694 title: price + "元 " + title,
1608 1695 path: url,
... ... @@ -2744,7 +2831,9 @@ Page({
2744 2831 if (getApp().globalData.guide_id) {
2745 2832 pdata.guide_id = getApp().globalData.guide_id;
2746 2833 }
2747   -
  2834 + if(getApp().globalData.groupchat_id){
  2835 + pdata.groupchat_id = getApp().globalData.groupchat_id;
  2836 + }
2748 2837 var app = getApp(),
2749 2838 th = this;
2750 2839 app.request.post("/api/weshop/couponList/saveCouponList", {
... ... @@ -3544,6 +3633,16 @@ Page({
3544 3633 },
3545 3634 // 选择门店
3546 3635 choice_store: function (ee) {
  3636 +
  3637 + //--先判断会员状态--
  3638 + var user_info = getApp().globalData.userInfo;
  3639 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3640 + wx.navigateTo({
  3641 + url: '/packageE/pages/togoin/togoin',
  3642 + })
  3643 + return false;
  3644 + }
  3645 +
3547 3646 var th = this;
3548 3647 var ind = ee.currentTarget.dataset.ind;
3549 3648 var bconfig = th.data.bconfig;
... ... @@ -4182,8 +4281,18 @@ Page({
4182 4281 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
4183 4282 if (!store_name)
4184 4283 store_name = getApp().globalData.setting.appName;
  4284 +
  4285 + var user_id=getApp().globalData.user_id;
  4286 + if(!user_id) user_id=0;
  4287 + var url=''
  4288 + //群id分享
  4289 + if (getApp().globalData.groupchat_id) {
  4290 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  4291 + }
  4292 +
4185 4293 return {
4186 4294 title: this.data.data.goods_name + '-' + store_name,
  4295 + query: 'first_leader='+user_id+url,
4187 4296 imageUrl: this.data.gallery[0].image_url,
4188 4297 }
4189 4298 },
... ...
packageC/pages/presell/list/list.js
... ... @@ -20,13 +20,17 @@ Page({
20 20 var th = this;
21 21 getApp().getConfig();
22 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 27 if (first_leader) {
25 28 getApp().globalData.first_leader = first_leader;
26 29 //调用接口判断是不是会员
27 30 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
28 31 if (res.data.code == 0) {
29 32 getApp().globalData.guide_id = res.data.data.id;
  33 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
30 34 }
31 35 })
32 36 }
... ... @@ -299,7 +303,17 @@ Page({
299 303 url += "?first_leader=" + getApp().globalData.user_id;
300 304 else
301 305 url += "&first_leader=" + getApp().globalData.user_id;
302   - }
  306 +
  307 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  308 +
  309 + }else{
  310 + if(url.indexOf("?")>0){
  311 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  312 + }else{
  313 + url+="?groupchat_id="+getApp().globalData.groupchat_id
  314 + }
  315 +
  316 + }
303 317 //-- 如果房间分享,且不是会员分享的 --
304 318 if (getApp().globalData.room_id &&
305 319 this.data.data.goods_id == getApp().globalData.room_goods_id &&
... ...
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... ... @@ -263,6 +263,7 @@ Page({
263 263 room_id = t.room_id,
264 264 room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
265 265  
  266 + var share_openid = t.share_openid;
266 267 //-- 自定义海报 --
267 268 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
268 269 data: { store_id: os.stoid, type: 1, is_use: 1 }
... ... @@ -316,11 +317,14 @@ Page({
316 317 if (first_leader) {
317 318 console.log("log---".first_leader);
318 319 getApp().globalData.first_leader = first_leader;
  320 +
319 321 //调用接口判断是不是会员
320 322 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
321 323 if (res.data.code == 0) {
322 324 getApp().globalData.guide_id = res.data.data.id;
  325 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
323 326 }
  327 +
324 328 })
325 329 }
326 330  
... ... @@ -331,6 +335,10 @@ Page({
331 335 //如果是会员分享过来的要记录
332 336 if (room_user_share)
333 337 getApp().globalData.room_user_share = room_user_share;
  338 +
  339 + if (share_openid) {
  340 + this.get_room_share_guide(share_openid);
  341 + }
334 342 }
335 343  
336 344 var c_guide_id = t.c_guide_id;
... ... @@ -429,6 +437,38 @@ Page({
429 437 })
430 438 },
431 439  
  440 + async get_room_share_guide(share_openid) {
  441 +
  442 + var url = "/api/weshop/users/page";
  443 + var first_leader = 0;
  444 +
  445 + //调用接口判断是不是会员
  446 + await getApp().request.promiseGet(url, {
  447 + data: {
  448 + stoid: os.stoid,
  449 + weapp_openid: share_openid
  450 + }
  451 + }).then(res => {
  452 + if (ut.ajax_ok(res)) {
  453 + first_leader = res.data.data.pageData[0].user_id;
  454 + getApp().globalData.guide_id = res.data.data.id;
  455 + }
  456 + })
  457 +
  458 + if (!first_leader) return false;
  459 +
  460 + getApp().globalData.first_leader = first_leader;
  461 +
  462 + //调用接口判断是不是会员
  463 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  464 + if (res.data.code == 0) {
  465 + getApp().globalData.guide_id = res.data.data.id;
  466 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  467 + }
  468 + })
  469 +
  470 + },
  471 +
432 472  
433 473 //--- 设置一下默认库存的数量 ----
434 474 set_def_storage(ee) {
... ... @@ -606,6 +646,30 @@ Page({
606 646  
607 647 },
608 648  
  649 + check_guide(func){
  650 + var first_leader=getApp().globalData.first_leader;
  651 + if(!first_leader){
  652 + func();
  653 + return false;
  654 + }
  655 + if(this.data.is_geted_guide_pick){
  656 + func();
  657 + return false;
  658 + }
  659 +
  660 + if(getApp().globalData.guide_pick_id){
  661 + func();
  662 + return false;
  663 + }
  664 + var th=this;
  665 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  666 + if (res.data.code == 0) {
  667 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  668 + }
  669 + th.data.is_geted_guide_pick=1;
  670 + func();
  671 + })
  672 + },
609 673 //---展示---
610 674 onShow: function () {
611 675  
... ... @@ -687,70 +751,71 @@ Page({
687 751 ee.data.sele_g_id=t.data.data.goods_id;
688 752 ee.data.sele_g=t.data.data;
689 753  
690   - //获取用户的默认门店
691   - getApp().get_user_store(function (e) {
692   - if (!e) {
693   - th.data.fir_def_store = {}; //赋值空对象
694   - return false;
695   - }
696   -
697   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  754 + //检测一下分享导购的门店
  755 + ee.check_guide(() => {
  756 + //获取用户的默认门店
  757 + getApp().get_user_store(function (e) {
  758 + if (!e) {
  759 + th.data.fir_def_store = {}; //赋值空对象
  760 + return false;
  761 + }
698 762  
699   - var ee = JSON.parse(JSON.stringify(e));
  763 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
700 764  
701   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
702   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
703   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
704   - ee.is_no_dis = 1;
705   - }
  765 + var ee = JSON.parse(JSON.stringify(e));
706 766  
707   - var appd = getApp().globalData;
708   - var w_time = setInterval(function () {
709   - if (that.data.is_get_local_ok == 0) return false;
710   - clearInterval(w_time);
711   - var e = JSON.parse(JSON.stringify(ee));
  767 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  768 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  769 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  770 + ee.is_no_dis = 1;
  771 + }
712 772  
713   - //如果有开启近距离的话,同时距离优不一样了
714   - if (that.data.lat != null) {
715   - //如果经纬度有变化的话
716   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
717   - that.set_def_storage(e);
  773 + var appd = getApp().globalData;
  774 + var w_time = setInterval(function () {
  775 + if (that.data.is_get_local_ok == 0) return false;
  776 + clearInterval(w_time);
  777 + var e = JSON.parse(JSON.stringify(ee));
  778 +
  779 + //如果有开启近距离的话,同时距离优不一样了
  780 + if (that.data.lat != null) {
  781 + //如果经纬度有变化的话
  782 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  783 + that.set_def_storage(e);
  784 +
  785 + } else {
  786 + //要用接口是获取距离,js的计算不准
  787 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  788 + data: {
  789 + store_id: os.stoid,
  790 + pickup_id: e.pickup_id,
  791 + is_pos: 1,
  792 + lat: th.data.lat,
  793 + lon: th.data.lon
  794 + },
  795 + }).then(res => {
  796 + if (res.data.code == 0) {
  797 + e = res.data.data.pageData[0];
  798 + if (e) {
  799 + e.is_no_dis = ee.is_no_dis;
  800 + appd.pk_store = e;
  801 + that.set_def_storage(e);
  802 + }
718 803  
719   - } else {
720   - //要用接口是获取距离,js的计算不准
721   - getApp().request.promiseGet("/api/weshop/pickup/list", {
722   - data: {
723   - store_id: os.stoid,
724   - pickup_id: e.pickup_id,
725   - is_pos: 1,
726   - lat: th.data.lat,
727   - lon: th.data.lon
728   - },
729   - }).then(res => {
730   - if (res.data.code == 0) {
731   - e = res.data.data.pageData[0];
732   - if (e) {
733   - e.is_no_dis = ee.is_no_dis;
734   - appd.pk_store = e;
735   - that.set_def_storage(e);
736 804 }
  805 + })
  806 + }
  807 + appd.lat = that.data.lat;
  808 + appd.lon = that.data.lon;
737 809  
738   - }
739   - })
740   - }
741   - appd.lat = that.data.lat;
742   - appd.lon = that.data.lon;
743   -
744   - } else {
745   - if (e) {
746   - e.distance = null;
747   - that.set_def_storage(e);
  810 + } else {
  811 + if (e) {
  812 + e.distance = null;
  813 + that.set_def_storage(e);
  814 + }
748 815 }
749   - }
750   - }, 500)
751   - });
752   -
753   -
  816 + }, 500)
  817 + });
  818 + })
754 819  
755 820 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
756 821  
... ... @@ -3208,6 +3273,16 @@ Page({
3208 3273 },
3209 3274 // 选择门店
3210 3275 choice_store: function (ee) {
  3276 +
  3277 + //--先判断会员状态--
  3278 + var user_info = getApp().globalData.userInfo;
  3279 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3280 + wx.navigateTo({
  3281 + url: '/packageE/pages/togoin/togoin',
  3282 + })
  3283 + return false;
  3284 + }
  3285 +
3211 3286 var th = this;
3212 3287 var ind = ee.currentTarget.dataset.ind;
3213 3288 var bconfig = th.data.bconfig;
... ...
packageD/pages/AI-test-skin/success_result/success_result.js
... ... @@ -107,6 +107,7 @@ Page({
107 107 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + setting.stoid + "/" + first_leader, {}).then(res => {
108 108 if (res.data.code == 0) {
109 109 getApp().globalData.guide_id = res.data.data.id;
  110 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
110 111 }
111 112 })
112 113 }
... ...
packageE/pages/cart/cart2/cart2.js
... ... @@ -1149,15 +1149,17 @@ Page({
1149 1149 }
1150 1150  
1151 1151  
1152   -
1153   - //----- 判断每一个商品的配送方式,和门店的配送方式 -------
1154   - for (var ik = 0; ik < arr.length; ik++) {
1155   - if (!arr[ik].sto.is_same_city) continue;
1156   - var fd = arr[ik].goods.filter(function (e) {
1157   - return e.is_same_city != 1 || e.whsle_id > 0
1158   - })
1159   - if (!fd || fd.length == 0) {
1160   - arr[ik].show_same_city = 1;
  1152 + //-- 要判断总开关有没有同城配送 --
  1153 + if(th.data.is_same_city) {
  1154 + //----- 判断每一个商品的配送方式,和门店的配送方式 -------
  1155 + for (var ik = 0; ik < arr.length; ik++) {
  1156 + if (!arr[ik].sto.is_same_city) continue;
  1157 + var fd = arr[ik].goods.filter(function (e) {
  1158 + return e.is_same_city != 1 || e.whsle_id > 0
  1159 + })
  1160 + if (!fd || fd.length == 0) {
  1161 + arr[ik].show_same_city = 1;
  1162 + }
1161 1163 }
1162 1164 }
1163 1165  
... ... @@ -1258,12 +1260,8 @@ Page({
1258 1260 et = 0;
1259 1261 break;
1260 1262 }
1261   -
1262   -
1263 1263 var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
1264 1264  
1265   -
1266   -
1267 1265 if (et == 0 && def_exp_code && !th.data.is_default_logistics) {
1268 1266 for (var k = 0; k < th.data.wu_arr.length; k++) {
1269 1267 var item = th.data.wu_arr[k];
... ... @@ -1427,10 +1425,10 @@ Page({
1427 1425 if (gg.prom_type == 5) {
1428 1426 t.data.data.prom_id = gg.prom_id;
1429 1427 t.data.data.prom_type = 5;
1430   - th.is_coupon = gg.is_coupon;
1431   - th.setData({
1432   - is_coupon: gg.is_coupon
1433   - });
  1428 + // th.is_coupon = gg.is_coupon;
  1429 + // th.setData({
  1430 + // is_coupon: gg.is_coupon
  1431 + // });
1434 1432 if (gg.room_id) {
1435 1433 t.data.data.room_id = gg.room_id;
1436 1434 }
... ... @@ -1439,6 +1437,9 @@ Page({
1439 1437 t.data.data.guide_id = gg.guide_id;
1440 1438 t.data.data.guide_type = gg.guide_type;
1441 1439 }
  1440 + if(gg.groupchat_id){
  1441 + t.data.data.groupchat_id=groupchat_id;
  1442 + }
1442 1443 //搭配购如果原来就有勾选,不能直接赋值,旧的要保留
1443 1444 if(!th.data.collocation_goods){
1444 1445 th.setData({ collocation_goods: gg.collocation_goods });
... ... @@ -3515,7 +3516,9 @@ Page({
3515 3516 df_goods[index].df_room_ids += room_id + ",";
3516 3517  
3517 3518 }
3518   -
  3519 + if(getApp().globalData.groupchat_id){
  3520 + df_goods[index].groupchat_id=getApp().globalData.groupchat_id
  3521 + }
3519 3522 } else {
3520 3523 var e = {
3521 3524 whsle_id: whsle_id,
... ... @@ -3523,7 +3526,9 @@ Page({
3523 3526 df_goods: []
3524 3527 }
3525 3528 if (room_id) e.df_room_ids = room_id + ','
3526   -
  3529 + if(getApp().globalData.groupchat_id){
  3530 + e.groupchat_id=getApp().globalData.groupchat_id
  3531 + }
3527 3532 e.df_goods.push(good);
3528 3533 df_goods.push(e);
3529 3534 }
... ... @@ -3696,7 +3701,11 @@ Page({
3696 3701 if (gg.room_id && gg.room_id > 0) {
3697 3702 item.room_ids = gg.room_id;
3698 3703 }
3699   -
  3704 + //群id
  3705 +
  3706 + if(gg.groupchat_id){
  3707 + item.groupchat_ids=gg.groupchat_id;
  3708 + }
3700 3709 var order_prom_list = {};
3701 3710 //--判断有没有优惠活动--
3702 3711 if (th.data.formData.order_prom_amount > 0) {
... ... @@ -3793,6 +3802,9 @@ Page({
3793 3802 }
3794 3803 })
3795 3804 }
  3805 + if(gg.groupchat_id){
  3806 + goods.groupchat_id=gg.groupchat_id
  3807 + }
3796 3808  
3797 3809 //--商品的房间号--
3798 3810 if (gg.room_id && gg.room_id > 0) {
... ... @@ -3900,6 +3912,9 @@ Page({
3900 3912 }
3901 3913 })
3902 3914 }
  3915 + if(gg.groupchat_id){
  3916 + g_goods.groupchat_id=gg.groupchat_id;
  3917 + }
3903 3918 item.order_goods.push(g_goods);
3904 3919  
3905 3920 }
... ... @@ -4068,7 +4083,7 @@ Page({
4068 4083  
4069 4084  
4070 4085 var check_map = {};
4071   -
  4086 + let groupchat_ids=[]
4072 4087 //-------------让商品添加到商品列表--------------------
4073 4088 for (var k = 0; k < t_item.goods.length; k++) {
4074 4089  
... ... @@ -4174,7 +4189,11 @@ Page({
4174 4189 }
4175 4190 })
4176 4191 }
4177   -
  4192 +
  4193 + if(g_item.groupchat_id){
  4194 + goods.groupchat_id=g_item.groupchat_id;
  4195 + groupchat_ids.push(g_item.groupchat_id);
  4196 + }
4178 4197 //如果有阶梯促销
4179 4198 if (g_item.ladder_list_id) {
4180 4199 goods.ladder_list_id = g_item.ladder_list_id;
... ... @@ -4196,22 +4215,24 @@ Page({
4196 4215 item.is_whsle = 1;
4197 4216 item.whsle_id = g_item.whsle_id
4198 4217 }
4199   -
4200   - item.order_goods.push(goods);
4201 4218 //如果房间号不为空的时候
4202 4219 if (g_item.room_id) {
4203 4220 goods.room_id = g_item.room_id;
4204 4221 room_ids += g_item.room_id + ",";
4205 4222 }
  4223 +
  4224 + item.order_goods.push(goods);
  4225 +
4206 4226 }
4207 4227 }
4208 4228  
4209 4229  
4210   -
  4230 +
4211 4231  
4212 4232 //如果房间号不为空的时候
4213 4233 if (room_ids != "") item.room_ids = ut.sub_last(room_ids);
4214   -
  4234 + if (groupchat_ids && groupchat_ids.length>0) item.groupchat_ids = groupchat_ids.join(',');
  4235 + // if (getApp().globalData.groupchat_id) {item.groupchat_id = getApp().globalData.groupchat_id;}
4215 4236 //处理代发商品的拆分
4216 4237 if (df_goods.length > 0) {
4217 4238  
... ... @@ -4263,6 +4284,10 @@ Page({
4263 4284  
4264 4285 if (ddff_item.df_room_ids)
4265 4286 df_item.room_ids = ut.sub_last(ddff_item.df_room_ids);
  4287 +
  4288 + if (getApp().globalData.groupchat_id){
  4289 + df_item.groupchat_ids = getApp().globalData.groupchat_id;
  4290 + }
4266 4291 df_item.order_goods = ddff_item.df_goods;
4267 4292 pdata.push(df_item);
4268 4293 }
... ... @@ -4300,6 +4325,7 @@ Page({
4300 4325 })
4301 4326 // pdata.keyid = th.data.bn_goods.keyid
4302 4327 }
  4328 +
4303 4329 var str = JSON.stringify(pdata);
4304 4330  
4305 4331 wx.showLoading({ title: "加载中" });
... ... @@ -5248,7 +5274,7 @@ Page({
5248 5274 continue;
5249 5275 }
5250 5276  
5251   - if(gd.prom_type==5 && !th.data.coll_prom[gd.prom_id].is_coupon){
  5277 + if(gd.prom_type==5 && !th.data.coll_prom[gd.prom_id].is_coupon && th.has_dp(goodlist,gd.prom_id)){
5252 5278 continue;
5253 5279 }
5254 5280 //--如果是团购,要判断有没有限制使用优惠券
... ... @@ -5358,6 +5384,8 @@ Page({
5358 5384 arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0);
5359 5385 arr[ind].check_quan_ware_list = check_quan_ware_list;
5360 5386 arr[ind].check_quan_price_list = check_quan_price_list;
  5387 + arr[ind].quan_list=null;
  5388 +
5361 5389 //-- 是否关闭使用优惠券,循环有找到商品 --
5362 5390 if (th.data.is_close_quan != 1 && check_quan_ware_list) {
5363 5391 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
... ... @@ -5377,8 +5405,13 @@ Page({
5377 5405 }
5378 5406 })
5379 5407 }
  5408 +
  5409 +
5380 5410 }
5381 5411  
  5412 +
  5413 +
  5414 +
5382 5415 //如果是搭配购的立即购买的时候
5383 5416 if (th.data.is_b_now) {
5384 5417 if (arr && arr.length > 0) {
... ... @@ -6489,6 +6522,9 @@ Page({
6489 6522 var th = this;
6490 6523 //--按钮变灰色 --
6491 6524 th.setData({ submit: 1 });
  6525 + var txt = 'using_quan[' + th.data.bn_pick + ']';
  6526 + th.setData({[txt]: null})
  6527 +
6492 6528 //如果是选中
6493 6529 if (e.selected) {
6494 6530 var item = this.data.all_collocation_list[e.index];
... ... @@ -6529,6 +6565,7 @@ Page({
6529 6565  
6530 6566 th.setData({is_coupon:item.is_coupon})
6531 6567  
  6568 +
6532 6569 var coll_arr = [];
6533 6570 if (this.data.collocation_goods && this.data.collocation_goods.length) {
6534 6571 coll_arr = this.data.collocation_goods;
... ... @@ -6567,11 +6604,16 @@ Page({
6567 6604 if (!coll_arr || coll_arr.length < 1) {
6568 6605 //让主商品的活动变成0,取消搭配购
6569 6606 this.setData({ 'bn_goods.prom_type': 0, 'bn_goods.prom_id': 0, collocation_goods: [] });
  6607 +
  6608 + th.setData({is_coupon:1})
  6609 +
6570 6610 //计算价格
6571 6611 th.calculatePrice2();
6572 6612 //获取优惠券
6573 6613 th.get_buy_now_quan();
6574 6614  
  6615 +
  6616 +
6575 6617 } else {
6576 6618 this.setData({ collocation_goods: coll_arr });
6577 6619 //要进行深拷贝
... ... @@ -6597,6 +6639,11 @@ Page({
6597 6639 var txt = 'cartlist[' + cart_index + '].goods';
6598 6640 var txt2 = 'cartlist[' + cart_index + '].collocationList[' + index + '].selected';
6599 6641  
  6642 + //有改,都强制把券选择清理一下
  6643 + var pickup_id = this.data.cartlist[cart_index].pickup_id;
  6644 + var txt='using_quan['+pickup_id+']';
  6645 + th.setData({[txt]:null});
  6646 +
6600 6647 //-- 如果是选中 --
6601 6648 if (e.selected) {
6602 6649  
... ... @@ -6736,6 +6783,17 @@ Page({
6736 6783 }
6737 6784  
6738 6785 th.data.old_cartlist = cart_arr;
  6786 + },
  6787 +
  6788 + //-- 获取到搭配 --
  6789 + has_dp:function (list,prom_id){
  6790 + for (let i in list) {
  6791 + var it=list[i];
  6792 + if(it.prom_id==prom_id && it.is_collocation==1){
  6793 + return true;
  6794 + }
  6795 + }
  6796 + return false;
6739 6797 }
6740 6798  
6741 6799  
... ...
packageE/pages/qy/contactMe/contactMe.js 0 → 100644
  1 +var t = require("../../../../utils/common.js");
  2 +const app = getApp();
  3 +var os = app.globalData.setting;
  4 +var regeneratorRuntime = require('../../../../utils/runtime.js');
  5 +
  6 +Page({
  7 + data: {
  8 + user: null,
  9 + show_bind: 0,
  10 + imghots: os.imghost,
  11 + store_logo: '',
  12 + first_leader: '', //-- 邀请人 --
  13 + config2: null,
  14 + sub: 0,
  15 + phone:'',
  16 + id:"",
  17 + openuserid:'',
  18 + skip_verify:1,
  19 + error_arr:{
  20 + '81012':'缺失可见范围',
  21 + '81013':'UserID、部门ID、标签ID全部非法或无权限',
  22 + '40031':'不合法的UserID列表',
  23 + '0032': '不合法的UserID列表长度',
  24 + '40058':'不合法的参数',
  25 + '40063':'参数为空',
  26 + '40094':'不合法的URL',
  27 + '40096':'不合法的外部联系人userid',
  28 + '40099':'外部联系人的数量已达上限',
  29 + '40100':'此用户的外部联系人已经在转移流程中',
  30 + '40125':'无效的openuserid参数',
  31 + '41001':'缺少access_token参数',
  32 + '41009':'缺少userid参数',
  33 + '41010':'缺少url参数',
  34 + '41035':'缺少外部联系人userid参数',
  35 + "41037":'缺少「联系我」type参数',
  36 + "41038":'缺少「联系我」scene参数',
  37 + "41039":'无效的「联系我」type参数',
  38 + "41040":'无效的「联系我」scene参数',
  39 + "41041":'「联系我」使用人数超过限制',
  40 + "41042":'无效的「联系我」style参数',
  41 + "41043":'缺少「联系我」config_id参数',
  42 + "41044":'无效的「联系我」config_id参数',
  43 + "41045":'API添加「联系我」达到数量上限',
  44 + "42001":'access_token已过期',
  45 + '43009': '企业未验证主体',
  46 + '45009': '接口调用超过限制',
  47 + '45022': '应用name参数长度不符合系统限制',
  48 + '45024': '帐号数量超过上限',
  49 + '45034': 'url必须有协议头',
  50 + '46004': '指定的用户不存在',
  51 + '48001': 'API功能未授权',
  52 + '48002': 'API接口无权限调用',
  53 + '48003': '不合法的suite_id',
  54 + '48004': '授权关系无效',
  55 + '48005': 'API接口已废弃',
  56 + '48006': '接口权限被收回',
  57 + '60102': 'UserID已存在',
  58 + '670010': '负责人数量超出限制',
  59 + '81014': '标签添加成员,单次添加user或party过多',
  60 + '82001':' 指定的成员/部门/标签全部为空',
  61 + '84072': '应用未配置客服',
  62 + '84073': '客服userid不在应用配置的客服列表中',
  63 + '84074': '没有外部联系人权限',
  64 + '84075': '不合法或过期的authcode',
  65 + '84076': '缺失authcode',
  66 + '84083': '非服务人员',
  67 + '84084': '非跟进用户',
  68 + '84085': '应用已下架',
  69 + '84144': '确认者的gid不在当前服务商的通讯录中',
  70 + '84145': '确认者gid所在的企业数不能超过5个',
  71 + '84146': '确认者gid最多只能在3个企业下确认合同',
  72 + '86001': '参数 chatid 不合法',
  73 + '86003': '参数 chatid 不存在',
  74 + '86004': '参数 群名不合法',
  75 + '86005': '参数 群主不合法',
  76 + '86006': '群成员数过多或过少',
  77 + '86007': '不合法的群成员',
  78 + },
  79 + },
  80 + onLoad: function (tt) {
  81 + // tt.scene="0_0_22"
  82 + if (tt && tt.scene) {
  83 + var first_leader_str = decodeURIComponent(tt.scene);
  84 + var f_arr = first_leader_str.split("_");
  85 + // first_leader = f_arr[0] && parseFloat(f_arr[0]) > 0 ? f_arr[0] : null;
  86 + //注册门店
  87 + // if (f_arr[1] && parseFloat(f_arr[1]) > 0) {
  88 + // getApp().globalData.store_number = f_arr[1];
  89 + // }
  90 + //企业微信群id
  91 + if (f_arr && f_arr[2] && parseFloat(f_arr[2]) > 0) {
  92 + this.setData({
  93 + id:f_arr[2]
  94 + })
  95 + this.getopenuserid(f_arr[2])
  96 + // getApp().globalData.groupchat_id = f_arr[2];
  97 + }
  98 +
  99 + }
  100 + // if (wx.getUserProfile) {
  101 + // this.setData({
  102 + // canIUseGetUserProfile: true
  103 + // })
  104 + // }
  105 + // getApp().globalData.isLoad_ad = 1;
  106 + //--判断是否有接受到邀请人的ID--
  107 + // if (options.first_leader) {
  108 + // this.setData({ first_leader: options.first_leader });
  109 + // } else if (getApp().globalData.first_leader) {
  110 + // this.setData({ first_leader: getApp().globalData.first_leader });
  111 + // }
  112 + var th = this;
  113 + app.getConfig(function (e) {
  114 + var logo = th.data.imghots + e.store_logo;
  115 + th.setData({ store: e, store_logo: logo });
  116 + })
  117 +
  118 + //判断注册的条件
  119 + // app.getConfig2(function (e) {
  120 + // if (e.reg_type == 1) {
  121 + // var arr = JSON.parse(e.reg_info);
  122 + // if (arr['name_state'] == 1) th.data.name_need_go = 1;
  123 + // if (arr['birthday_state'] == 1) th.data.birth_need_go = 1;
  124 + // if (arr['idcard_state'] == 1) th.data.idcard_need_go = 1;
  125 + // if (arr['address_state'] == 1) th.data.address_need_go = 1;
  126 + // if (arr['pick_state'] == 1) th.data.pick_need_go = 1;
  127 + // if (arr['sex_state'] == 1) th.data.sex_need_go = 1;
  128 + // if (arr['introducer_state'] == 1) th.data.introducer_need_go = 1;
  129 + // }
  130 + // var json_d = JSON.parse(e.switch_list);
  131 + // if (json_d.user_label_set == 1) {
  132 + // th.data.is_lable_set = 1
  133 + // }
  134 + // }, 1)
  135 +
  136 + // getApp().promiseGet("/api/wx/weappSendlist/page", {
  137 + // data: {
  138 + // store_id: os.stoid,
  139 + // typeid: "1007"
  140 + // }
  141 + // }).then(res => {
  142 + // if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  143 + // var template_id = res.data.data.pageData[0].template_id;
  144 + // th.setData({ template_id: template_id });
  145 + // }
  146 + // })
  147 + },
  148 +
  149 + getopenuserid(id){
  150 + let url=`/api/weshop/qyWeChat/qywxStaffcode/get/${id}`
  151 + getApp().request.promiseGet(url,{data:{}}).then(res => {
  152 + console.log(res);
  153 + if (res.data.code == 0) {
  154 + // let resdata=JSON.parse(res.data.data);
  155 + let openuserid=res.data.data.openuserid;
  156 + let skip_verify=res.data.data.skip_verify;
  157 + this.setData({
  158 + openuserid,
  159 + skip_verify
  160 + })
  161 + // if (this.data.phone) {
  162 + // this.getqy()
  163 + // }
  164 + }
  165 + })
  166 + },
  167 + async getqy(){
  168 + // wx.showLoading({
  169 + // title: '加载中',
  170 + // mask:true
  171 + // })
  172 + let openuserid=this.data.openuserid
  173 + let skip_verify=this.data.skip_verify ? true : false
  174 + let res = await getApp().request.promisePost(`/apib/weshop/admin/qyWeChat/qyWeChatCorpInfo/postAdminQyApi?accdb=${this.data.store.erpid}&url=externalcontact/add_contact_way`, {
  175 + data: {
  176 + // accdb: getApp().globalData.config.erpid,
  177 + // ApiName: 'api.pos.shop.advancesum.seek',
  178 + // url:'externalcontact/add_contact_way',
  179 + user:openuserid,
  180 + type:1,
  181 + scene:2,
  182 + style:1,
  183 + state:'手店_'+this.data.phone,
  184 + skip_verify
  185 + // is_temp:true,
  186 + // store_id: getApp().globalData.setting.stoid,
  187 + // usercode: "admin",
  188 + // vipid: this.data.userinfo.erpvipid,
  189 + // oddsum: "0",
  190 + // advancesum: cartList.order_amount,
  191 + // storageid: storageid,
  192 + // listform
  193 + },
  194 + is_json: 1
  195 + })
  196 + wx.hideLoading()
  197 + if(res.data && res.data.errcode==0){
  198 + this.setData({
  199 + qr_code:res.data.qr_code
  200 + })
  201 + this.saveqy(res.data.config_id,res.data.qr_code)
  202 + }else{
  203 + let errcode=res.data.errcode
  204 + let msg=errcode
  205 + if (this.data.error_arr[errcode]) {
  206 + msg+=this.data.error_arr[errcode]
  207 + }
  208 + wx.showModal({
  209 + title: '提示',
  210 + content: '获取失败,错误码:'+msg,
  211 + showCancel:false,
  212 + success (res) {
  213 + if (res.confirm) {
  214 + console.log('用户点击确定')
  215 + } else if (res.cancel) {
  216 + console.log('用户点击取消')
  217 + }
  218 + }
  219 + })
  220 + }
  221 + console.log('获取企业二维码');
  222 + console.log(res);
  223 + },
  224 +
  225 + //绑定手机号
  226 + getphone: function (e) {
  227 + //接下来写业务代码登录
  228 + console.log(e);
  229 + // return
  230 + e = e.detail;
  231 + if (e.code == undefined) {
  232 + this.setData({ show_bind: 0 })
  233 + return app.my_warnning("登录需要授权手机号码!", 0, this);
  234 + return false;
  235 + }
  236 + // var sessionKey = getApp().globalData.sessionKey;
  237 + var req_data = {
  238 + js_code: e.code,
  239 + store_id: getApp().globalData.setting.stoid,
  240 + }
  241 + //-- 获取一下手机 --/api/weshop/users/getCodeMobile?store_id=1&js_code=b8451556dd98b2eebec5aa6775625bce192a68fc1a4b15b0c6bf3ed046f90da4
  242 + getApp().request.promiseGet("/api/weshop/users/getCodeMobile", { data: req_data }).then(res => {
  243 + // console.log('手机号码');
  244 + // console.log(res);
  245 + if (res.data.code == 0) {
  246 + let resdata=JSON.parse(res.data.data);
  247 + this.setData({
  248 + phone:resdata.phoneNumber
  249 + })
  250 + this.befgetqy()
  251 + // getApp().globalData.zc_dd = dd;
  252 + // wx.redirectTo({
  253 + // url: "/packageA/pages/profile/profile?is_back=1"
  254 + // })
  255 + }
  256 + })
  257 + // var sessionKey = getApp().globalData.sessionKey;
  258 + // var openid = getApp().globalData.openid;
  259 + // var r = getApp().globalData.getu;
  260 + // this.save_the_data(r, e, sessionKey, openid)
  261 + },
  262 + async befgetqy(){
  263 + wx.showLoading({
  264 + title: '加载中',
  265 + mask:true
  266 + })
  267 + let openuserid=this.data.openuserid
  268 + let res = await getApp().request.promiseGet(`/api/weshop/qyWeChat/qywxConfigList/getMobileInfo/${getApp().globalData.setting.stoid}/${openuserid}/${this.data.phone}`, { data: {} })
  269 + console.log('获取数据库表');
  270 + console.log(res);
  271 + if (res.data && res.data.code==0) {
  272 + this.setData({
  273 + qr_code:res.data.data.qrcode
  274 + })
  275 + wx.hideLoading()
  276 + }else{
  277 + this.getqy()
  278 + }
  279 +
  280 + },
  281 + async saveqy(config_id,qrcode){
  282 + let openuserid=this.data.openuserid
  283 + let mobile=this.data.phone
  284 + let addtime=((Date.now())/1000).toFixed(0)
  285 + let req_data = {
  286 + store_id: getApp().globalData.setting.stoid,
  287 + openuserid,
  288 + config_id,
  289 + qrcode,
  290 + mobile,
  291 + addtime
  292 + }
  293 + let res = await getApp().request.promisePost(`/api/weshop/qyWeChat/qywxConfigList/save`, {
  294 + data: req_data,
  295 + // is_json: 1
  296 + })
  297 + // wx.hideLoading()
  298 + },
  299 +
  300 +
  301 +
  302 + //-- 会员授权 --
  303 + bindGetUserInfo: function (ee) {
  304 + if (!this.data.isAgree) {
  305 + wx.showToast({
  306 + title: '请您先阅读和勾选指定的内容',
  307 + icon: 'none',
  308 + });
  309 + return false;
  310 + }
  311 + var that = this;
  312 + //-- 点击授权 --
  313 + that.getUserProfile(function (res) {
  314 + var user = res;
  315 + //--拿下code--
  316 + wx.login({
  317 + success: function (o) {
  318 + var dd = {
  319 + js_code: o.code,
  320 + store_id: os.stoid,
  321 + nickname: app.clear_word(app.globalData.getu.nickName),
  322 + head_pic: app.clear_word(app.globalData.getu.avatarUrl)
  323 + };
  324 + //-- 导购会员ID --
  325 + if (getApp().globalData.guide_id) {
  326 + dd.guide_id = getApp().globalData.guide_id;
  327 + }
  328 +
  329 + getApp().request.get("/api/weshop/users/openidandkey", {
  330 + data: dd,
  331 + success: function (e) {
  332 + if (e.data.code == 0) {
  333 + that.setData({ user: user })
  334 + //如果有会员的话,没有sessionKey
  335 + if (!e.data.data.sessionKey) {
  336 + // getApp().showWarning("登录成功");
  337 + wx.showToast({
  338 + title: '登录成功',
  339 + icon: 'success',
  340 + duration: 2000
  341 + });
  342 + getApp().globalData.userInfo = e.data.data;
  343 + getApp().globalData.user_id = e.data.data.user_id;
  344 + getApp().globalData.openid = e.data.data.weapp_openid;
  345 + //把会员的信息存在内存
  346 + wx.setStorageSync("userinfo", e.data.data);
  347 +
  348 + //调用接口判断是不是会员
  349 + app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
  350 + if (res.data.code == 0) {
  351 + getApp().globalData.guide_id = res.data.data.id;
  352 + }
  353 + })
  354 +
  355 +
  356 + setTimeout(function () {
  357 + getApp().globalData.login_back = 1;
  358 + wx.navigateBack({ delta: 1 }) //返回上一页
  359 + }, 1000)
  360 + } else {
  361 + getApp().globalData.sessionKey = e.data.data.sessionKey;
  362 + getApp().globalData.openid = e.data.data.openid;
  363 + that.setData({ show_bind: 1 });
  364 + }
  365 + } else {
  366 + getApp().confirmBox(e.data.msg);
  367 + }
  368 + }
  369 + });
  370 + }
  371 + })
  372 +
  373 + })
  374 + },
  375 +
  376 + //-- 调整后的获取会员信息 --
  377 + getUserProfile: function (func) {
  378 + var that = this;
  379 + wx.getUserProfile({
  380 + desc: '获取用户相关信息',
  381 + success: res => {
  382 + console.log("getUserProfile", res);
  383 + //此处授权得到userInfo
  384 + getApp().globalData.getu = res.userInfo;
  385 + func(res.userInfo);
  386 + }
  387 + });
  388 + },
  389 +
  390 + //暂不登录,返回上一页
  391 + cancle_bind: function () {
  392 + wx.navigateBack({ delta: 1 })
  393 + },
  394 +
  395 + close_pop: function () {
  396 + this.setData({ show_bind: 0 })
  397 + },
  398 + show_bind_mobile: function () {
  399 + let th = this;
  400 + th.sendsm(function () {
  401 + th.setData({ show_bind: 1 })
  402 + })
  403 + },
  404 +
  405 +
  406 + save_the_data: async function (r, e, sessionKey, openid) {
  407 + var app = getApp(), a = app, th = this;
  408 + var dd = {
  409 + oauth: "miniapp",
  410 + nickname: a.clear_word(r.nickName),
  411 + head_pic: r.avatarUrl,
  412 + sex: r.gender,
  413 + terminal: "miniapp",
  414 + sessionKey: sessionKey,
  415 + openid: openid,
  416 + encryptedData: e.encryptedData,
  417 + iv: e.iv,
  418 + store_id: getApp().globalData.setting.stoid,
  419 + };
  420 + //--如果有邀请人的时候--
  421 + if (th.data.first_leader) {
  422 + dd.first_leader = th.data.first_leader;
  423 + }
  424 + //-- 导购会员ID --
  425 + if (getApp().globalData.guide_id) {
  426 + dd.guide_id = getApp().globalData.guide_id;
  427 + }
  428 +
  429 + //门店的扫描识别码
  430 + if (getApp().globalData.store_number) {
  431 + dd.SunCode = encodeURIComponent(getApp().globalData.store_number.trim());
  432 + }
  433 +
  434 + console.log("-----会员注册的信息-------");
  435 + console.log(dd);
  436 +
  437 +
  438 + var need_go = 0;
  439 + //如果有需要完善的信息没有完善,就需要跳转
  440 + if (th.data.name_need_go) { need_go = 1; }
  441 + if (th.data.birth_need_go) { need_go = 1; }
  442 + if (th.data.idcard_need_go) { need_go = 1; }
  443 + if (th.data.address_need_go) { need_go = 1; }
  444 + if (th.data.pick_need_go) { need_go = 1; }
  445 + if (th.data.sex_need_go) { need_go = 1; }
  446 + if (th.data.introducer_need_go) { need_go = 1; }
  447 +
  448 + if (need_go) {
  449 +
  450 + var req_data = {
  451 + sessionKey: sessionKey,
  452 + encryptedData: e.encryptedData,
  453 + iv: e.iv,
  454 + store_id: getApp().globalData.setting.stoid,
  455 + }
  456 + //-- 获取一下手机 --
  457 + getApp().request.promiseGet("/api/weshop/users/getmobile", { data: req_data }).then(res => {
  458 + if (res.data.code == 0) {
  459 + dd.mobile = res.data.data;
  460 + getApp().globalData.zc_dd = dd;
  461 + wx.redirectTo({
  462 + url: "/packageA/pages/profile/profile?is_back=1"
  463 + })
  464 + }
  465 + })
  466 +
  467 + } else {
  468 + if (th.data.is_lable_set) {
  469 + var req_data = {
  470 + sessionKey: sessionKey,
  471 + encryptedData: e.encryptedData,
  472 + iv: e.iv,
  473 + store_id: getApp().globalData.setting.stoid,
  474 + }
  475 + //-- 获取一下手机 --
  476 + getApp().request.promiseGet("/api/weshop/users/getmobile", { data: req_data }).then(res => {
  477 + if (res.data.code == 0) {
  478 + dd.mobile = res.data.data;
  479 + getApp().globalData.zc_dd = dd;
  480 + wx.redirectTo({
  481 + url: "/packageE/pages/user/labels/labels?pageType=1"
  482 + })
  483 + }
  484 + })
  485 + } else {
  486 + this.setData({ sub: 1 });
  487 + wx.showLoading({
  488 + title: '处理中.',
  489 + mask: true
  490 + })
  491 + this.zu_ce(dd); //调用注册的函数
  492 + }
  493 + }
  494 +
  495 + },
  496 +
  497 + zu_ce: function (dd) {
  498 + var th = this;
  499 + app.request.get("/api/weshop/users/thirdLogin", {
  500 + data: dd,
  501 + success: function (e) {
  502 + if (e.data.code == 0) {
  503 + app.globalData.user_id = e.data.data.user_id;
  504 + } else {
  505 + return app.showWarning("授权登入失败!" + e.data.msg);
  506 + }
  507 + getApp().globalData.login_back = 1;
  508 + wx.setStorageSync("userinfo", e.data.data);
  509 + wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(app.globalData.userInfo.head_pic);
  510 + //调用接口判断是不是会员
  511 + app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
  512 + if (res.data.code == 0) {
  513 + getApp().globalData.guide_id = res.data.data.id;
  514 + }
  515 + })
  516 +
  517 + },
  518 + failStatus: function (t) {
  519 + th.setData({ sub: 0 });
  520 + return app.my_warnning("授权登入失败,请稍后再试!", 0, th);
  521 + },
  522 + fail: function (t) {
  523 + th.setData({ sub: 0 });
  524 + return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  525 + }
  526 + });
  527 + },
  528 +
  529 +
  530 + bind_bnerr: function (e) {
  531 + var _errImg = e.target.dataset.errorimg;
  532 + var _errObj = {};
  533 + _errObj[_errImg] = this.data.imghots + "/miniapp/images/logo.png";
  534 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  535 + },
  536 +
  537 + //-- 会员授权 --
  538 + bindUserInfo: function (ee) {
  539 + var that = this;
  540 + var user = ee.detail.userInfo;
  541 + //此处授权得到userInfo
  542 + getApp().globalData.getu = user;
  543 +
  544 + //--拿下code--
  545 + wx.login({
  546 + success: function (o) {
  547 + var dd = {
  548 + js_code: o.code,
  549 + store_id: os.stoid,
  550 + nickname: app.clear_word(app.globalData.getu.nickName),
  551 + head_pic: app.clear_word(app.globalData.getu.avatarUrl)
  552 + };
  553 + //-- 导购会员ID --
  554 + if (getApp().globalData.guide_id) {
  555 + dd.guide_id = getApp().globalData.guide_id;
  556 + }
  557 +
  558 + getApp().request.get("/api/weshop/users/openidandkey", {
  559 + data: dd,
  560 + success: function (e) {
  561 + if (e.data.code == 0) {
  562 + that.setData({ user: user })
  563 + //如果有会员的话,没有sessionKey
  564 + if (!e.data.data.sessionKey) {
  565 + // getApp().showWarning("登录成功");
  566 + wx.showToast({
  567 + title: '登录成功',
  568 + icon: 'success',
  569 + duration: 2000
  570 + });
  571 +
  572 + getApp().globalData.userInfo = e.data.data;
  573 + getApp().globalData.user_id = e.data.data.user_id;
  574 + getApp().globalData.openid = e.data.data.weapp_openid;
  575 + //把会员的信息存在内存
  576 + wx.setStorageSync("userinfo", e.data.data);
  577 +
  578 + //调用接口判断是不是会员
  579 + app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
  580 + if (res.data.code == 0) {
  581 + getApp().globalData.guide_id = res.data.data.id;
  582 + }
  583 + })
  584 +
  585 +
  586 + setTimeout(function () {
  587 + getApp().globalData.login_back = 1;
  588 + wx.navigateBack({ delta: 1 }) //返回上一页
  589 + }, 1000)
  590 + } else {
  591 + getApp().globalData.sessionKey = e.data.data.sessionKey;
  592 + getApp().globalData.openid = e.data.data.openid;
  593 + that.setData({ show_bind: 1 });
  594 + }
  595 + } else {
  596 + getApp().confirmBox(e.data.msg);
  597 + }
  598 + }
  599 + });
  600 + }
  601 + })
  602 +
  603 +
  604 + },
  605 +
  606 +
  607 + close_pop_back: function () {
  608 + this.close_pop();
  609 + wx.navigateBack({ delta: 1 })
  610 + },
  611 +
  612 +
  613 + // 是否同意协议
  614 + isAgree(e) {
  615 + let isAgree = null;
  616 + if (e.detail.value[0]) {
  617 + isAgree = true;
  618 + } else {
  619 + isAgree = false;
  620 + };
  621 + // this.data.isAgree = isAgree;
  622 + this.setData({
  623 + isAgree,
  624 + });
  625 + },
  626 +
  627 +
  628 + //通过路径跳转到其他页面
  629 + goto: function (e) {
  630 + console.log('xxxx', e);
  631 + var url = e.currentTarget.dataset.url;
  632 + getApp().goto(url);
  633 + },
  634 +
  635 + //订阅消息提醒
  636 + sendsm: function (func) {
  637 + var template_id = this.data.template_id;
  638 + // //授权订阅
  639 + wx.requestSubscribeMessage({
  640 + tmplIds: [template_id],
  641 + success(res) {
  642 + func();
  643 + },
  644 + fail(res) {
  645 + func();
  646 + }
  647 + })
  648 +
  649 + },
  650 +
  651 +
  652 +})
... ...
packageE/pages/qy/contactMe/contactMe.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "warn": "/components/long_warn/long_warn"
  4 + },
  5 + "navigationBarTitleText": "联系我",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageE/pages/qy/contactMe/contactMe.wxml 0 → 100644
  1 +<view wx:if="{{!phone}}">
  2 +
  3 +<!-- 登录图 -->
  4 +<view >
  5 + <view class="logins flex-center2 ali-c flex" style="padding-top: 120rpx;">
  6 + <image mode="widthFix" bindtap="go_index" class="login_img_back" src="{{imghots}}/miniapp/images/loginbg.jpg"></image>
  7 + <view class="middle_view">
  8 + <image bindtap="go_index" class="login_img" src="{{store_logo}}" binderror="bind_bnerr" lazy-load="true" data-errorimg="store_logo"></image>
  9 + <view>{{store.store_name}}</view>
  10 + </view>
  11 + </view>
  12 +</view>
  13 +
  14 +<!-- 登录按钮 -->
  15 +<view>
  16 + <view class="phones">
  17 + <!-- <button style="height: 100%;" class="g_mobile f2 flex ali-c flex-center2 fs36 txt-red" open-type="getPhoneNumber" bindgetphonenumber="getphone">立即授权</button> -->
  18 +
  19 + <!-- <view bindtap="" class="user-name flex-vertical fs24 jc-center">
  20 + <checkbox-group bindchange="isAgree">
  21 + <checkbox value="true"/>
  22 + </checkbox-group>
  23 + <view class="user-name-txt">我已阅读同意 <text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view>
  24 + </view> -->
  25 +
  26 + <!-- 授权获取基础信息 -->
  27 + <block >
  28 + <button hidden="{{user}}" open-type="getPhoneNumber" class="getPhoneNumber" bindgetphonenumber="getphone">
  29 + <view class="flex flex-center ali-c">
  30 + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
  31 + <view>立即授权获取手机号码</view>
  32 + </view>
  33 + </button>
  34 + </block>
  35 +
  36 + <!-- <block wx:else>
  37 + <button hidden="{{user}}" class="getPhoneNumber" open-type="getUserInfo" bindgetuserinfo="bindUserInfo">
  38 + <view class="flex flex-center ali-c">
  39 + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
  40 + <view>微信账号快捷登录</view>
  41 + </view>
  42 + </button>
  43 + </block> -->
  44 +
  45 + <!-- 点击显示绑定手机的对话框 -->
  46 + <!-- <button hidden="{{!user}}" class="getPhoneNumber" bindtap="show_bind_mobile">
  47 + <view class="flex flex-center2 ali-c" >
  48 + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
  49 + <view>微信账号快捷登录</view>
  50 + </view>
  51 + </button> -->
  52 + </view>
  53 +
  54 + <!-- <view class="userlongin flex-center2 flex fs30 jc_sb" style="margin: 0 130rpx">
  55 + <view bindtap="cancle_bind">暂不授权</view>
  56 + </view> -->
  57 +
  58 +</view>
  59 +
  60 +</view>
  61 +<view wx:else class="meBox" >
  62 + <view style="font-weight: bold;margin-bottom: 10rpx;">长按识别二维码</view>
  63 + <view style="margin-bottom: 80rpx;">添加我的企业微信</view>
  64 + <image style="height: 500rpx;width: 500rpx;" src="{{qr_code}}" show-menu-by-longpress ></image>
  65 +</view>
  66 +
  67 +<!-- <view wx:if="{{show_bind}}">
  68 +<view class="cover-layer" bindtap="close_pop"></view>
  69 +<view class="p_content">
  70 + <view class="p_title flex ali-c fs34">
  71 + 登录手机号,同步会员信息以及订单记录
  72 + </view>
  73 + <view class="flex btn_view">
  74 + <view bindtap="close_pop_back" style="height: 100%; line-height:normal;" class="txt-center f2 flex ali-c flex-center2 fs36 b_right">暂不授权</view>
  75 + <button disabled="{{sub}}" style="height: 100%;" class="g_mobile f2 flex ali-c flex-center2 fs36 txt-red" open-type="getPhoneNumber" bindgetphonenumber="getphone">立即授权</button>
  76 + </view>
  77 + </view>
  78 +</view>
  79 +<warn id="warn"></warn> -->
  80 +
... ...
packageE/pages/qy/contactMe/contactMe.wxss 0 → 100644
  1 +page{
  2 + border-top: 3rpx solid #EAEAEC;
  3 + background-color: #fff;
  4 +}
  5 +.logins {
  6 + width: 100%;
  7 + /* padding-bottom: 130rpx; */
  8 + background-position: center;
  9 + background-repeat: no-repeat;
  10 + background-size: cover
  11 +}
  12 +
  13 +.login_img {
  14 + width: 192rpx;
  15 + height: 192rpx;
  16 + border-radius: 50%;
  17 +}
  18 +.phones{
  19 + margin-bottom: 48rpx;
  20 +}
  21 +.getPhoneNumber {
  22 + width: 600rpx;
  23 + height: 94rpx;
  24 + line-height: 94rpx;
  25 + background-color: #57b837;
  26 + border-radius: 48rpx;
  27 + color: rgb(255,255,255);
  28 + font-size: 32rpx;
  29 + margin-top: 40rpx;
  30 +}
  31 +.we_chat{
  32 + width: 55rpx;
  33 + height: 45rpx;
  34 + margin-right: 15rpx;
  35 +}
  36 +.userlongin{
  37 + color: #767f8e;
  38 +}
  39 +button{
  40 + border:none;
  41 +}
  42 +.login_img_back{ width: 100%;}
  43 +.p_content{
  44 + margin: 10%;
  45 + width: 80%;
  46 + height:340rpx;
  47 + top:50%;
  48 + margin-top: -180rpx;
  49 + background-color: #fff;
  50 + z-index: 12;
  51 + position: fixed;
  52 +}
  53 +
  54 +.btn_view { height: 120rpx; line-height: 120rpx; border-top:1rpx solid #e9e9e9;}
  55 +.p_title{ height:220rpx; padding: 0 40rpx; line-height: 50rpx;}
  56 +.g_mobile{ background: none;line-height: normal;}
  57 +.b_right{border-right:1rpx solid #e9e9e9;}
  58 +
  59 +.ali-c{align-items: center;}
  60 +.flex-center2{ justify-content: center;}
  61 +.f2 {
  62 + flex: 2 0;
  63 +}
  64 +
  65 +.middle_view{
  66 + position: absolute; left: 0; width: 100%; text-align: center;
  67 +}
  68 +
  69 +/*checkbox 选项框大小 */
  70 +checkbox .wx-checkbox-input {
  71 + width: 30rpx;
  72 + height: 30rpx;
  73 +}
  74 +
  75 +.gray {
  76 + color: #767f8e;
  77 +}
  78 +
  79 +.meBox{
  80 + color: rgb(127, 128, 132);
  81 + font-size: 50rpx;
  82 + height: 80vh;
  83 + display: flex;
  84 + align-items: center;
  85 + flex-direction: column;
  86 + justify-content: center;
  87 +}
0 88 \ No newline at end of file
... ...
packageE/pages/togoin/togoin.js
... ... @@ -134,6 +134,7 @@ Page({
134 134 app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
135 135 if (res.data.code == 0) {
136 136 getApp().globalData.guide_id = res.data.data.id;
  137 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
137 138 }
138 139 })
139 140  
... ... @@ -297,6 +298,7 @@ Page({
297 298 app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
298 299 if (res.data.code == 0) {
299 300 getApp().globalData.guide_id = res.data.data.id;
  301 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
300 302 }
301 303 })
302 304  
... ... @@ -367,6 +369,7 @@ Page({
367 369 app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
368 370 if (res.data.code == 0) {
369 371 getApp().globalData.guide_id = res.data.data.id;
  372 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
370 373 }
371 374 })
372 375  
... ...
pages/activity/pind_list/pind_list.js
... ... @@ -23,6 +23,10 @@ Page({
23 23  
24 24 //------初始化加载----------
25 25 onLoad: function (t) {
  26 + //群id
  27 + if(t && t.groupchat_id){
  28 + getApp().globalData.groupchat_id=t.groupchat_id
  29 + }
26 30 wx.setNavigationBarTitle({
27 31 title: "天天拼单",
28 32 })
... ... @@ -46,6 +50,7 @@ Page({
46 50 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
47 51 if (res.data.code == 0) {
48 52 getApp().globalData.guide_id = res.data.data.id;
  53 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
49 54 }
50 55 })
51 56 }
... ... @@ -220,6 +225,17 @@ Page({
220 225 } else {
221 226 pagePath += "?first_leader=" + getApp().globalData.user_id;
222 227 }
  228 + //群id分享
  229 + if (getApp().globalData.groupchat_id) {
  230 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  231 + }
  232 + }else{
  233 + if(pagePath.indexOf("?")>0){
  234 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  235 + }else{
  236 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  237 + }
  238 +
223 239 }
224 240  
225 241 console.log("11" + pagePath);
... ... @@ -267,9 +283,14 @@ Page({
267 283 store_name = getApp().globalData.setting.appName;
268 284 var user_id=getApp().globalData.user_id;
269 285 if(!user_id) user_id=0;
  286 + var url=''
  287 + //群id分享
  288 + if (getApp().globalData.groupchat_id) {
  289 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  290 + }
270 291 return {
271 292 title: '拼团活动-' + store_name,
272   - query: 'first_leader='+user_id
  293 + query: 'first_leader='+user_id+url
273 294  
274 295 }
275 296 },
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -22,6 +22,10 @@ Page({
22 22  
23 23 //------初始化加载----------
24 24 onLoad: function (t) {
  25 + //群id
  26 + if(t && t.groupchat_id){
  27 + getApp().globalData.groupchat_id=t.groupchat_id
  28 + }
25 29 wx.setNavigationBarTitle({
26 30 title: "商品秒杀",
27 31 })
... ... @@ -54,6 +58,7 @@ Page({
54 58 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
55 59 if (res.data.code == 0) {
56 60 getApp().globalData.guide_id = res.data.data.id;
  61 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
57 62 }
58 63 })
59 64 }
... ... @@ -245,7 +250,7 @@ Page({
245 250  
246 251 //---------分享配置--------
247 252 onShareAppMessage: function (e) {
248   - getApp().globalData.no_clear=1;
  253 + getApp().globalData.no_clear=1;
249 254 var curPage = this;
250 255 var pagePath = curPage.route; //当前页面url
251 256 if (pagePath.indexOf('/') != 0) {
... ... @@ -258,8 +263,19 @@ Page({
258 263 } else {
259 264 pagePath += "?first_leader=" + getApp().globalData.user_id;
260 265 }
  266 + //群id分享
  267 + if (getApp().globalData.groupchat_id) {
  268 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  269 + }
  270 + }else{
  271 + if(pagePath.indexOf("?")>0){
  272 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  273 + }else{
  274 + pagePath+="?groupchat_id="+getApp().globalData.groupchat_id
  275 + }
261 276 }
262 277  
  278 +
263 279 console.log("11" + pagePath);
264 280 return {
265 281 title: "限时秒杀",
... ... @@ -286,10 +302,16 @@ Page({
286 302  
287 303 var user_id=getApp().globalData.user_id;
288 304 if(!user_id) user_id=0;
  305 + var url=""
  306 + //群id分享
  307 + if (getApp().globalData.groupchat_id) {
  308 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  309 + }
  310 +
289 311  
290 312 return {
291 313 title: '秒杀活动-' + store_name,
292   - query: 'first_leader='+user_id
  314 + query: 'first_leader='+user_id+url
293 315 }
294 316 },
295 317  
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -1035,6 +1035,9 @@ Page({
1035 1035 if (gg.room_id && gg.room_id > 0) {
1036 1036 item.room_ids = gg.room_id;
1037 1037 }
  1038 + if(gg.groupchat_id){
  1039 + item.groupchat_ids=gg.groupchat_id
  1040 + }
1038 1041  
1039 1042 //老会员成为分销下线需要的参数
1040 1043 if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) {
... ... @@ -1085,7 +1088,9 @@ Page({
1085 1088 }
1086 1089 })
1087 1090 }
1088   -
  1091 + if(gg.groupchat_id){
  1092 + goods.groupchat_id=gg.groupchat_id
  1093 + }
1089 1094 //--商品的房间号--
1090 1095 if (gg.room_id && gg.room_id > 0) {
1091 1096 goods.room_id = gg.room_id;
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -1185,7 +1185,10 @@ Page({
1185 1185 }
1186 1186 })
1187 1187 }
1188   -
  1188 + if(gg.groupchat_id){
  1189 + goods.groupchat_id=gg.groupchat_id
  1190 + item.groupchat_ids=gg.groupchat_id
  1191 + }
1189 1192  
1190 1193 //--商品的房间号--
1191 1194 if (gg.room_id && gg.room_id > 0) {
... ...
pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -64,7 +64,9 @@ Page({
64 64 default_store: {}, //创建添加默认门店地址的对象
65 65  
66 66 store:0,
67   - openSpecModal:0
  67 + openSpecModal:0,
  68 +
  69 + is_get_guide:0,
68 70  
69 71 },
70 72 onLoad: function (options) {
... ... @@ -96,6 +98,8 @@ Page({
96 98 //-- 获取分享人的ID --
97 99 var first_leader = options.first_leader || getApp().globalData.first_leader;
98 100 if (first_leader) {
  101 +
  102 + this.data.is_get_guide=1;
99 103 this.setData({
100 104 first_leader,
101 105 })
... ... @@ -104,10 +108,16 @@ Page({
104 108 //调用接口判断是不是会员
105 109 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
106 110 if (res.data.code == 0) {
107   - getApp().globalData.guide_id = res.data.data.id;
  111 + getApp().globalData.guide_id = res.data.data.id;
  112 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
108 113 }
  114 +
  115 + com.wait_for_store_config(th);
  116 + com.set_user_mo_store(th,os);
  117 +
109 118 })
110 119 }
  120 +
111 121 getApp().request.promiseGet("/api/weshop/ad/page?pid=902&store_id=" + os.stoid, {
112 122 data: {
113 123 enabled: 1
... ... @@ -138,8 +148,12 @@ Page({
138 148 getApp().goto('/packageE/pages/togoin/togoin');
139 149 return false;
140 150 }
141   - com.wait_for_store_config(th);
142   - com.set_user_mo_store(th,os);
  151 +
  152 + if(!th.data.is_get_guide) {
  153 + com.wait_for_store_config(th);
  154 + com.set_user_mo_store(th, os);
  155 + }
  156 + th.data.is_get_guide=0;
143 157  
144 158 })
145 159 this.init();
... ... @@ -368,6 +382,15 @@ Page({
368 382 },
369 383 // 选择门店
370 384 choice_store: function (ee) {
  385 + //--先判断会员状态--
  386 + var user_info = getApp().globalData.userInfo;
  387 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  388 + wx.navigateTo({
  389 + url: '/packageE/pages/togoin/togoin',
  390 + })
  391 + return false;
  392 + }
  393 +
371 394 var th = this;
372 395 var ind = ee.currentTarget.dataset.ind;
373 396 var bconfig = th.data.bconfig;
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -144,6 +144,7 @@ Page({
144 144 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
145 145 if (res.data.code == 0) {
146 146 getApp().globalData.guide_id = res.data.data.id;
  147 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
147 148 }
148 149 })
149 150 }
... ... @@ -338,6 +339,31 @@ Page({
338 339 });
339 340  
340 341 },
  342 +
  343 + check_guide(func){
  344 + var first_leader=this.data.first_leader;
  345 + if(!first_leader){
  346 + func();
  347 + return false;
  348 + }
  349 + if(this.data.is_geted_guide_pick){
  350 + func();
  351 + return false;
  352 + }
  353 + if(getApp().globalData.guide_pick_id){
  354 + func();
  355 + return false;
  356 + }
  357 + var th=this;
  358 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  359 + if (res.data.code == 0) {
  360 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  361 + }
  362 + th.data.is_geted_guide_pick=1;
  363 + func();
  364 + })
  365 + },
  366 +
341 367 GetBuyGiftList: function () {
342 368 var _this2 = this;
343 369 var th = this.data;
... ... @@ -393,14 +419,16 @@ Page({
393 419 //需不需要门店,不需要门店返回
394 420 if (!sele_g.is_pickup) return false;
395 421  
396   - com.wait_for_store_config(_this2);
397   - com.set_user_mo_store(_this2, os, function () {
398   - if (sele_g.pickup_list && _this2.data.def_pick_store) {
399   - com.check_def_pk(_this2);
400   - }
401   - });
402   - com.get_sto(_this2, os);
403   -
  422 + //-- 检测一下有没有门店 --
  423 + _this2.check_guide(function (){
  424 + com.wait_for_store_config(_this2);
  425 + com.set_user_mo_store(_this2, os, function () {
  426 + if (sele_g.pickup_list && _this2.data.def_pick_store) {
  427 + com.check_def_pk(_this2);
  428 + }
  429 + });
  430 + com.get_sto(_this2, os);
  431 + })
404 432  
405 433 } else {
406 434 getApp().my_warnning(res.data.msg, 0, _this2);
... ... @@ -653,6 +681,16 @@ Page({
653 681 },
654 682 // 选择门店
655 683 choice_store: function (ee) {
  684 +
  685 + //--先判断会员状态--
  686 + var user_info = getApp().globalData.userInfo;
  687 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  688 + wx.navigateTo({
  689 + url: '/packageE/pages/togoin/togoin',
  690 + })
  691 + return false;
  692 + }
  693 +
656 694 var th = this;
657 695 var ind = ee.currentTarget.dataset.ind;
658 696 var bconfig = th.data.bconfig;
... ...
pages/giftpack/mygiftpack/mygiftpack.js
... ... @@ -55,6 +55,7 @@ Page({
55 55 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
56 56 if (res.data.code == 0) {
57 57 getApp().globalData.guide_id = res.data.data.id;
  58 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
58 59 }
59 60 })
60 61 }
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -105,6 +105,11 @@ Page({
105 105 // console.log(rect);
106 106 // }).exec()
107 107  
  108 + //群id
  109 + if(tt && tt.groupchat_id){
  110 + getApp().globalData.groupchat_id=tt.groupchat_id
  111 + }
  112 +
108 113 var that = this;
109 114 var first_leader = tt.first_leader;
110 115 if (first_leader) {
... ... @@ -678,7 +683,19 @@ Page({
678 683 //是分销商才带
679 684 if (userInfo) {
680 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 699 console.log("--分类分享---分享--");
683 700 console.log(url);
684 701  
... ... @@ -1237,10 +1254,14 @@ Page({
1237 1254  
1238 1255 var user_id = getApp().globalData.user_id;
1239 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 1262 return {
1242 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 275 th = ee,
276 276 gid = t.goods_id,
277 277 first_leader = t.first_leader,
  278 +
278 279 room_id = t.room_id,
279 280 room_user_share = t.room_user_share, //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
280 281 prom_type = t.prom_type || 0,
281 282 prom_id = t.prom_id || 0; //活动ID
282 283  
283 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 291 self = this;
287 292  
... ... @@ -377,11 +382,14 @@ Page({
377 382 if (first_leader) {
378 383 console.log("gd onload--3");
379 384 console.log("log---" + first_leader);
  385 +
380 386 getApp().globalData.first_leader = first_leader;
381 387 //调用接口判断是不是会员
382 388 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
383 389 if (res.data.code == 0) {
384 390 getApp().globalData.guide_id = res.data.data.id;
  391 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  392 +
385 393 }
386 394 })
387 395  
... ... @@ -492,74 +500,6 @@ Page({
492 500 }
493 501 });
494 502  
495   - //获取用户的默认门店
496   - getApp().get_user_store(function (e) {
497   - if (!e) {
498   - th.data.fir_def_store = {}; //赋值空对象
499   - return false;
500   - }
501   - if (getApp().globalData.is_dj_pk) th.setData({
502   - has_def: 1
503   - });
504   -
505   - var ee = JSON.parse(JSON.stringify(e));
506   - //--定时器推迟一下--
507   - setTimeout(function () {
508   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
509   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
510   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
511   - ee.is_no_dis = 1;
512   - }
513   -
514   - var appd = getApp().globalData;
515   - var w_time = setInterval(function () {
516   - if (that.data.is_get_local_ok == 0) return false;
517   - clearInterval(w_time);
518   - var distance = null;
519   - var e = JSON.parse(JSON.stringify(ee));
520   -
521   - //如果有开启近距离的话,同时距离优不一样了
522   - if (that.data.lat != null) {
523   - //如果经纬度有变化的话
524   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
525   - that.set_def_storage(e);
526   - } else {
527   - //要用接口是获取距离,js的计算不准
528   - getApp().request.promiseGet("/api/weshop/pickup/list", {
529   - data: {
530   - store_id: os.stoid,
531   - pickup_id: e.pickup_id,
532   - lat: th.data.lat,
533   - lon: th.data.lon,
534   - isstop: 0,
535   - is_pos: 1
536   - },
537   - }).then(res => {
538   - if (res.data.code == 0) {
539   - e = res.data.data.pageData[0];
540   - if (e) {
541   - e.is_no_dis = ee.is_no_dis;
542   - appd.pk_store = e;
543   - that.set_def_storage(e);
544   - }
545   -
546   - }
547   - })
548   - }
549   - //e.distance = distance;
550   - appd.lat = that.data.lat;
551   - appd.lon = that.data.lon;
552   -
553   - } else {
554   - if (e) {
555   - e.distance = null;
556   - that.set_def_storage(e);
557   - }
558   - }
559   - }, 500)
560   - }, 700)
561   - });
562   -
563 503 //更新点击量
564 504 //noinspection JSUnresolvedFunction
565 505 getApp().request.put("/api/weshop/goods/updateClick", {
... ... @@ -600,6 +540,7 @@ Page({
600 540 await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
601 541 if (res.data.code == 0) {
602 542 getApp().globalData.guide_id = res.data.data.id;
  543 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
603 544 }
604 545 })
605 546  
... ... @@ -857,6 +798,102 @@ Page({
857 798  
858 799 },
859 800  
  801 + check_guide(func){
  802 + var first_leader=getApp().globalData.first_leader;
  803 + if(!first_leader){
  804 + func();
  805 + return false;
  806 + }
  807 + if(this.data.is_geted_guide_pick){
  808 + func();
  809 + return false;
  810 + }
  811 +
  812 + if(getApp().globalData.guide_pick_id){
  813 + func();
  814 + return false;
  815 + }
  816 + var th=this;
  817 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  818 + if (res.data.code == 0) {
  819 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  820 + }
  821 + th.data.is_geted_guide_pick=1;
  822 + func();
  823 + })
  824 + },
  825 +
  826 + get_user_store(){
  827 + var th=this; var that=this;
  828 + //--获取用户的默认门店
  829 + getApp().get_user_store(function (e) {
  830 + if (!e) {
  831 + th.data.fir_def_store = {}; //赋值空对象
  832 + return false;
  833 + }
  834 + if (getApp().globalData.is_dj_pk) th.setData({
  835 + has_def: 1
  836 + });
  837 +
  838 + var ee = JSON.parse(JSON.stringify(e));
  839 + //--定时器推迟一下--
  840 + setTimeout(function () {
  841 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  842 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  843 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  844 + ee.is_no_dis = 1;
  845 + }
  846 +
  847 + var appd = getApp().globalData;
  848 + var w_time = setInterval(function () {
  849 + if (that.data.is_get_local_ok == 0) return false;
  850 + clearInterval(w_time);
  851 + var distance = null;
  852 + var e = JSON.parse(JSON.stringify(ee));
  853 +
  854 + //如果有开启近距离的话,同时距离优不一样了
  855 + if (that.data.lat != null) {
  856 + //如果经纬度有变化的话
  857 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  858 + that.set_def_storage(e);
  859 + } else {
  860 + //要用接口是获取距离,js的计算不准
  861 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  862 + data: {
  863 + store_id: os.stoid,
  864 + pickup_id: e.pickup_id,
  865 + lat: th.data.lat,
  866 + lon: th.data.lon,
  867 + isstop: 0,
  868 + is_pos: 1
  869 + },
  870 + }).then(res => {
  871 + if (res.data.code == 0) {
  872 + e = res.data.data.pageData[0];
  873 + if (e) {
  874 + e.is_no_dis = ee.is_no_dis;
  875 + appd.pk_store = e;
  876 + that.set_def_storage(e);
  877 + }
  878 +
  879 + }
  880 + })
  881 + }
  882 + //e.distance = distance;
  883 + appd.lat = that.data.lat;
  884 + appd.lon = that.data.lon;
  885 +
  886 + } else {
  887 + if (e) {
  888 + e.distance = null;
  889 + that.set_def_storage(e);
  890 + }
  891 + }
  892 + }, 500)
  893 + }, 700)
  894 + });
  895 + },
  896 +
860 897 //---展示---
861 898 onShow: function () {
862 899  
... ... @@ -876,6 +913,11 @@ Page({
876 913 return false;
877 914 }
878 915  
  916 + //先获取一下导购的门店
  917 + th.check_guide(()=>{
  918 + th.get_user_store();
  919 + })
  920 +
879 921 //优惠券要实时更新
880 922 getApp().getConfig2(function (e) {
881 923 var json_d = JSON.parse(e.switch_list);
... ... @@ -1154,6 +1196,9 @@ Page({
1154 1196  
1155 1197  
1156 1198  
  1199 +
  1200 +
  1201 +
1157 1202 },
1158 1203  
1159 1204 onReady() {
... ... @@ -1418,6 +1463,9 @@ Page({
1418 1463 if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
1419 1464 }
1420 1465 }
  1466 + if(getApp().globalData.groupchat_id){
  1467 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1468 + }
1421 1469  
1422 1470 //让商品带上房间号
1423 1471 //让商品带上房间号
... ... @@ -1568,7 +1616,9 @@ Page({
1568 1616 if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
1569 1617 }
1570 1618 }
1571   -
  1619 + if(getApp().globalData.groupchat_id){
  1620 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  1621 + }
1572 1622 //让商品带上房间号
1573 1623 //让商品带上房间号
1574 1624 if (!th.data.sys_switch.is_skuroom_id && th.data.sys_switch.is_skuroom_id == 1) {
... ... @@ -1867,6 +1917,9 @@ Page({
1867 1917  
1868 1918 //---加入购物车的最后一步---
1869 1919 add_cart_next(e, t, a, o, newd, CanOutQty) {
  1920 + if (getApp().globalData.groupchat_id) {
  1921 + newd.groupchat_id=getApp().globalData.groupchat_id
  1922 + }
1870 1923 var th = this, i = getApp().request;
1871 1924 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
1872 1925 if ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 && o.prom_type != 1) || th.data.is_normal) {
... ... @@ -1997,6 +2050,9 @@ Page({
1997 2050 updata['guide_type'] = 0;
1998 2051 }
1999 2052 }
  2053 + if(getApp().globalData.groupchat_id){
  2054 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  2055 + }
2000 2056  
2001 2057  
2002 2058 getApp().request.put("/api/weshop/cart/update", {
... ... @@ -2846,7 +2902,10 @@ Page({
2846 2902 d.guide_id = getApp().globalData.guide_id;
2847 2903 d.guide_type = 2;
2848 2904 }
2849   -
  2905 + if(getApp().globalData.groupchat_id){
  2906 + d.groupchat_id = getApp().globalData.groupchat_id;
  2907 + }
  2908 +
2850 2909 i.post("/api/weshop/goodscollect/save", { //添加收藏
2851 2910 data: d,
2852 2911 success: function (e) {
... ... @@ -3007,6 +3066,11 @@ Page({
3007 3066 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
3008 3067 }
3009 3068  
  3069 + //群id分享
  3070 + if (getApp().globalData.groupchat_id) {
  3071 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  3072 + }
  3073 +
3010 3074 var ob = {
3011 3075 title: price + "元 " + title,
3012 3076 path: url,
... ... @@ -5069,11 +5133,11 @@ Page({
5069 5133 if (getApp().globalData.guide_id) {
5070 5134 newd['guide_id'] = getApp().globalData.guide_id;
5071 5135 newd['guide_type'] = 0;
5072   -
5073   -
5074 5136 }
5075 5137 }
5076   -
  5138 + if(getApp().globalData.groupchat_id){
  5139 + newd['groupchat_id'] = getApp().globalData.groupchat_id;
  5140 + }
5077 5141 //让商品带上房间号
5078 5142 if (!th.data.sys_switch.is_skuroom_id && th.data.sys_switch.is_skuroom_id == 1) {
5079 5143 if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
... ... @@ -5524,6 +5588,9 @@ Page({
5524 5588 if (getApp().globalData.guide_id) {
5525 5589 pdata.guide_id = getApp().globalData.guide_id;
5526 5590 }
  5591 + if(getApp().globalData.groupchat_id){
  5592 + pdata.groupchat_id = getApp().globalData.groupchat_id;
  5593 + }
5527 5594  
5528 5595 var app = getApp(),
5529 5596 th = this;
... ... @@ -6585,6 +6652,15 @@ Page({
6585 6652 var ind = ee.currentTarget.dataset.ind;
6586 6653 var bconfig = th.data.bconfig;
6587 6654  
  6655 + //--先判断会员状态--
  6656 + var user_info = getApp().globalData.userInfo;
  6657 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  6658 + wx.navigateTo({
  6659 + url: '/packageE/pages/togoin/togoin',
  6660 + })
  6661 + return false;
  6662 + }
  6663 +
6588 6664  
6589 6665 //如果开启了,则不在选择门店
6590 6666 if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
... ... @@ -7468,6 +7544,11 @@ Page({
7468 7544 url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
7469 7545 }
7470 7546  
  7547 + //群id分享
  7548 + if (getApp().globalData.groupchat_id) {
  7549 + url+="&groupchat_id="+getApp().globalData.groupchat_id
  7550 + }
  7551 +
7471 7552 return {
7472 7553 title: this.data.data.goods_name + '-' + store_name,
7473 7554 imageUrl: this.data.gallery[0].image_url,
... ...
pages/goods/goodsList/goodsList.js
... ... @@ -55,6 +55,7 @@ Page({
55 55 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
56 56 if(res.data.code==0){
57 57 getApp().globalData.guide_id=res.data.data.id;
  58 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
58 59 }
59 60 })
60 61 if(!getApp().globalData.user_id){
... ...
pages/goods/search/search.js
... ... @@ -44,7 +44,10 @@ Page({
44 44  
45 45 onLoad: function (t) {
46 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 51 if (t.o) {
49 52 this.data.rq_data.o = JSON.parse(t.o);
50 53 };
... ... @@ -77,6 +80,7 @@ Page({
77 80 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
78 81 if (res.data.code == 0) {
79 82 getApp().globalData.guide_id = res.data.data.id;
  83 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
80 84 }
81 85 })
82 86 }
... ... @@ -430,6 +434,10 @@ Page({
430 434 pagePath += "?first_leader=" + getApp().globalData.user_id;
431 435 }
432 436 }
  437 + //群id分享
  438 + if (getApp().globalData.groupchat_id) {
  439 + pagePath+="&groupchat_id="+getApp().globalData.groupchat_id
  440 + }
433 441  
434 442 // console.log("11-11"+pagePath);
435 443 return {
... ...
pages/index/index/index.js
... ... @@ -91,12 +91,19 @@ Page({
91 91  
92 92  
93 93 onLoad: async function (tt) {
  94 + console.error('分享群id');
  95 + console.error(tt);
  96 + console.error('...................................');
94 97 wx.showShareMenu({
95 98 withShareTicket:true,
96 99 menus:['shareAppMessage','shareTimeline']
97 100 })
98 101 var th = this;
99   - var first_leader = tt.first_leader;
  102 + var first_leader = tt.first_leader;
  103 + //群id
  104 + if(tt && tt.groupchat_id){
  105 + getApp().globalData.groupchat_id=tt.groupchat_id
  106 + }
100 107 if (!first_leader && tt.scene) {
101 108 var first_leader_str = decodeURIComponent(tt.scene);
102 109 var f_arr = first_leader_str.split("_");
... ... @@ -104,9 +111,17 @@ Page({
104 111 //注册门店
105 112 if (f_arr[1] && parseFloat(f_arr[1]) > 0) {
106 113 getApp().globalData.store_number = f_arr[1];
107   - }
108   - }
109   -
  114 + }
  115 + //企业微信群id
  116 + if (f_arr[2] && parseFloat(f_arr[2]) > 0) {
  117 + getApp().globalData.groupchat_id = f_arr[2];
  118 + }
  119 +
  120 + }
  121 + // console.error('群id------------------------------------------');
  122 + // console.error(getApp().globalData.groupchat_id);
  123 + // console.error('群id------------------------------------------2222222222222222222222');
  124 + // getApp().globalData.groupchat_id=1
110 125 console.log("first_leader:"+first_leader,"onload");
111 126  
112 127  
... ... @@ -181,6 +196,7 @@ Page({
181 196 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
182 197 if (res.data.code == 0) {
183 198 getApp().globalData.guide_id = res.data.data.id;
  199 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
184 200 }
185 201 })
186 202  
... ... @@ -254,18 +270,17 @@ Page({
254 270 }).then(res => {
255 271 if (ut.ajax_ok(res)) {
256 272 first_leader=res.data.data.pageData[0].user_id;
257   - getApp().globalData.guide_id = res.data.data.id;
  273 + // getApp().globalData.guide_id = res.data.data.id;
258 274 }
259 275 })
260   -
261 276 if(!first_leader) return false;
262 277  
263 278 getApp().globalData.first_leader = first_leader;
264   -
265 279 //调用接口判断是不是会员
266 280 await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
267 281 if (res.data.code == 0) {
268 282 getApp().globalData.guide_id = res.data.data.id;
  283 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
269 284 }
270 285 })
271 286  
... ... @@ -920,8 +935,17 @@ Page({
920 935 var userInfo = getApp().globalData.userInfo;
921 936 //是分销商才带
922 937 if (userInfo) {
923   - url += "?first_leader=" + userInfo.user_id;
924   - }
  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 + }
925 949 console.log("---首页---分享--");
926 950 var title = "商城首页"
927 951 //分享
... ... @@ -929,7 +953,9 @@ Page({
929 953 title = getApp().globalData.config.store_name;
930 954 } else if (getApp().globalData.setting.appName) {
931 955 title = getApp().globalData.setting.appName;
932   - }
  956 + }
  957 +
  958 +
933 959  
934 960 var ob = {
935 961 title: title,
... ... @@ -1327,9 +1353,14 @@ Page({
1327 1353 }
1328 1354 var user_id=getApp().globalData.user_id;
1329 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 + }
1330 1361 return {
1331 1362 title: '首页-' + '-' + store_name,
1332   - query: 'first_leader='+user_id
  1363 + query: 'first_leader='+user_id+url
1333 1364 }
1334 1365 },
1335 1366  
... ...
pages/team/team_show/team_show.js
... ... @@ -126,6 +126,7 @@ Page({
126 126 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
127 127 if(res.data.code==0){
128 128 getApp().globalData.guide_id=res.data.data.id;
  129 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
129 130 }
130 131 })
131 132 }
... ... @@ -607,7 +608,7 @@ Page({
607 608 });
608 609  
609 610 //-- 获取用户的默认门店 --
610   - getApp().get_user_store(function(ee) {
  611 + getApp().get_user_store(function(ee) {
611 612 if(!ee) {
612 613 th.data.fir_def_store={}; //赋值空对象
613 614 return false;
... ... @@ -624,14 +625,14 @@ Page({
624 625 //return false;
625 626 ee.is_no_dis=1;
626 627 }
627   -
  628 +
628 629 var appd=getApp().globalData;
629 630 var w_time = setInterval(function() {
630 631 if (that.data.is_get_local_ok == 0) return false;
631 632 clearInterval(w_time);
632 633 var distance = null;
633 634 var e=JSON.parse(JSON.stringify(ee));
634   -
  635 +
635 636 //如果有开启近距离的话,同时距离优不一样了
636 637 if (that.data.lat != null) {
637 638 //如果经纬度有变化的话
... ... @@ -660,15 +661,15 @@ Page({
660 661 sto_sele_distr: e.distr_type
661 662 })
662 663 }
663   -
  664 +
664 665 }
665 666 })
666 667 }
667   -
  668 +
668 669 //e.distance = distance;
669 670 appd.lat=that.data.lat;
670 671 appd.lon=that.data.lon;
671   -
  672 +
672 673 }else{
673 674 if (e) {
674 675 e.distance = null;
... ... @@ -681,11 +682,11 @@ Page({
681 682 })
682 683 }
683 684 }
684   -
  685 +
685 686 }, 500)
686   - },1000)
  687 + },1000)
687 688 });
688   -
  689 +
689 690 //获取下redis长度,如果团已经弄完,或者拼单已经卖完
690 691 //设置值
691 692 ee.setData({
... ... @@ -1008,6 +1009,15 @@ Page({
1008 1009  
1009 1010 //-- 选择门店。此时的门店选择与门店有关系 --
1010 1011 choice_store: function(ee) {
  1012 +
  1013 + //--先判断会员状态--
  1014 + var user_info = getApp().globalData.userInfo;
  1015 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1016 + wx.navigateTo({
  1017 + url: '/packageE/pages/togoin/togoin',
  1018 + })
  1019 + return false;
  1020 + }
1011 1021  
1012 1022 var th = this;
1013 1023 var bconfig = th.data.bconfig;
... ...
pages/template/index.js
... ... @@ -30,6 +30,7 @@ Page({
30 30 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
31 31 if (res.data.code == 0) {
32 32 getApp().globalData.guide_id = res.data.data.id;
  33 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
33 34 }
34 35 })
35 36 }
... ...
pages/user/index/index.js
... ... @@ -95,6 +95,7 @@ Page({
95 95 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
96 96 if (res.data.code == 0) {
97 97 getApp().globalData.guide_id = res.data.data.id;
  98 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
98 99 }
99 100 })
100 101  
... ...
pages/user/plus/plus.js
... ... @@ -81,6 +81,7 @@ Page({
81 81 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + fir_leader, {}).then(res => {
82 82 if (res.data.code == 0) {
83 83 getApp().globalData.guide_id = res.data.data.id;
  84 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
84 85 }
85 86 })
86 87 }
... ...