Commit a26ddf6276a48251ac7c357da24ed25c872c3264

Authored by WXD-SEASON\season
2 parents a37d9e47 0a8ba509

fu OA单合并

... ... @@ -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 }
... ...
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/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   - }
271   -
272   - getApp().getConfig(function(e) {
273   - ee.setData({sto_sele_name_1:e.store_name})
274   - })
275 269  
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);
  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;
348 277  
349   - //获取用户设备信息,屏幕宽度
350   - wx.getSystemInfo({
351   - success: res => {
352   - that.setData({
353   - screenWidth: res.screenWidth
354   - })
  278 + if (share_openid) {
  279 + this.get_room_share_guide(share_openid);
  280 + }
355 281 }
356   - });
357   -
358   - //获取用户的默认门店
359   - getApp().get_user_store(function(e) {
360   - console.log('get_user_store');
361   - console.log("999999999");
362 282  
363 283  
364   - if(!e) {
365   - th.data.fir_def_store={}; //赋值空对象
366   - return false;
367   - }
  284 + var c_guide_id=t.c_guide_id;
  285 + if(c_guide_id){
  286 + th.data.c_guide_id=c_guide_id;
  287 + }
  288 +
  289 + getApp().getConfig(function(e) {
  290 + ee.setData({sto_sele_name_1:e.store_name})
  291 + })
  292 +
  293 + //----获取系统参数-----
  294 + getApp().getConfig2(function (e) {
  295 + ee.setData({
  296 + bconfig: e,
  297 + sales_rules: e.sales_rules,
  298 + });
368 299  
369   - console.log("000000");
  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);
370 324  
371   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  325 + //------几人评价-------
  326 + //n.init(th, "", "comments");
372 327  
373   - var ee=JSON.parse(JSON.stringify(e));
  328 + th.requestCardNum(), wx.pageScrollTo && th.setData({
  329 + supportPageScroll: !0
  330 + });
374 331  
  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 + });
375 374  
376   - console.log(e);
  375 + },
377 376  
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   - }
  377 + //-- 获取直播的分享人的导购信息 --
  378 + async get_room_share_guide(share_openid) {
388 379  
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   - }
  380 + var url = "/api/weshop/users/page";
  381 + var first_leader = 0;
431 382  
432   - }
433   - })
  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;
434 393 }
  394 + })
435 395  
436   - //e.distance = distance;
437   - appd.lat=that.data.lat;
438   - appd.lon=that.data.lon;
  396 + if (!first_leader) return false;
439 397  
440   - } else {
441   - if (e) {
  398 + getApp().globalData.first_leader = first_leader;
442 399  
  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
  405 + }
  406 + })
443 407  
444   - console.log('get_user_store3---');
445   - console.log(e);
  408 + },
