Commit 0a8ba5093d56f2bdd79584b694e9b1cce42a869e

Authored by yvan.ni
1 parent 65a855fb

分享的时候,要取导购的门店的优化

... ... @@ -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
... ... @@ -59,6 +59,7 @@ Page({
59 59 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
60 60 if(res.data.code==0){
61 61 getApp().globalData.guide_id=res.data.data.id;
  62 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
62 63 }
63 64 })
64 65 }
... ... @@ -85,91 +86,128 @@ Page({
85 86 }
86 87 });
87 88  
88   - //获取用户的默认门店
89   - getApp().get_user_store(function(ee) {
90   - if(!ee) {
91   - th.data.fir_def_store={}; //赋值空对象
92   - return false;
93   - }
94 89  
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;
  90 +
  91 + },
  92 +
  93 + //检测有没有导购分享的门店
  94 + check_guide(func){
  95 + var first_leader=getApp().globalData.first_leader;
  96 + if(!first_leader){
  97 + func();
  98 + return false;
  99 + }
  100 + if(this.data.is_geted_guide_pick){
  101 + func();
  102 + return false;
  103 + }
  104 +
  105 + if(getApp().globalData.guide_pick_id){
  106 + func();
  107 + return false;
  108 + }
  109 + var th=this;
  110 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  111 + if (res.data.code == 0) {
  112 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  113 + }
  114 + th.data.is_geted_guide_pick=1;
  115 + func();
  116 + })
  117 + },
  118 +
  119 + //---展示---
  120 + onShow: function() {
  121 +
  122 + getApp().check_can_share();
  123 + var ee=this,th=ee,that=ee;
  124 +
  125 + //先获取一下导购的门店
  126 + this.check_guide(()=> {
  127 + //获取用户的默认门店
  128 + getApp().get_user_store(function (ee) {
  129 + if (!ee) {
  130 + th.data.fir_def_store = {}; //赋值空对象
  131 + return false;
109 132 }
110 133  
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   - }
  134 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
139 135  
140   - }
141   - })
  136 + var appd = getApp().globalData;
  137 + var w_time = setInterval(function () {
  138 + if (that.data.is_get_local_ok == 0) return false;
  139 + if (!that.data.data) return false;
  140 + clearInterval(w_time);
  141 + var distance = null;
  142 + var e = JSON.parse(JSON.stringify(ee));
  143 +
  144 + if (th.data.data) var g_distr_type = th.data.data.distr_type;
  145 + e.is_no_dis = 0;
  146 + if (e.distr_type != 0 && g_distr_type != 0 && e.distr_type != g_distr_type) {
  147 + e.is_no_dis = 1;
142 148 }
143 149  
144   - //e.distance = distance;
145   - appd.lat=that.data.lat;
146   - appd.lon=that.data.lon;
  150 + //如果有开启近距离的话,同时距离优不一样了
  151 + if (that.data.lat != null) {
  152 + //如果经纬度有变化的话
  153 + if (appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  154 + that.data.fir_def_store = e;
  155 + that.setData({
  156 + def_pick_store: e,
  157 + sto_sele_name: e.pickup_name,
  158 + sto_sele_id: e.pickup_id,
  159 + sto_sele_distr: e.distr_type
  160 + })
  161 + } else {
  162 + //要用接口是获取距离,js的计算不准
  163 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  164 + data: {
  165 + store_id: os.stoid,
  166 + pickup_id: e.pickup_id,
  167 + lat: th.data.lat,
  168 + lon: th.data.lon,
  169 + is_pos: 1
  170 + },
  171 + }).then(res => {
  172 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) {
  173 + e = res.data.data.pageData[0];
  174 + if (e) {
  175 + appd.pk_store = e;
  176 + that.data.fir_def_store = e;
  177 + that.setData({
  178 + def_pick_store: e,
  179 + sto_sele_name: e.pickup_name,
  180 + sto_sele_id: e.pickup_id,
  181 + sto_sele_distr: e.distr_type
  182 + })
  183 + }
147 184  
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   - }
  185 + }
  186 + })
  187 + }