446 409  
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 410  
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,
... ... @@ -2505,6 +2580,15 @@ Page({
2505 2580 var ind=ee.currentTarget.dataset.ind;
2506 2581 var bconfig = th.data.bconfig;
2507 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 +
2508 2592  
2509 2593 //如果开启了,则不在选择门店
2510 2594 if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){
... ...
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
... ... @@ -63,6 +63,7 @@ Page({
63 63 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
64 64 if(res.data.code==0){
65 65 getApp().globalData.guide_id=res.data.data.id;
  66 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
66 67 }
67 68 })
68 69 }
... ... @@ -89,91 +90,128 @@ Page({
89 90 }
90 91 });
91 92  
92   - //获取用户的默认门店
93   - getApp().get_user_store(function(ee) {
94   - if(!ee) {
95   - th.data.fir_def_store={}; //赋值空对象
96   - return false;
97   - }
98 93  
99   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
100   -
101   - var appd=getApp().globalData;
102   - var w_time = setInterval(function() {
103   - if (that.data.is_get_local_ok == 0) return false;
104   - if (!that.data.data) return false;
105   - clearInterval(w_time);
106   - var distance = null;
107   - var e=JSON.parse(JSON.stringify(ee));
108   -
109   - if(th.data.data) var g_distr_type=th.data.data.distr_type;
110   - e.is_no_dis=0;
111   - if(e.distr_type!=0 && g_distr_type!=0 && e.distr_type!=g_distr_type ){
112   - 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;
113 136 }
114 137  
115   - //如果有开启近距离的话,同时距离优不一样了
116   - if (that.data.lat != null) {
117   - //如果经纬度有变化的话
118   - if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
119   - that.data.fir_def_store=e;
120   - that.setData({
121   - def_pick_store: e,
122   - sto_sele_name: e.pickup_name,
123   - sto_sele_id: e.pickup_id,
124   - sto_sele_distr: e.distr_type
125   - })
126   - }else{
127   - //要用接口是获取距离,js的计算不准
128   - getApp().request.promiseGet("/api/weshop/pickup/list",{
129   - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon,is_pos: 1},
130   - }).then(res=>{
131   - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
132   - e=res.data.data.pageData[0];
133   - if (e){
134   - appd.pk_store=e;
135   - that.data.fir_def_store=e;
136   - that.setData({
137   - def_pick_store: e,
138   - sto_sele_name: e.pickup_name,
139   - sto_sele_id: e.pickup_id,
140   - sto_sele_distr: e.distr_type
141   - })
142   - }
  138 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
143 139  
144   - }
145   - })
  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;
146 152 }
147 153  
148   - //e.distance = distance;
149   - appd.lat=that.data.lat;
150   - 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 + }
151 188  
152   - }else{
153   - if (e) {
154   - e.distance = null;
155   - that.data.fir_def_store=e;
156   - that.setData({
157   - def_pick_store: e,
158   - sto_sele_name: e.pickup_name,
159   - sto_sele_id: e.pickup_id,
160   - sto_sele_distr: e.distr_type
161   - })
162   - }
163   - }
  189 + }
  190 + })
  191 + }
164 192  
165   - }, 500)
166   - });
167   -
168   - },
  193 + //e.distance = distance;
  194 + appd.lat = that.data.lat;
  195 + appd.lon = that.data.lon;
169 196  
170   - //---展示---
171   - 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 + }
172 209  
173   - getApp().check_can_share();
  210 + }, 500)
  211 + });
  212 + })
174 213  
175   - var ee=this,th=ee,that=ee;
176   - var gid = this.data.gid,i = getApp().request;
  214 + var gid = this.data.gid,i = getApp().request;