160 188  
161   - }, 500)
162   - });
163   -
164   - },
  189 + //e.distance = distance;
  190 + appd.lat = that.data.lat;
  191 + appd.lon = that.data.lon;
165 192  
166   - //---展示---
167   - onShow: function() {
  193 + } else {
  194 + if (e) {
  195 + e.distance = null;
  196 + that.data.fir_def_store = e;
  197 + that.setData({
  198 + def_pick_store: e,
  199 + sto_sele_name: e.pickup_name,
  200 + sto_sele_id: e.pickup_id,
  201 + sto_sele_distr: e.distr_type
  202 + })
  203 + }
  204 + }
168 205  
169   - getApp().check_can_share();
  206 + }, 500)
  207 + });
  208 + })
170 209  
171   - var ee=this,th=ee,that=ee;
172   - var gid = this.data.gid,i = getApp().request;
  210 + var gid = this.data.gid,i = getApp().request;
173 211 ee.data.g_buy_num = new Map();
174 212 this.wait_for_store_config();
175 213 clearTimeout(ot);
... ... @@ -1403,6 +1441,16 @@ Page({
1403 1441  
1404 1442 // 选择门店
1405 1443 choice_store: function(ee) {
  1444 +
  1445 + //--先判断会员状态--
  1446 + var user_info = getApp().globalData.userInfo;
  1447 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1448 + wx.navigateTo({
  1449 + url: '/packageE/pages/togoin/togoin',
  1450 + })
  1451 + return false;
  1452 + }
  1453 +
1406 1454 var th = this;
1407 1455 var ind=ee.currentTarget.dataset.ind;
1408 1456 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,19 @@ Page({
26 26 * 生命周期函数--监听页面加载
27 27 */
28 28 onLoad: function (options) {
29   - self = this;
  29 + self = this;
  30 + var first_leader = options.first_leader;
  31 +
  32 + if (first_leader) {
  33 + getApp().globalData.first_leader = first_leader;
  34 + //调用接口判断是不是会员
  35 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  36 + if (res.data.code == 0) {
  37 + getApp().globalData.guide_id = res.data.data.id;
  38 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  39 + }
  40 + })
  41 + }
30 42  
31 43 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
32 44 self.setData({
... ... @@ -153,7 +165,29 @@ Page({
153 165 /**
154 166 * 用户点击右上角分享
155 167 */
156   - onShareAppMessage: function () { getApp().globalData.no_clear=1; },
  168 + onShareAppMessage: function () {
  169 + getApp().globalData.no_clear=1;
  170 + var curPage = this;
  171 + var pagePath = curPage.route; //当前页面url
  172 + if (pagePath.indexOf('/') != 0) {
  173 + pagePath = '/' + pagePath;
  174 + }
  175 + if (getApp().globalData.user_id) {
  176 +
  177 + if (pagePath.indexOf("?") > 0) {
  178 + pagePath += "&first_leader=" + getApp().globalData.user_id;
  179 + } else {
  180 + pagePath += "?first_leader=" + getApp().globalData.user_id;
  181 + }
  182 + }
  183 +
  184 + console.log("11" + pagePath);
  185 + return {
  186 + title: "团购",
  187 + path: pagePath,
  188 + }
  189 +
  190 + },
157 191  
158 192  
159 193 /**
... ...
packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
... ... @@ -20,11 +20,12 @@ Page({
20 20 if(first_leader) {
21 21 app.globalData.first_leader = first_leader;
22 22 //调用接口判断是不是会员
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   - // })
  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 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  27 + }
  28 + })
28 29 };
29 30  
30 31 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 //------初始化加载----------
... ... @@ -305,6 +306,8 @@ Page({
305 306 prom_type = t.prom_type,
306 307 prom_id = t.group_id; //活动ID
307 308  
  309 + var share_openid = t.share_openid;
  310 +
308 311 if (prom_type) {
309 312 // this.data.prom_type = prom_type;
310 313 // this.data.prom_id = prom_id;
... ... @@ -393,6 +396,7 @@ Page({
393 396 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
394 397 if (res.data.code == 0) {
395 398 getApp().globalData.guide_id = res.data.data.id;
  399 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
396 400 }
397 401 })
398 402 }
... ... @@ -404,6 +408,10 @@ Page({
404 408 //如果是会员分享过来的要记录
405 409 if (room_user_share)
406 410 getApp().globalData.room_user_share = room_user_share;
  411 +
  412 + if (share_openid) {
  413 + this.get_room_share_guide(share_openid);
  414 + }
407 415 }
408 416  
409 417 var c_guide_id = t.c_guide_id;
... ... @@ -502,64 +510,7 @@ Page({
502 510 }
503 511 });
504 512  
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 513  
554   - } else {
555   - if (e) {
556   - e.distance = null;
557   - that.set_def_storage(e);
558   - }
559   - }
560   - }, 500)
561   - }, 700)
562   - });
563 514  
564 515 //更新点击量
565 516 //noinspection JSUnresolvedFunction
... ... @@ -581,6 +532,39 @@ Page({
581 532 }
582 533 },
583 534  
  535 + //-- 获取直播的分享人的导购信息 --
  536 + async get_room_share_guide(share_openid) {
  537 +
  538 + var url = "/api/weshop/users/page";
  539 + var first_leader = 0;
  540 +
  541 + //调用接口判断是不是会员
  542 + await getApp().request.promiseGet(url, {
  543 + data: {
  544 + stoid: os.stoid,
  545 + weapp_openid: share_openid
  546 + }
  547 + }).then(res => {
  548 + if (ut.ajax_ok(res)) {
  549 + first_leader = res.data.data.pageData[0].user_id;
  550 + getApp().globalData.guide_id = res.data.data.id;
  551 + }
  552 + })
  553 +
  554 + if (!first_leader) return false;
  555 +
  556 + getApp().globalData.first_leader = first_leader;
  557 +
  558 + //调用接口判断是不是会员
  559 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  560 + if (res.data.code == 0) {
  561 + getApp().globalData.guide_id = res.data.data.id;
  562 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  563 + }
  564 + })
  565 +
  566 + },
  567 +
584 568  
585 569 //--- 设置一下默认库存的数量 ----
586 570 set_def_storage(ee) {
... ... @@ -801,15 +785,6 @@ Page({
801 785 })
802 786  
803 787  
804   -
805   -
806   -
807   -
808   -
809   -
810   -
811   -
812   -
813 788 ee.setData({
814 789 gallery: gallery,
815 790 is_collect: is_collect,
... ... @@ -823,10 +798,99 @@ Page({
823 798  
824 799 },
825 800  
  801 + //检测有没有导购分享的门店
  802 + check_guide(func){
  803 + var first_leader=getApp().globalData.first_leader;
  804 + if(!first_leader){
  805 + func();
  806 + return false;
  807 + }
  808 + if(this.data.is_geted_guide_pick){
  809 + func();
  810 + return false;
  811 + }
  812 +
  813 + if(getApp().globalData.guide_pick_id){
  814 + func();
  815 + return false;
  816 + }
  817 + var th=this;
  818 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  819 + if (res.data.code == 0) {
  820 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  821 + }
  822 + th.data.is_geted_guide_pick=1;
  823 + func();
  824 + })
  825 + },
  826 +
  827 +
  828 + get_user_sto(){
  829 + var th=this;var that=this;
  830 + //获取用户的默认门店
  831 + getApp().get_user_store(function (e) {
  832 + if (!e) {
  833 + th.data.fir_def_store = {}; //赋值空对象
  834 + return false;
  835 + }
  836 +
  837 + if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
  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: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
  863 + }).then(res => {
  864 + if (res.data.code == 0) {
  865 + e = res.data.data.pageData[0];
  866 + if (e) {
  867 + e.is_no_dis = ee.is_no_dis;
  868 + appd.pk_store = e;
  869 + that.set_def_storage(e);
  870 + }
  871 +
  872 + }
  873 + })
  874 + }
  875 + //e.distance = distance;
  876 + appd.lat = that.data.lat;
  877 + appd.lon = that.data.lon;
  878 +
  879 + } else {
  880 + if (e) {
  881 + e.distance = null;
  882 + that.set_def_storage(e);
  883 + }
  884 + }
  885 + }, 500)
  886 + }, 700)
  887 + });
  888 + },
  889 +
826 890 //---展示---
827 891 onShow: async function () {
828 892  
829   - getApp().check_can_share();
  893 + getApp().check_can_share();
830 894 // console.log('onshow');
831 895 var goods_list = null, th = this, that = this;
832 896 var show_prew_img = this.data.show_prew_img
... ... @@ -835,6 +899,16 @@ Page({
835 899 return false;
836 900 }
837 901  
  902 + if (this.data.show_video) {
  903 + this.data.show_video = 0;
  904 + return false;
  905 + }
  906 +
  907 + //先获取一下导购的门店
  908 + th.check_guide(()=> {
  909 + th.get_user_sto();
  910 + })
  911 +
838 912 // 判断活动是否暂停
839 913 //获取单个活动成团信息
840 914 await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {
... ... @@ -5464,6 +5538,16 @@ Page({
5464 5538  
5465 5539 // 选择门店
5466 5540 choice_store: function (ee) {
  5541 +
  5542 + //--先判断会员状态--
  5543 + var user_info = getApp().globalData.userInfo;
  5544 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  5545 + wx.navigateTo({
  5546 + url: '/packageE/pages/togoin/togoin',
  5547 + })
  5548 + return false;
  5549 + }
  5550 +
5467 5551 var th = this;
5468 5552 var ind = ee.currentTarget.dataset.ind;
5469 5553 var bconfig = th.data.bconfig;
... ... @@ -6173,6 +6257,14 @@ Page({
6173 6257 getApp().pre_img(this.data.sele_g.original_img);
6174 6258 },
6175 6259  
  6260 + screenChange: function (e) {
  6261 + let fullScreen = e.detail.fullScreen //值true为进入全屏,false为退出全屏
  6262 + if (fullScreen) { //退出全屏
  6263 + getApp().globalData.no_clear = 1;
  6264 + this.data.show_video = 1;
  6265 + }
  6266 + },
  6267 +
6176 6268 is_show_more_buy: function () {
6177 6269 var prom_goods = this.data.prom_goods;
6178 6270 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  
... ... @@ -327,6 +330,7 @@ Page({
327 330 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
328 331 if (res.data.code == 0) {
329 332 getApp().globalData.guide_id = res.data.data.id;
  333 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
330 334 }
331 335 })
332 336 }
... ... @@ -338,6 +342,11 @@ Page({
338 342 //如果是会员分享过来的要记录
339 343 if (room_user_share)
340 344 getApp().globalData.room_user_share = room_user_share;
  345 +
  346 + if (share_openid) {
  347 + this.get_room_share_guide(share_openid);
  348 + }
  349 +
341 350 }
342 351  
343 352 var c_guide_id = t.c_guide_id;
... ... @@ -438,6 +447,38 @@ Page({
438 447 })
439 448 },
440 449  
  450 + async get_room_share_guide(share_openid) {
  451 +
  452 + var url = "/api/weshop/users/page";
  453 + var first_leader = 0;
  454 +
  455 + //调用接口判断是不是会员
  456 + await getApp().request.promiseGet(url, {
  457 + data: {
  458 + stoid: os.stoid,
  459 + weapp_openid: share_openid
  460 + }
  461 + }).then(res => {
  462 + if (ut.ajax_ok(res)) {
  463 + first_leader = res.data.data.pageData[0].user_id;
  464 + getApp().globalData.guide_id = res.data.data.id;
  465 + }
  466 + })
  467 +
  468 + if (!first_leader) return false;
  469 +
  470 + getApp().globalData.first_leader = first_leader;
  471 +
  472 + //调用接口判断是不是会员
  473 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  474 + if (res.data.code == 0) {
  475 + getApp().globalData.guide_id = res.data.data.id;
  476 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  477 + }
  478 + })
  479 +
  480 + },
  481 +
441 482 //--- 设置一下默认库存的数量 ----
442 483 set_def_storage(ee) {
443 484 var that = this, th = this;
... ... @@ -622,6 +663,32 @@ Page({
622 663  
623 664 },
624 665  
  666 + //检验导购门店
  667 + check_guide(func){
  668 + var first_leader=getApp().globalData.first_leader;
  669 + if(!first_leader){
  670 + func();
  671 + return false;
  672 + }
  673 + if(this.data.is_geted_guide_pick){
  674 + func();
  675 + return false;
  676 + }
  677 +
  678 + if(getApp().globalData.guide_pick_id){
  679 + func();
  680 + return false;
  681 + }
  682 + var th=this;
  683 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  684 + if (res.data.code == 0) {
  685 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  686 + }
  687 + th.data.is_geted_guide_pick=1;
  688 + func();
  689 + })
  690 + },
  691 +
625 692 //---展示---
626 693 onShow: function () {
627 694 getApp().check_can_share();
... ... @@ -702,68 +769,70 @@ Page({
702 769 ee.data.sele_g_id = t.data.data.goods_id;
703 770 ee.data.sele_g = t.data.data;
704 771  
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 })
  772 + //检测一下分享导购的门店
  773 + ee.check_guide(() => {
  774 + //获取用户的默认门店
  775 + getApp().get_user_store(function (e) {
  776 + if (!e) {
  777 + th.data.fir_def_store = {}; //赋值空对象
  778 + return false;
  779 + }
  780 + if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
712 781  
713   - var ee = JSON.parse(JSON.stringify(e));
  782 + var ee = JSON.parse(JSON.stringify(e));
714 783  
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   - }
  784 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  785 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  786 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  787 + ee.is_no_dis = 1;
  788 + }
720 789  
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));
  790 + var appd = getApp().globalData;
  791 + var w_time = setInterval(function () {
  792 + if (that.data.is_get_local_ok == 0) return false;
  793 + clearInterval(w_time);
  794 + var e = JSON.parse(JSON.stringify(ee));
726 795  
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);
  796 + //如果有开启近距离的话,同时距离优不一样了
  797 + if (that.data.lat != null) {
  798 + //如果经纬度有变化的话
  799 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  800 + that.set_def_storage(e);
732 801  
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   - }
  802 + } else {
  803 + //要用接口是获取距离,js的计算不准
  804 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  805 + data: {
  806 + store_id: os.stoid,
  807 + pickup_id: e.pickup_id,
  808 + is_pos: 1,
  809 + lat: th.data.lat,
  810 + lon: th.data.lon
  811 + },
  812 + }).then(res => {
  813 + if (res.data.code == 0) {
  814 + e = res.data.data.pageData[0];
  815 + if (e) {
  816 + e.is_no_dis = ee.is_no_dis;
  817 + appd.pk_store = e;
  818 + that.set_def_storage(e);
  819 + }
751 820  
752   - }
753   - })
754   - }
755   - appd.lat = that.data.lat;
756   - appd.lon = that.data.lon;
  821 + }
  822 + })
  823 + }
  824 + appd.lat = that.data.lat;
  825 + appd.lon = that.data.lon;
757 826  
758   - } else {
759   - if (e) {
760   - e.distance = null;
761   - that.set_def_storage(e);
  827 + } else {
  828 + if (e) {
  829 + e.distance = null;
  830 + that.set_def_storage(e);
  831 + }
762 832 }
763   - }
764   - }, 500)
765   - });
766   -
  833 + }, 500)
  834 + });
  835 + })
767 836  
768 837  
769 838 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
... ... @@ -3554,6 +3623,16 @@ Page({
3554 3623 },
3555 3624 // 选择门店
3556 3625 choice_store: function (ee) {
  3626 +
  3627 + //--先判断会员状态--
  3628 + var user_info = getApp().globalData.userInfo;
  3629 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3630 + wx.navigateTo({
  3631 + url: '/packageE/pages/togoin/togoin',
  3632 + })
  3633 + return false;
  3634 + }
  3635 +
3557 3636 var th = this;
3558 3637 var ind = ee.currentTarget.dataset.ind;
3559 3638 var bconfig = th.data.bconfig;
... ...
packageC/pages/presell/list/list.js
... ... @@ -27,6 +27,7 @@ Page({
27 27 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
28 28 if (res.data.code == 0) {
29 29 getApp().globalData.guide_id = res.data.data.id;
  30 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
30 31 }
31 32 })
32 33 }
... ...
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/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
... ... @@ -46,6 +46,7 @@ Page({
46 46 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.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 }
... ...
pages/activity/seckill_list/seckill_list.js
... ... @@ -54,6 +54,7 @@ Page({
54 54 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
55 55 if (res.data.code == 0) {
56 56 getApp().globalData.guide_id = res.data.data.id;
  57 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
57 58 }
58 59 })
59 60 }
... ... @@ -245,7 +246,7 @@ Page({
245 246  
246 247 //---------分享配置--------
247 248 onShareAppMessage: function (e) {
248   - getApp().globalData.no_clear=1;
  249 + getApp().globalData.no_clear=1;
249 250 var curPage = this;
250 251 var pagePath = curPage.route; //当前页面url
251 252 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
... ... @@ -377,11 +377,14 @@ Page({
377 377 if (first_leader) {
378 378 console.log("gd onload--3");
379 379 console.log("log---" + first_leader);
  380 +
380 381 getApp().globalData.first_leader = first_leader;
381 382 //调用接口判断是不是会员
382 383 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
383 384 if (res.data.code == 0) {
384 385 getApp().globalData.guide_id = res.data.data.id;
  386 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  387 +
385 388 }
386 389 })
387 390  
... ... @@ -492,74 +495,6 @@ Page({
492 495 }
493 496 });
494 497  
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 498 //更新点击量
564 499 //noinspection JSUnresolvedFunction
565 500 getApp().request.put("/api/weshop/goods/updateClick", {
... ... @@ -600,6 +535,7 @@ Page({
600 535 await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
601 536 if (res.data.code == 0) {
602 537 getApp().globalData.guide_id = res.data.data.id;
  538 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
603 539 }
604 540 })
605 541  
... ... @@ -857,6 +793,102 @@ Page({
857 793  
858 794 },
859 795  
  796 + check_guide(func){
  797 + var first_leader=getApp().globalData.first_leader;
  798 + if(!first_leader){
  799 + func();
  800 + return false;
  801 + }
  802 + if(this.data.is_geted_guide_pick){
  803 + func();
  804 + return false;
  805 + }
  806 +
  807 + if(getApp().globalData.guide_pick_id){
  808 + func();
  809 + return false;
  810 + }
  811 + var th=this;
  812 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  813 + if (res.data.code == 0) {
  814 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  815 + }
  816 + th.data.is_geted_guide_pick=1;
  817 + func();
  818 + })
  819 + },
  820 +
  821 + get_user_store(){
  822 + var th=this; var that=this;
  823 + //--获取用户的默认门店
  824 + getApp().get_user_store(function (e) {
  825 + if (!e) {
  826 + th.data.fir_def_store = {}; //赋值空对象
  827 + return false;
  828 + }
  829 + if (getApp().globalData.is_dj_pk) th.setData({
  830 + has_def: 1
  831 + });
  832 +
  833 + var ee = JSON.parse(JSON.stringify(e));
  834 + //--定时器推迟一下--
  835 + setTimeout(function () {
  836 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
  837 + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
  838 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
  839 + ee.is_no_dis = 1;
  840 + }
  841 +
  842 + var appd = getApp().globalData;
  843 + var w_time = setInterval(function () {
  844 + if (that.data.is_get_local_ok == 0) return false;
  845 + clearInterval(w_time);
  846 + var distance = null;
  847 + var e = JSON.parse(JSON.stringify(ee));
  848 +
  849 + //如果有开启近距离的话,同时距离优不一样了
  850 + if (that.data.lat != null) {
  851 + //如果经纬度有变化的话
  852 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  853 + that.set_def_storage(e);
  854 + } else {
  855 + //要用接口是获取距离,js的计算不准
  856 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  857 + data: {
  858 + store_id: os.stoid,
  859 + pickup_id: e.pickup_id,
  860 + lat: th.data.lat,
  861 + lon: th.data.lon,
  862 + isstop: 0,
  863 + is_pos: 1
  864 + },
  865 + }).then(res => {
  866 + if (res.data.code == 0) {
  867 + e = res.data.data.pageData[0];
  868 + if (e) {
  869 + e.is_no_dis = ee.is_no_dis;
  870 + appd.pk_store = e;
  871 + that.set_def_storage(e);
  872 + }
  873 +
  874 + }
  875 + })
  876 + }
  877 + //e.distance = distance;
  878 + appd.lat = that.data.lat;
  879 + appd.lon = that.data.lon;
  880 +
  881 + } else {
  882 + if (e) {
  883 + e.distance = null;
  884 + that.set_def_storage(e);
  885 + }
  886 + }
  887 + }, 500)
  888 + }, 700)
  889 + });
  890 + },
  891 +
860 892 //---展示---
861 893 onShow: function () {
862 894  
... ... @@ -876,6 +908,11 @@ Page({
876 908 return false;
877 909 }
878 910  
  911 + //先获取一下导购的门店
  912 + th.check_guide(()=>{
  913 + th.get_user_store();
  914 + })
  915 +
879 916 //优惠券要实时更新
880 917 getApp().getConfig2(function (e) {
881 918 var json_d = JSON.parse(e.switch_list);
... ... @@ -1154,6 +1191,9 @@ Page({
1154 1191  
1155 1192  
1156 1193  
  1194 +
  1195 +
  1196 +
1157 1197 },
1158 1198  
1159 1199 onReady() {
... ... @@ -6602,6 +6642,15 @@ Page({
6602 6642 var ind = ee.currentTarget.dataset.ind;
6603 6643 var bconfig = th.data.bconfig;
6604 6644  
  6645 + //--先判断会员状态--
  6646 + var user_info = getApp().globalData.userInfo;
  6647 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  6648 + wx.navigateTo({
  6649 + url: '/packageE/pages/togoin/togoin',
  6650 + })
  6651 + return false;
  6652 + }
  6653 +
6605 6654  
6606 6655 //如果开启了,则不在选择门店
6607 6656 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
... ... @@ -77,6 +77,7 @@ Page({
77 77 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
78 78 if (res.data.code == 0) {
79 79 getApp().globalData.guide_id = res.data.data.id;
  80 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
80 81 }
81 82 })
82 83 }
... ...
pages/index/index/index.js
... ... @@ -190,6 +190,7 @@ Page({
190 190 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
191 191 if (res.data.code == 0) {
192 192 getApp().globalData.guide_id = res.data.data.id;
  193 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
193 194 }
194 195 })
195 196  
... ... @@ -263,18 +264,17 @@ Page({
263 264 }).then(res => {
264 265 if (ut.ajax_ok(res)) {
265 266 first_leader=res.data.data.pageData[0].user_id;
266   - getApp().globalData.guide_id = res.data.data.id;
  267 + // getApp().globalData.guide_id = res.data.data.id;
267 268 }
268 269 })
269   -
270 270 if(!first_leader) return false;
271 271  
272 272 getApp().globalData.first_leader = first_leader;
273   -
274 273 //调用接口判断是不是会员
275 274 await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
276 275 if (res.data.code == 0) {
277 276 getApp().globalData.guide_id = res.data.data.id;
  277 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
278 278 }
279 279 })
280 280  
... ...
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 }
... ...