177 215 ee.data.g_buy_num = new Map();
178 216 this.wait_for_store_config();
179 217 clearTimeout(ot);
... ... @@ -1418,6 +1456,16 @@ Page({
1418 1456  
1419 1457 // 选择门店
1420 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 +
1421 1469 var th = this;
1422 1470 var ind=ee.currentTarget.dataset.ind;
1423 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,11 +26,26 @@ Page({
26 26 * 生命周期函数--监听页面加载
27 27 */
28 28 onLoad: function (options) {
  29 +
29 30 self = this;
30 31 //群id
31 32 if(options && options.groupchat_id){
32 33 getApp().globalData.groupchat_id=options.groupchat_id
33 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 + }
  48 +
34 49 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
35 50 self.setData({
36 51 userInfo: data,
... ... @@ -191,6 +206,31 @@ Page({
191 206 path: pagePath,
192 207 }
193 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 +
194 234  
195 235  
196 236 /**
... ...
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
... ... @@ -23,11 +23,12 @@ Page({
23 23 if(first_leader) {
24 24 app.globalData.first_leader = first_leader;
25 25 //调用接口判断是不是会员
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   - // }
30   - // })
  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 + })
31 32 };
32 33  
33 34 app.isLogin().then(function(data) {
... ...
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 //------初始化加载----------
... ... @@ -309,6 +310,8 @@ Page({
309 310 prom_type = t.prom_type,
310 311 prom_id = t.group_id; //活动ID
311 312  
  313 + var share_openid = t.share_openid;
  314 +
312 315 if (prom_type) {
313 316 // this.data.prom_type = prom_type;
314 317 // this.data.prom_id = prom_id;
... ... @@ -397,6 +400,7 @@ Page({
397 400 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
398 401 if (res.data.code == 0) {
399 402 getApp().globalData.guide_id = res.data.data.id;
  403 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
400 404 }
401 405 })
402 406 }
... ... @@ -408,6 +412,10 @@ Page({
408 412 //如果是会员分享过来的要记录
409 413 if (room_user_share)
410 414 getApp().globalData.room_user_share = room_user_share;
  415 +
  416 + if (share_openid) {
  417 + this.get_room_share_guide(share_openid);
  418 + }
411 419 }
412 420  
413 421 var c_guide_id = t.c_guide_id;
... ... @@ -506,64 +514,7 @@ Page({
506 514 }
507 515 });
508 516  
509   - //获取用户的默认门店
510   - getApp().get_user_store(function (e) {
511   - if (!e) {
512   - th.data.fir_def_store = {}; //赋值空对象
513   - return false;
514   - }
515   -
516   - if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
517   - var ee = JSON.parse(JSON.stringify(e));
518   - //--定时器推迟一下--
519   - setTimeout(function () {
520   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
521   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
522   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
523   - ee.is_no_dis = 1;
524   - }
525   -
526   - var appd = getApp().globalData;
527   - var w_time = setInterval(function () {
528   - if (that.data.is_get_local_ok == 0) return false;
529   - clearInterval(w_time);
530   - var distance = null;
531   - var e = JSON.parse(JSON.stringify(ee));
532   -
533   - //如果有开启近距离的话,同时距离优不一样了
534   - if (that.data.lat != null) {
535   - //如果经纬度有变化的话
536   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
537   - that.set_def_storage(e);
538   - } else {
539   - //要用接口是获取距离,js的计算不准
540   - getApp().request.promiseGet("/api/weshop/pickup/list", {
541   - data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
542   - }).then(res => {
543   - if (res.data.code == 0) {
544   - e = res.data.data.pageData[0];
545   - if (e) {
546   - e.is_no_dis = ee.is_no_dis;
547   - appd.pk_store = e;
548   - that.set_def_storage(e);
549   - }
550   -
551   - }
552   - })
553   - }
554   - //e.distance = distance;
555   - appd.lat = that.data.lat;
556   - appd.lon = that.data.lon;
557 517  
558   - } else {
559   - if (e) {
560   - e.distance = null;
561   - that.set_def_storage(e);
562   - }
563   - }
564   - }, 500)
565   - }, 700)
566   - });
567 518  
568 519 //更新点击量
569 520 //noinspection JSUnresolvedFunction
... ... @@ -585,6 +536,39 @@ Page({
585 536 }
586 537 },
587 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 +
588 572  
589 573 //--- 设置一下默认库存的数量 ----
590 574 set_def_storage(ee) {
... ... @@ -805,15 +789,6 @@ Page({
805 789 })
806 790  
807 791  
808   -
809   -
810   -
811   -
812   -
813   -
814   -
815   -
816   -
817 792 ee.setData({
818 793 gallery: gallery,
819 794 is_collect: is_collect,
... ... @@ -827,10 +802,99 @@ Page({
827 802  
828 803 },
829 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 +
830 894 //---展示---
831 895 onShow: async function () {
832 896  
833   - getApp().check_can_share();
  897 + getApp().check_can_share();
834 898 // console.log('onshow');
835 899 var goods_list = null, th = this, that = this;
836 900 var show_prew_img = this.data.show_prew_img
... ... @@ -839,6 +903,16 @@ Page({
839 903 return false;
840 904 }
841 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 +
842 916 // 判断活动是否暂停
843 917 //获取单个活动成团信息
844 918 await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {
... ... @@ -5473,6 +5547,16 @@ Page({
5473 5547  
5474 5548 // 选择门店
5475 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 +
5476 5560 var th = this;
5477 5561 var ind = ee.currentTarget.dataset.ind;
5478 5562 var bconfig = th.data.bconfig;
... ... @@ -6182,6 +6266,14 @@ Page({
6182 6266 getApp().pre_img(this.data.sele_g.original_img);
6183 6267 },
6184 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 +
6185 6277 is_show_more_buy: function () {
6186 6278 var prom_goods = this.data.prom_goods;
6187 6279 var per_price = this.data.sele_g.shop_price
... ...
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/goodsInfo/goodsInfo.js
... ... @@ -267,6 +267,9 @@ 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);
272 275 //群id
... ... @@ -332,6 +335,7 @@ Page({
332 335 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
333 336 if (res.data.code == 0) {
334 337 getApp().globalData.guide_id = res.data.data.id;
  338 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
335 339 }
336 340 })
337 341 }
... ... @@ -343,6 +347,11 @@ Page({
343 347 //如果是会员分享过来的要记录
344 348 if (room_user_share)
345 349 getApp().globalData.room_user_share = room_user_share;
  350 +
  351 + if (share_openid) {
  352 + this.get_room_share_guide(share_openid);
  353 + }
  354 +
346 355 }
347 356  
348 357 var c_guide_id = t.c_guide_id;
... ... @@ -443,6 +452,38 @@ Page({
443 452 })
444 453 },
445 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 +
446 487 //--- 设置一下默认库存的数量 ----
447 488 set_def_storage(ee) {
448 489 var that = this, th = this;
... ... @@ -627,6 +668,32 @@ Page({
627 668  
628 669 },
629 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 +
630 697 //---展示---
631 698 onShow: function () {
632 699 getApp().check_can_share();
... ... @@ -707,68 +774,70 @@ Page({
707 774 ee.data.sele_g_id = t.data.data.goods_id;
708 775 ee.data.sele_g = t.data.data;
709 776  
710   - //获取用户的默认门店
711   - getApp().get_user_store(function (e) {
712   - if (!e) {
713   - th.data.fir_def_store = {}; //赋值空对象
714   - return false;
715   - }
716   - 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})
717 786  
718   - var ee = JSON.parse(JSON.stringify(e));
  787 + var ee = JSON.parse(JSON.stringify(e));
719 788  
720   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
721   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
722   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
723   - ee.is_no_dis = 1;
724   - }
  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 + }
725 794  
726   - var appd = getApp().globalData;
727   - var w_time = setInterval(function () {
728   - if (that.data.is_get_local_ok == 0) return false;
729   - clearInterval(w_time);
730   - 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));
731 800  
732   - //如果有开启近距离的话,同时距离优不一样了
733   - if (that.data.lat != null) {
734   - //如果经纬度有变化的话
735   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
736   - 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);
737 806  
738   - } else {
739   - //要用接口是获取距离,js的计算不准
740   - getApp().request.promiseGet("/api/weshop/pickup/list", {
741   - data: {
742   - store_id: os.stoid,
743   - pickup_id: e.pickup_id,
744   - is_pos: 1,
745   - lat: th.data.lat,
746   - lon: th.data.lon
747   - },
748   - }).then(res => {
749   - if (res.data.code == 0) {
750   - e = res.data.data.pageData[0];
751   - if (e) {
752   - e.is_no_dis = ee.is_no_dis;
753   - appd.pk_store = e;
754   - that.set_def_storage(e);
755   - }
  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 + }
756 825  
757   - }
758   - })
759   - }
760   - appd.lat = that.data.lat;
761   - appd.lon = that.data.lon;
  826 + }
  827 + })
  828 + }
  829 + appd.lat = that.data.lat;
  830 + appd.lon = that.data.lon;
762 831  
763   - } else {
764   - if (e) {
765   - e.distance = null;
766   - that.set_def_storage(e);
  832 + } else {
  833 + if (e) {
  834 + e.distance = null;
  835 + that.set_def_storage(e);
  836 + }
767 837 }
768   - }
769   - }, 500)
770   - });
771   -
  838 + }, 500)
  839 + });
  840 + })
772 841  
773 842  
774 843 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
... ... @@ -3564,6 +3633,16 @@ Page({
3564 3633 },
3565 3634 // 选择门店
3566 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 +
3567 3646 var th = this;
3568 3647 var ind = ee.currentTarget.dataset.ind;
3569 3648 var bconfig = th.data.bconfig;
... ...
packageC/pages/presell/list/list.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 }
... ...
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
... ... @@ -1260,12 +1260,8 @@ Page({
1260 1260 et = 0;
1261 1261 break;
1262 1262 }
1263   -
1264   -
1265 1263 var m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
1266 1264  
1267   -
1268   -
1269 1265 if (et == 0 && def_exp_code && !th.data.is_default_logistics) {
1270 1266 for (var k = 0; k < th.data.wu_arr.length; k++) {
1271 1267 var item = th.data.wu_arr[k];
... ... @@ -1429,10 +1425,10 @@ Page({
1429 1425 if (gg.prom_type == 5) {
1430 1426 t.data.data.prom_id = gg.prom_id;
1431 1427 t.data.data.prom_type = 5;
1432   - th.is_coupon = gg.is_coupon;
1433   - th.setData({
1434   - is_coupon: gg.is_coupon
1435   - });
  1428 + // th.is_coupon = gg.is_coupon;
  1429 + // th.setData({
  1430 + // is_coupon: gg.is_coupon
  1431 + // });
1436 1432 if (gg.room_id) {
1437 1433 t.data.data.room_id = gg.room_id;
1438 1434 }
... ... @@ -5278,7 +5274,7 @@ Page({
5278 5274 continue;
5279 5275 }
5280 5276  
5281   - 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)){
5282 5278 continue;
5283 5279 }
5284 5280 //--如果是团购,要判断有没有限制使用优惠券
... ... @@ -5388,6 +5384,8 @@ Page({
5388 5384 arr[ind].ckeck_quan_price = ckeck_quan_price - (cut_price ? cut_price : 0);
5389 5385 arr[ind].check_quan_ware_list = check_quan_ware_list;
5390 5386 arr[ind].check_quan_price_list = check_quan_price_list;
  5387 + arr[ind].quan_list=null;
  5388 +
5391 5389 //-- 是否关闭使用优惠券,循环有找到商品 --
5392 5390 if (th.data.is_close_quan != 1 && check_quan_ware_list) {
5393 5391 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
... ... @@ -5407,8 +5405,13 @@ Page({
5407 5405 }
5408 5406 })
5409 5407 }
  5408 +
  5409 +
5410 5410 }
5411 5411  
  5412 +
  5413 +
  5414 +
5412 5415 //如果是搭配购的立即购买的时候
5413 5416 if (th.data.is_b_now) {
5414 5417 if (arr && arr.length > 0) {
... ... @@ -6519,6 +6522,9 @@ Page({
6519 6522 var th = this;
6520 6523 //--按钮变灰色 --
6521 6524 th.setData({ submit: 1 });
  6525 + var txt = 'using_quan[' + th.data.bn_pick + ']';
  6526 + th.setData({[txt]: null})
  6527 +
6522 6528 //如果是选中
6523 6529 if (e.selected) {
6524 6530 var item = this.data.all_collocation_list[e.index];
... ... @@ -6559,6 +6565,7 @@ Page({
6559 6565  
6560 6566 th.setData({is_coupon:item.is_coupon})
6561 6567  
  6568 +
6562 6569 var coll_arr = [];
6563 6570 if (this.data.collocation_goods && this.data.collocation_goods.length) {
6564 6571 coll_arr = this.data.collocation_goods;
... ... @@ -6597,11 +6604,16 @@ Page({
6597 6604 if (!coll_arr || coll_arr.length < 1) {
6598 6605 //让主商品的活动变成0,取消搭配购
6599 6606 this.setData({ 'bn_goods.prom_type': 0, 'bn_goods.prom_id': 0, collocation_goods: [] });
  6607 +
  6608 + th.setData({is_coupon:1})
  6609 +
6600 6610 //计算价格
6601 6611 th.calculatePrice2();
6602 6612 //获取优惠券
6603 6613 th.get_buy_now_quan();
6604 6614  
  6615 +
  6616 +
6605 6617 } else {
6606 6618 this.setData({ collocation_goods: coll_arr });
6607 6619 //要进行深拷贝
... ... @@ -6627,6 +6639,11 @@ Page({
6627 6639 var txt = 'cartlist[' + cart_index + '].goods';
6628 6640 var txt2 = 'cartlist[' + cart_index + '].collocationList[' + index + '].selected';
6629 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 +
6630 6647 //-- 如果是选中 --
6631 6648 if (e.selected) {
6632 6649  
... ... @@ -6766,6 +6783,17 @@ Page({
6766 6783 }
6767 6784  
6768 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;
6769 6797 }
6770 6798  
6771 6799  
... ...
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
... ... @@ -50,6 +50,7 @@ Page({
50 50 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
51 51 if (res.data.code == 0) {
52 52 getApp().globalData.guide_id = res.data.data.id;
  53 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
53 54 }
54 55 })
55 56 }
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -58,6 +58,7 @@ Page({
58 58 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
59 59 if (res.data.code == 0) {
60 60 getApp().globalData.guide_id = res.data.data.id;
  61 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
61 62 }
62 63 })
63 64 }
... ... @@ -249,7 +250,7 @@ Page({
249 250  
250 251 //---------分享配置--------
251 252 onShareAppMessage: function (e) {
252   - getApp().globalData.no_clear=1;
  253 + getApp().globalData.no_clear=1;
253 254 var curPage = this;
254 255 var pagePath = curPage.route; //当前页面url
255 256 if (pagePath.indexOf('/') != 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/goodsInfo/goodsInfo.js
... ... @@ -382,11 +382,14 @@ Page({
382 382 if (first_leader) {
383 383 console.log("gd onload--3");
384 384 console.log("log---" + first_leader);
  385 +
385 386 getApp().globalData.first_leader = first_leader;
386 387 //调用接口判断是不是会员
387 388 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
388 389 if (res.data.code == 0) {
389 390 getApp().globalData.guide_id = res.data.data.id;
  391 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  392 +
390 393 }
391 394 })
392 395  
... ... @@ -497,74 +500,6 @@ Page({
497 500 }
498 501 });
499 502  
500   - //获取用户的默认门店
501   - getApp().get_user_store(function (e) {
502   - if (!e) {
503   - th.data.fir_def_store = {}; //赋值空对象
504   - return false;
505   - }
506   - if (getApp().globalData.is_dj_pk) th.setData({
507   - has_def: 1
508   - });
509   -
510   - var ee = JSON.parse(JSON.stringify(e));
511   - //--定时器推迟一下--
512   - setTimeout(function () {
513   - if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
514   - //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
515   - if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
516   - ee.is_no_dis = 1;
517   - }
518   -
519   - var appd = getApp().globalData;
520   - var w_time = setInterval(function () {
521   - if (that.data.is_get_local_ok == 0) return false;
522   - clearInterval(w_time);
523   - var distance = null;
524   - var e = JSON.parse(JSON.stringify(ee));
525   -
526   - //如果有开启近距离的话,同时距离优不一样了
527   - if (that.data.lat != null) {
528   - //如果经纬度有变化的话
529   - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
530   - that.set_def_storage(e);
531   - } else {
532   - //要用接口是获取距离,js的计算不准
533   - getApp().request.promiseGet("/api/weshop/pickup/list", {
534   - data: {
535   - store_id: os.stoid,
536   - pickup_id: e.pickup_id,
537   - lat: th.data.lat,
538   - lon: th.data.lon,
539   - isstop: 0,
540   - is_pos: 1
541   - },
542   - }).then(res => {
543   - if (res.data.code == 0) {
544   - e = res.data.data.pageData[0];
545   - if (e) {
546   - e.is_no_dis = ee.is_no_dis;
547   - appd.pk_store = e;
548   - that.set_def_storage(e);
549   - }
550   -
551   - }
552   - })
553   - }
554   - //e.distance = distance;
555   - appd.lat = that.data.lat;
556   - appd.lon = that.data.lon;
557   -
558   - } else {
559   - if (e) {
560   - e.distance = null;
561   - that.set_def_storage(e);
562   - }
563   - }
564   - }, 500)
565   - }, 700)
566   - });
567   -
568 503 //更新点击量
569 504 //noinspection JSUnresolvedFunction
570 505 getApp().request.put("/api/weshop/goods/updateClick", {
... ... @@ -605,6 +540,7 @@ Page({
605 540 await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
606 541 if (res.data.code == 0) {
607 542 getApp().globalData.guide_id = res.data.data.id;
  543 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
608 544 }
609 545 })
610 546  
... ... @@ -862,6 +798,102 @@ Page({
862 798  
863 799 },
864 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 +
865 897 //---展示---
866 898 onShow: function () {
867 899  
... ... @@ -881,6 +913,11 @@ Page({
881 913 return false;
882 914 }
883 915  
  916 + //先获取一下导购的门店
  917 + th.check_guide(()=>{
  918 + th.get_user_store();
  919 + })
  920 +
884 921 //优惠券要实时更新
885 922 getApp().getConfig2(function (e) {
886 923 var json_d = JSON.parse(e.switch_list);
... ... @@ -1159,6 +1196,9 @@ Page({
1159 1196  
1160 1197  
1161 1198  
  1199 +
  1200 +
  1201 +
1162 1202 },
1163 1203  
1164 1204 onReady() {
... ... @@ -6612,6 +6652,15 @@ Page({
6612 6652 var ind = ee.currentTarget.dataset.ind;
6613 6653 var bconfig = th.data.bconfig;
6614 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 +
6615 6664  
6616 6665 //如果开启了,则不在选择门店
6617 6666 if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
... ...
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
... ... @@ -80,6 +80,7 @@ Page({
80 80 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
81 81 if (res.data.code == 0) {
82 82 getApp().globalData.guide_id = res.data.data.id;
  83 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
83 84 }
84 85 })
85 86 }
... ...
pages/index/index/index.js
... ... @@ -196,6 +196,7 @@ Page({
196 196 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
197 197 if (res.data.code == 0) {
198 198 getApp().globalData.guide_id = res.data.data.id;
  199 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
199 200 }
200 201 })
201 202  
... ... @@ -269,18 +270,17 @@ Page({
269 270 }).then(res => {
270 271 if (ut.ajax_ok(res)) {
271 272 first_leader=res.data.data.pageData[0].user_id;
272   - getApp().globalData.guide_id = res.data.data.id;
  273 + // getApp().globalData.guide_id = res.data.data.id;
273 274 }
274 275 })
275   -
276 276 if(!first_leader) return false;
277 277  
278 278 getApp().globalData.first_leader = first_leader;
279   -
280 279 //调用接口判断是不是会员
281 280 await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
282 281 if (res.data.code == 0) {
283 282 getApp().globalData.guide_id = res.data.data.id;
  283 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
284 284 }
285 285 })
286 286  
... ...
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 }
... ...