Commit 2b68539ef6dd042fafca8d759bd21f7313db9cb5

Authored by WXD-SEASON\season
2 parents d4183772 9485d24b

Merge branch 'dev_oaandjf' into dev

Showing 48 changed files with 3049 additions and 689 deletions
... ... @@ -51,7 +51,7 @@ App({
51 51 config: null, //门店参数
52 52 config2: null, //门店配置
53 53 code: null,
54   - user_id:null,//10153869,//6520352,// 10153869,// 6520352,// qa-6519858,//
  54 + user_id:null,//6520390,//6520352
55 55 // user_id:6520314,// qa-6519858,//
56 56 // user_id:14148118,// qa-6519858,//
57 57 buy_now: null,
... ... @@ -511,47 +511,60 @@ App({
511 511 get_user_store: function (func) {
512 512 var th = this;
513 513 this.getConfig2(function (conf) {
  514 +
  515 + var is_pricing_open_store=0;
  516 + var is_regstores=0;
  517 + var is_guide_storage=0;
  518 + if (conf.switch_list) {
  519 + var t_swi = JSON.parse(conf.switch_list);
  520 + //--购买门店是否默认登记门店--
  521 + is_regstores=t_swi.is_regstores;
  522 + is_pricing_open_store=t_swi.is_pricing_open_store;
  523 + is_guide_storage=t_swi.is_guide_storage;
  524 + }
  525 +
514 526 //---空会员的情况---
515 527 if (!th.globalData.userInfo) {
516   - return func(null);
  528 + //没有导购门店 和 没有开启默认导购
  529 + if(!th.globalData.guide_pick_id || !is_guide_storage) {
  530 + return func(null);
  531 + }
517 532 }
518 533 if (!th.globalData.pk_store) {
519 534 var pick_id = 0;
520 535  
521   - var is_pricing_open_store=0;
522   - var is_regstores=0;
523   - if (conf.switch_list) {
524   - var t_swi = JSON.parse(conf.switch_list);
525   - //--购买门店是否默认登记门店--
526   - is_regstores=t_swi.is_regstores;
527   - is_pricing_open_store=t_swi.is_pricing_open_store;
528   - }
  536 + //-- 如果有导购的时候,后台有默认门店只能是导购的门店的时候 --
  537 + if(th.globalData.guide_pick_id && is_guide_storage){
  538 + pick_id = th.globalData.guide_pick_id
  539 + }else {
529 540  
530   - //-- 如果是区域价格提现,现在注册门店是默认 --
531   - if(is_pricing_open_store){
  541 + //-- 如果是区域价格提现,现在注册门店是默认 --
  542 + if (is_pricing_open_store) {
532 543  
533   - //查找会员的注册的地址
534   - if (th.globalData.userInfo.pickup_id) {
535   - pick_id = th.globalData.userInfo.pickup_id;
536   - th.globalData.is_dj_pk=1;
537   - }
538   - //先找一个会员是否有设置默认的地址
539   - else if (th.globalData.userInfo.def_pickup_id) {
540   - pick_id = th.globalData.userInfo.def_pickup_id
541   - }
  544 + //查找会员的注册的地址
  545 + if (th.globalData.userInfo.pickup_id) {
  546 + pick_id = th.globalData.userInfo.pickup_id;
  547 + th.globalData.is_dj_pk = 1;
  548 + }
  549 + //先找一个会员是否有设置默认的地址
  550 + else if (th.globalData.userInfo.def_pickup_id) {
  551 + pick_id = th.globalData.userInfo.def_pickup_id
  552 + }
542 553  
543   - }else{
544   - //先找一个会员是否有设置默认的地址
545   - if (th.globalData.userInfo.def_pickup_id) {
546   - pick_id = th.globalData.userInfo.def_pickup_id
547   - }
548   - //查找会员的注册的地址
549   - else if (th.globalData.userInfo.pickup_id && is_regstores) {
550   - pick_id = th.globalData.userInfo.pickup_id
  554 + } else {
  555 + //先找一个会员是否有设置默认的地址
  556 + if (th.globalData.userInfo.def_pickup_id) {
  557 + pick_id = th.globalData.userInfo.def_pickup_id
  558 + }
  559 + //查找会员的注册的地址
  560 + else if (th.globalData.userInfo.pickup_id && is_regstores) {
  561 + pick_id = th.globalData.userInfo.pickup_id
  562 + }
551 563 }
552 564 }
553 565  
554 566  
  567 +
555 568 //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
556 569 if (pick_id == 0) return func(null);
557 570  
... ... @@ -704,6 +717,7 @@ App({
704 717 }
705 718 },
706 719  
  720 +
707 721 //清空登录时候缓存的值
708 722 onHide: function () {
709 723 var th = this;
... ... @@ -725,6 +739,7 @@ App({
725 739 th.globalData.dis_buy_obj = null; //等级卡的购买记录
726 740 th.globalData.storeFooter = null; //底部的导航
727 741 th.globalData.full_screen = null; //全屏
  742 + th.globalData.guide_pick_id = null; //分享导购门店的优化
728 743 } else {
729 744 th.globalData.no_clear = 0;
730 745 }
... ...
app.json
... ... @@ -53,7 +53,7 @@
53 53 "pages/giftpack/payment/payment",
54 54 "pages/giftpack/buygiftpack/giftpackbuy",
55 55 "pages/giftpack/giftpacklist/giftpacklist",
56   - "pages/giftpack/giftpacklistshop/giftpacklistshop",
  56 +
57 57 "pages/giftpack/mygiftpack/mygiftpack",
58 58 "pages/user/assistance/giftpacklist",
59 59 "pages/user/assistance/task_assistance",
... ... @@ -217,6 +217,7 @@
217 217 "pages/user/slimming/slimming",
218 218 "pages/user/punchInhistory/punchInhistory",
219 219 "pages/user/grow_value/grow_value",
  220 + "pages/giftpack/giftpacklistshop/giftpacklistshop",
220 221 "pages/user/labels/labels",
221 222 "pages/cart/cart2/cart2",
222 223 "pages/barCodeBank/barCodeBank",
... ...
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/distribution/shop/shop.js
... ... @@ -55,6 +55,15 @@ Page({
55 55 getApp().globalData.first_leader = first_leader;
56 56 this.data.first_leader = first_leader;
57 57  
  58 + //调用接口判断是不是会员
  59 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  60 + if (res.data.code == 0) {
  61 + getApp().globalData.guide_id = res.data.data.id;
  62 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  63 + }
  64 + })
  65 +
  66 +
58 67 getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + first_leader, {
59 68 isShowLoading: false,
60 69 data: { r: Math.random() },
... ...
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
... ... @@ -32,6 +32,19 @@ Page({
32 32 if(options && options.groupchat_id){
33 33 getApp().globalData.groupchat_id=options.groupchat_id
34 34 }
  35 + var first_leader = options.first_leader;
  36 +
  37 + if (first_leader) {
  38 + getApp().globalData.first_leader = first_leader;
  39 + //调用接口判断是不是会员
  40 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  41 + if (res.data.code == 0) {
  42 + getApp().globalData.guide_id = res.data.data.id;
  43 + getApp().globalData.guide_pick_id= res.data.data.pickup_id
  44 + }
  45 + })
  46 + }
  47 +
35 48  
36 49 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
37 50 self.setData({
... ... @@ -158,7 +171,6 @@ Page({
158 171 /**
159 172 * 用户点击右上角分享
160 173 */
161   -
162 174 onShareAppMessage: function () {
163 175 getApp().globalData.no_clear=1;
164 176 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
... ... @@ -196,7 +208,6 @@ Page({
196 208 },
197 209  
198 210  
199   -
200 211  
201 212  
202 213 /**
... ...
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_cart_ct/luckyGo_cart_ct.js
... ... @@ -241,7 +241,7 @@ Page({
241 241 // let cartList= this.data.cartlist
242 242 // let cartList= arr
243 243 // let length = cartList.length
244   - if(this.data.is_pre_cut==0){
  244 + if(!this.data.is_pre_cut){
245 245 return {}
246 246 }
247 247 wx.showLoading({
... ...
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/cart/cart2_pre.js
... ... @@ -371,7 +371,7 @@ Page({
371 371 // let cartList= this.data.cartlist
372 372 // let cartList= arr
373 373 // let length = cartList.length
374   - if(this.data.is_pre_cut==0){
  374 + if(!this.data.is_pre_cut){
375 375 return {}
376 376 }
377 377 wx.showLoading({
... ...
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
... ... @@ -363,7 +363,7 @@ Page({
363 363 this.setData({ [txt]: 2 })
364 364 }
365 365 //搭配购直接购买特殊处理
366   - if(this.data.collocation_goods && this.data.cartlist){
  366 + if(this.data.collocation_goods && this.data.collocation_goods.length>0 && this.data.cartlist){
367 367 let txt = 'cartlist[0].yck_off';
368 368 let txt1 = 'old_cartlist[0].yck_off';
369 369 if (this.data.cartlist[0].yck_off == 2) {
... ... @@ -382,7 +382,7 @@ Page({
382 382 // let cartList= this.data.cartlist
383 383 // let cartList= arr
384 384 // let length = cartList.length
385   - if(this.data.is_pre_cut==0){
  385 + if(!this.data.is_pre_cut){
386 386 return {}
387 387 }
388 388 wx.showLoading({
... ... @@ -2644,9 +2644,13 @@ Page({
2644 2644 }
2645 2645 let cart_yc = await th.beforAdvancesum(cart_item)
2646 2646  
  2647 + console.log('购物车--------');
2647 2648 if (!cart_item.yck_off) {
2648 2649 cart_item.yck_off = cart_yc.yck_off
2649 2650 }
  2651 + if(cart_yc.yck*1==0){
  2652 + cart_item.yck_off = 0
  2653 + }
2650 2654 cart_item.yck = cart_yc.yck
2651 2655 cart_item.yckid = cart_yc.yckid
2652 2656 cart_item.pre_json = cart_yc.pre_json
... ... @@ -2874,8 +2878,9 @@ Page({
2874 2878  
2875 2879 if (!good) return false;
2876 2880  
2877   - //搭配的计算要用购物的车计算方法
  2881 + //搭配的计算要用购物的车计算方法
2878 2882 // if (good.prom_type == 5 ) {
  2883 +
2879 2884 if (good.prom_type == 5 ) {
2880 2885 if( th.data.old_cartlist && th.data.old_cartlist.length > 0){
2881 2886 th.calculatePrice();
... ... @@ -3221,7 +3226,7 @@ Page({
3221 3226 } else {
3222 3227 th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
3223 3228 }
3224   -
  3229 +
3225 3230 //预存金额使用参与计算
3226 3231 if (th.data.udata && th.data.udata.Balance > 0 && order_m * 1 > 0) {
3227 3232 if (!th.data.bn_goods.keyid) {
... ... @@ -3249,6 +3254,7 @@ Page({
3249 3254 }
3250 3255  
3251 3256 if (th.data.bn_goods.keyid) {
  3257 +
3252 3258 let cart_yc = await th.beforAdvancesum({
3253 3259 order_amount: order_m,
3254 3260 goods: [{
... ... @@ -3260,10 +3266,13 @@ Page({
3260 3266 keyid: th.data.bn_goods.keyid
3261 3267 }
3262 3268 })
3263   -
  3269 +
3264 3270 if (!good.yck_off) {
3265 3271 good.yck_off = cart_yc.yck_off
3266 3272 }
  3273 + if(cart_yc.yck*1==0){
  3274 + good.yck_off = 0
  3275 + }
3267 3276 good.yck = cart_yc.yck
3268 3277 good.yckid = cart_yc.yckid
3269 3278 good.pre_json = cart_yc.pre_json
... ... @@ -5284,9 +5293,14 @@ Page({
5284 5293 continue;
5285 5294 }
5286 5295  
5287   - if(gd.prom_type==5 && !th.data.coll_prom[gd.prom_id].is_coupon && th.has_dp(goodlist,gd.prom_id)){
5288   - continue;
  5296 + //有搭配购的时候才来判断
  5297 + if(gd.prom_type==5 && th.data.coll_prom && th.data.coll_prom[gd.prom_id]){
  5298 + if(!th.data.coll_prom[gd.prom_id].is_coupon && th.has_dp(goodlist,gd.prom_id)){
  5299 + continue;
  5300 + }
5289 5301 }
  5302 +
  5303 +
5290 5304 //--如果是团购,要判断有没有限制使用优惠券
5291 5305 if (gd.prom_type == 2) {
5292 5306 var prom1 = null;
... ... @@ -6519,6 +6533,7 @@ Page({
6519 6533 select_coll(e) {
6520 6534 console.log("--1111--aaa--");
6521 6535 console.log(e);
  6536 +
6522 6537 //-- 如果是购物车的选择添加搭配商品 --
6523 6538 if (e.detail.is_cart == 1) {
6524 6539 this.select_coll_buy_cart(e.detail);
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.js 0 → 100644
  1 +var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a,
  4 + t = e.request,
  5 + d = e.globalData;
  6 +var ut = require("../../../../utils/util.js");
  7 +var com = require("../../../../pages/giftpack/public/buy_com.js");
  8 +
  9 +Page({
  10 + data: {
  11 + url: a.url, //接口网址
  12 + iurl: a.imghost, //图片前缀网址
  13 + isBuy: 0,
  14 + getGiftID: '', //礼包id
  15 + giftImage: '',
  16 + giftTitle: '',
  17 + giftDate: '',
  18 + giftPrice: '',
  19 + giftIntegral: '',
  20 + giftPosPrice: '',
  21 + giftQty: '',
  22 + giftRemark: '',
  23 + giftType: '',
  24 + actTitle: '',
  25 + getUrl: '',
  26 + wareCard: [],
  27 + orderSn: "", //订单编号
  28 + lbId: "",
  29 + code: "", //核销码
  30 + c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
  31 + is_lb: 0, //是否有礼包
  32 + default_color: null,
  33 + first_leader: e.globalData.first_leader || 0, // 推荐人ID
  34 +
  35 + //门店相关
  36 + ismend: 0,
  37 + is_sec_mend: 0,
  38 + sto_sele_name: "", //选中的门店名称
  39 + sto_sele_id: "", //选中的门店id
  40 + sto_sele_distr: "", //选择的门店的配送方式
  41 + is_show_sto_cat: 1, //是否显示门店分类
  42 + only_pk: null,
  43 + all_sto: null,
  44 + sec_sto: null, //选择了的门店分类
  45 + pickpu_list: null, //读出的所有门店list
  46 + def_pickpu_list: null, //一开始5个门店list
  47 + sec_pick_index: 0, //第二级门店选择ID
  48 + fir_pick_index: 0, //第一级门店选择ID
  49 + all_pick_list: null,//所有的门店先记录起来
  50 + select_store: 0, //选择更多
  51 + index: 1,
  52 + more_store: 0, //选择门店
  53 + sort_store: 0, //门店分类
  54 + choice_sort_store: 0, //选择分类门店
  55 + new_user: 0, //新用户
  56 + def_pick_store: null, // 默认的门店
  57 + fir_def_store: null, //客户默认的门店的
  58 + lat: null, //维度
  59 + lon: null, //经度
  60 + is_get_local_ok: 0, //获取坐标是否完成
  61 + region_name: "门店分类", //区域的名字
  62 + is_gps: 1,
  63 + open_ind_store: 0, //哪里打开的门店列表的控制属性
  64 + default_store: {}, //创建添加默认门店地址的对象
  65 + store: 0,
  66 + openSpecModal: 0,
  67 + sto_sele_name_1: '',
  68 + share_goods_img:'', //礼包的分享图
  69 + giftImageCover:null,
  70 + canvasHidden:true,
  71 + screenWidth: 0
  72 + },
  73 + onLoad: function (options) {
  74 +
  75 + var th = this;
  76 + options.isBuy=0
  77 + this.setData({
  78 + params: options,
  79 + })
  80 +
  81 + // getApp().getConfig(function (e) {
  82 + // th.setData({sto_sele_name_1: e.store_name})
  83 + // })
  84 +
  85 + // getApp().getConfig2(function (e) {
  86 + // var json_d = JSON.parse(e.switch_list);
  87 + // th.setData({
  88 + // bconfig: e,
  89 + // sys_switch: json_d,
  90 + // is_retail_price: json_d.is_retail_price || 0
  91 + // });
  92 + // })
  93 +
  94 + //获取用户设备信息,屏幕宽度
  95 + wx.getSystemInfo({
  96 + success: res => {
  97 + th.setData({
  98 + screenWidth: res.screenWidth
  99 + })
  100 + }
  101 + });
  102 +
  103 + },
  104 + init() {
  105 + let options = this.data?.params; // this.data == null ? undefined:this.data.params
  106 + var th = this;
  107 + this.setData({
  108 + getUserID: d.user_id,
  109 + getStorageID: a.stoid,
  110 + })
  111 +
  112 + if(!options.lbId && options.scene){
  113 + var gid_str = decodeURIComponent(options.scene);
  114 + gid_str = gid_str.split("_");
  115 +
  116 + options.lbId=gid_str[0];
  117 + options.first_leader=gid_str[1];
  118 + options.isBuy=1;
  119 + }
  120 +
  121 +
  122 + this.setData({
  123 + isBuy: options.isBuy,
  124 + getGiftID: options.lbId,
  125 + orderSn: options.orderSn,
  126 + flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1
  127 + })
  128 + if (options.lbId) th.data.lbId = options.lbId;
  129 + //-- 获取分享人的ID --
  130 + var first_leader = options.first_leader || getApp().globalData.first_leader;
  131 + if (first_leader) {
  132 + this.setData({
  133 + first_leader,
  134 + })
  135 + //-- user_id代过来免登录 --
  136 + getApp().globalData.first_leader = first_leader;
  137 + //调用接口判断是不是会员
  138 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  139 + if (res.data.code == 0) {
  140 + getApp().globalData.guide_id = res.data.data.id;
  141 + }
  142 + })
  143 + }
  144 + // th.close();
  145 +
  146 +
  147 + if (this.data.flag == 1) {
  148 + this.getZxlbDetails();
  149 + } else {
  150 + this.GetMyGiftList();
  151 + // if (this.data.isBuy == 0) {
  152 + // this.GetMyGiftList();
  153 + // } else if (this.data.isBuy == 1) {
  154 + // this.GetBuyGiftList();
  155 + // }
  156 +
  157 + }
  158 +
  159 + },
  160 +
  161 + onShow: function () {
  162 + getApp().check_can_share();
  163 + getApp().is_Single_page(this, function () {
  164 + //--先判断会员状态--
  165 + var user_info = getApp().globalData.userInfo;
  166 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  167 + // getApp().goto('/packageE/pages/togoin/togoin');
  168 + // return false;
  169 + // }
  170 + this.init();
  171 + })
  172 + },
  173 + GetBuyPrice: function (e) {
  174 + var that = this.data;
  175 + var th = this;
  176 + //如果还没有开始的话
  177 + if (th.data.isStart != 1) {
  178 + getApp().my_warnning("活动还没有开始", 0, th);
  179 + return false;
  180 + }
  181 +
  182 + this.data.payMoney = th.data.sele_g.payMoney;
  183 + th.setData({buyType: 2})
  184 + if (th.data.sele_g.is_pickup) {
  185 + th.setData({
  186 + openSpecModal: 1
  187 + })
  188 + } else {
  189 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  190 + my_confirm.open(
  191 + "是否确定购买该礼包",
  192 + "取消",
  193 + "确定",
  194 + function () {
  195 + my_confirm.open_cancel(0);
  196 + },
  197 + function () {
  198 + my_confirm.open_cancel(0);
  199 + com.buy_libao(th)
  200 + }
  201 + )
  202 + }
  203 +
  204 +
  205 + },
  206 + GetBuyIntegral: function (e) {
  207 + var that = this.data;
  208 + var th = this;
  209 +
  210 + //如果还没有开始的话
  211 + if (th.data.isStart != 1) {
  212 + getApp().my_warnning("活动还没有开始", 0, th);
  213 + return false;
  214 + }
  215 +
  216 + th.setData({buyType: 1});
  217 + if (th.data.sele_g.is_pickup) {
  218 + th.setData({
  219 + openSpecModal: 1
  220 + })
  221 + } else {
  222 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  223 + my_confirm.open(
  224 + "是否确定兑换该礼包",
  225 + "取消",
  226 + "确定",
  227 + function () {
  228 + my_confirm.open_cancel(0);
  229 + },
  230 + function () {
  231 + my_confirm.open_cancel(0);
  232 + com.buy_libao(th)
  233 + })
  234 + }
  235 +
  236 +
  237 + },
  238 +
  239 + GetMyGiftList: function () {
  240 + var _this = this;
  241 + var th = this;
  242 + getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
  243 + isShowLoading: true,
  244 + data: {
  245 + "storeId": a.stoid, //商家ID
  246 + "userId": th.data.params.userId, //用户ID
  247 + "orderSn": th.data.orderSn
  248 + // "userId": d.user_id, //用户ID
  249 + // "orderSn": th.data.orderSn
  250 + // "giftBagId":th.data.params.lbId
  251 + },
  252 + success: function (res) {
  253 + if (res.data.code == 0) {
  254 + console.log('商品------++')
  255 + console.log(res)
  256 + th.setData({
  257 + giftImage: th.data.iurl + res.data.data.lbUrl,
  258 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
  259 + giftTitle: res.data.data.giftTitle,
  260 + default_color: res.data.data.bgcolor
  261 + })
  262 +
  263 + if (res.data.data.iswarelbtype == 1) {
  264 + th.setData({iswarelbtype: 1})
  265 + }
  266 +
  267 + if (!res.data.data.giftRemark || res.data.data.giftRemark == '') {
  268 + th.setData({
  269 + giftRemark: '暂无详情......'
  270 + })
  271 + } else {
  272 + th.setData({
  273 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  274 + })
  275 + }
  276 +
  277 + //---获取日期的时间戳---
  278 + var t_endtime = res.data.data.endTime;
  279 + t_endtime = t_endtime.replace(/-/g, '/');
  280 + var t_date = new Date(t_endtime) / 1000;
  281 + var t_now = ut.gettimestamp();
  282 +
  283 + var t_starttime = res.data.data.starTime;
  284 + t_starttime = t_starttime.replace(/-/g, '/');
  285 + var t_sdate = new Date(t_starttime) / 1000;
  286 +
  287 + if (res.data.data.goodsUseState) th.setData({
  288 + c_state: 1
  289 + })
  290 + else if (t_date <= t_now)
  291 + th.setData({
  292 + c_state: 2
  293 + })
  294 + else if (t_sdate > t_now)
  295 + th.setData({
  296 + c_state: -1
  297 + })
  298 + th.setData({
  299 + giftDate: res.data.data.endTime,
  300 + giftPosPrice: res.data.data.giftPosPrice,
  301 + giftQty: res.data.data.giftQty,
  302 + giftIntegral: res.data.data.payIntegral,
  303 + giftPrice: res.data.data.payMoney,
  304 + giftType: res.data.data.actType,
  305 + actTitle: res.data.data.actTitle,
  306 + wareCard: res.data.data.wareCard,
  307 + lbId: res.data.data.lbId
  308 + })
  309 + //判断是否有礼包
  310 + for (var i = 0; i < res.data.data.wareCard.length; i++) {
  311 + if (res.data.data.wareCard[i].lbType == 1) {
  312 + th.setData({
  313 + is_lb: 1
  314 + })
  315 + break;
  316 + }
  317 + }
  318 +
  319 + if (res.data.data.pickup_id) {
  320 + getApp().request.get("/api/weshop/pickup/get/" + os.stoid + "/" + res.data.data.pickup_id, {
  321 + success: function (res) {
  322 + if (res.data.code == 0) {
  323 + th.setData({pick_up: res.data.data});
  324 + }
  325 + }
  326 + });
  327 +
  328 + }
  329 +
  330 +
  331 + } else {
  332 + getApp().my_warnning(res.data.msg, 0, th);
  333 + return false;
  334 + }
  335 + }
  336 + });
  337 +
  338 + },
  339 + GetBuyGiftList: function () {
  340 + var _this2 = this;
  341 + var th = this.data;
  342 + getApp().request.get('/api/weshop/marketing/giftbag/detail/get', {
  343 + isShowLoading: true,
  344 + data: {
  345 + "storeId": a.stoid, //商家ID
  346 + "userId": d.user_id, //用户ID
  347 + "giftBagId": th.getGiftID
  348 + },
  349 + success: function success(res) {
  350 + if (res.data.code == 0) {
  351 + _this2.setData({
  352 + giftImage: th.iurl + res.data.data.lbUrl,
  353 + giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img: res.data.data.lbUrl),
  354 + giftTitle: res.data.data.giftTitle,
  355 + default_color: res.data.data.bgcolor
  356 + })
  357 + if (res.data.data.giftRemark == '') {
  358 + _this2.setData({
  359 + giftRemark: '暂无详情......'
  360 + })
  361 + } else {
  362 + _this2.setData({
  363 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  364 + })
  365 + }
  366 +
  367 + var isStart = 0;
  368 + var now = ut.gettimestamp();
  369 +
  370 + var str = res.data.data.starTime.replace(/-/g, '/');
  371 + var start = Date.parse(new Date(str));
  372 + start = start / 1000;
  373 + if (start < now) isStart = 1;
  374 +
  375 + _this2.setData({
  376 + giftDate: res.data.data.endTime,
  377 + giftStart: res.data.data.starTime,
  378 + giftPosPrice: res.data.data.giftPosPrice,
  379 + giftQty: res.data.data.giftQty,
  380 + giftIntegral: res.data.data.payIntegral,
  381 + giftPrice: res.data.data.payMoney,
  382 + giftType: res.data.data.actType,
  383 + actTitle: res.data.data.actTitle,
  384 + wareCard: res.data.data.wareCard,
  385 + isStart: isStart,
  386 + sele_g: res.data.data
  387 + })
  388 +
  389 +
  390 + var sele_g = res.data.data;
  391 + //需不需要门店,不需要门店返回
  392 + if (!sele_g.is_pickup) return false;
  393 +
  394 + com.wait_for_store_config(_this2);
  395 + com.set_user_mo_store(_this2, os, function () {
  396 + if (sele_g.pickup_list && _this2.data.def_pick_store) {
  397 + com.check_def_pk(_this2);
  398 + }
  399 + });
  400 + com.get_sto(_this2, os);
  401 +
  402 +
  403 + } else {
  404 + getApp().my_warnning(res.data.msg, 0, _this2);
  405 + return false;
  406 + }
  407 + }
  408 + });
  409 +
  410 + },
  411 +
  412 + getZxlbDetails: function () {
  413 +
  414 + var th = this;
  415 + getApp().request.get('/api/weshop/marketing/giftbag/detail/getNew', {
  416 + isShowLoading: true,
  417 + data: {
  418 + "storeId": a.stoid, //商家ID
  419 + //"userId": d.user_id, //用户ID
  420 + "giftBagId": th.data.lbId
  421 + },
  422 + success: function (res) {
  423 + if (res.data.code == 0) {
  424 + th.setData({
  425 + giftImage: th.data.iurl + res.data.data.lbUrl,
  426 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
  427 + giftTitle: res.data.data.lbTitle,
  428 + default_color: res.data.data.bgcolor
  429 + })
  430 + if (res.data.data.lbIntro == '') {
  431 + th.setData({
  432 + giftRemark: '暂无详情......'
  433 + })
  434 + } else {
  435 + th.setData({
  436 + giftRemark: res.data.data.lbIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  437 + })
  438 + }
  439 +
  440 + //---获取日期的时间戳---
  441 + let exchangeType = res.data.data.exchangeType;
  442 + let exchangeDay = res.data.data.exchangeDay;
  443 + let exchangeStartTime = res.data.data.exchangeStartTime;
  444 + let exchangeEndTime = res.data.data.exchangeEndTime;
  445 + // let t_endtime;
  446 +
  447 + if (exchangeType == 2) {
  448 + if (exchangeStartTime == 0 || !exchangeStartTime) {
  449 + exchangeStartTime = ut.gettimestamp();
  450 + }
  451 + exchangeStartTime = ut.formatTime(exchangeStartTime, 0);
  452 + exchangeEndTime = ut.formatTime(exchangeEndTime, 0);
  453 + }
  454 +
  455 +
  456 + th.setData({
  457 + // giftDate: t_endtime,
  458 + giftPosPrice: res.data.data.oldPrice,
  459 + giftQty: res.data.data.lbNum,
  460 + giftIntegral: res.data.data.exchangeIntegral,
  461 + giftPrice: res.data.data.lbPrice,
  462 + giftType: res.data.data.actType,
  463 + actTitle: res.data.data.actTitle,
  464 + wareCard: res.data.data.wareCard,
  465 + lbId: res.data.data.lbId,
  466 + exchangeType: exchangeType,
  467 + exchangeDay: exchangeDay,
  468 + exchangeStartTime: exchangeStartTime,
  469 + exchangeEndTime: exchangeEndTime,
  470 + })
  471 + //判断是否有礼包
  472 + for (var i = 0; i < res.data.data.wareCard.length; i++) {
  473 + if (res.data.data.wareCard[i].lbType == 1) {
  474 + th.setData({
  475 + is_lb: 1
  476 + })
  477 + break;
  478 + }
  479 + }
  480 + } else {
  481 + getApp().my_warnning(res.data.msg, 0, th);
  482 + return false;
  483 + }
  484 + }
  485 + });
  486 +
  487 + },
  488 +
  489 +
  490 + //显示核销码
  491 + code_show: function (e) {
  492 + var th = this;
  493 + //--获取成功的时候--
  494 + var no = th.data.code;
  495 + var qc_com = th.selectComponent("#qc_com"); //组件的id
  496 + var obj = {
  497 + val: no,
  498 + content: "请将二维码展示给核销员,收货更快捷"
  499 + };
  500 + qc_com.open(obj)
  501 + },
  502 + //获取核销码
  503 + getcode: function (e) {
  504 + var th = this;
  505 + var orderSn = th.data.orderSn; //订单号
  506 + let codeId = e.currentTarget.dataset.codeid;
  507 + var json = {
  508 + "storeId": a.stoid,
  509 + "orderSn": orderSn,
  510 + }
  511 + if (codeId && codeId !== "") {
  512 + json.id = codeId
  513 + }
  514 + var data = JSON.stringify(json);
  515 + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址
  516 + getApp().request.json_post(url, json,
  517 + function (res) {
  518 + if (res.data.code == 0) {
  519 + th.setData({
  520 + code: res.data.data
  521 + })
  522 + th.code_show();
  523 + } else {
  524 + getApp().my_warnning(res.data.msg, 0, th);
  525 + }
  526 + },
  527 + function (res) {
  528 +
  529 + },
  530 + "put"
  531 + )
  532 +
  533 + },
  534 + //界面跳转
  535 + goto: function (e) {
  536 + var th = this;
  537 + var url = e.currentTarget.dataset.url;
  538 + getApp().goto(url);
  539 + },
  540 + //图片失败,默认图片
  541 + bind_bnerr2: function (e) {
  542 + var _errImg = e.target.dataset.errorimg;
  543 + var _errObj = {};
  544 + _errObj[_errImg] = "/miniapp/images/giftbag/gift01.png";
  545 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  546 + },
  547 +
  548 + //图片失败,默认图片
  549 + bind_bnerr: function (e) {
  550 + var _errImg = e.target.dataset.errorimg;
  551 + var _errObj = {};
  552 + _errObj[_errImg] = this.data.iurl + "miniapp/images/big_back.jpg";
  553 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  554 + //this.setData({ giftImage: this.data.iurl + "/miniapp/images/giftbag/gift01.png"});
  555 +
  556 + },
  557 +
  558 + //关闭导航
  559 + // close: function () {
  560 + // var th = this;
  561 + // var nav_b = th.selectComponent("#nav_b"); //组件的id
  562 + // nav_b.close_box();
  563 + // nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy");
  564 + // },
  565 +
  566 + //--- 分享设置 --
  567 + onShareAppMessage: function (e) {
  568 + getApp().globalData.no_clear = 1;
  569 + var curPage = this;
  570 + var pagePath = curPage.route; //当前页面url
  571 + if (pagePath.indexOf('/') != 0) {
  572 + pagePath = '/' + pagePath;
  573 + }
  574 + pagePath += "?isBuy=1" + "&lbId=" + this.data.getGiftID + "&first_leader=" + this.data.getUserID;
  575 + // if (this.data.isBuy == 0) {
  576 + // pagePath += "&orderSn=" + this.data.orderSn;
  577 + // } else {
  578 + // pagePath += "&lbId=" + this.data.getGiftID;
  579 + // }
  580 + // console.log('pagePath', pagePath);
  581 + return {
  582 + title: "礼包详情",
  583 + path: pagePath,
  584 + }
  585 + },
  586 +
  587 + /**
  588 + * 用户分享朋友圈
  589 + */
  590 + onShareTimeline() {
  591 + getApp().globalData.no_clear = 1;
  592 +
  593 + var pagePath = "&isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader=" + this.data.getUserID;
  594 + var user_id = getApp().globalData.user_id;
  595 + if (!user_id) user_id = 0;
  596 +
  597 + return {
  598 + title: "礼包详情",
  599 + query: 'first_leader=' + user_id + pagePath
  600 + }
  601 + },
  602 +
  603 + //免费领取
  604 + GetFree: function (e) {
  605 + var that = this.data;
  606 + var th = this;
  607 +
  608 + //如果还没有开始的话
  609 + if (th.data.isStart != 1) {
  610 + getApp().my_warnning("活动还没有开始", 0, th);
  611 + return false;
  612 + }
  613 +
  614 + th.setData({buyType: 3});
  615 + if (th.data.sele_g.is_pickup) {
  616 + th.setData({
  617 + openSpecModal: 1
  618 + })
  619 + } else {
  620 +
  621 +
  622 + // var id = e.currentTarget.dataset.id;//活动id
  623 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  624 + my_confirm.open(
  625 + "是否确定领取该礼包",
  626 + "取消",
  627 + "确定",
  628 + function () {
  629 + my_confirm.open_cancel(0);
  630 + },
  631 + function () {
  632 + my_confirm.open_cancel(0);
  633 + com.buy_libao(th)
  634 + })
  635 + }
  636 +
  637 +
  638 + },
  639 +
  640 + //--- 设置一下默认库存的数量 ----
  641 + set_def_storage(ee) {
  642 + var that = this, th = this;
  643 + that.data.fir_def_store = ee;
  644 +
  645 + that.setData({
  646 + def_pick_store: ee,
  647 + sto_sele_name: ee.pickup_name,
  648 + sto_sele_id: ee.pickup_id,
  649 + sto_sele_distr: ee.distr_type
  650 + })
  651 + },
  652 + // 选择门店
  653 + choice_store: function (ee) {
  654 + var th = this;
  655 + var ind = ee.currentTarget.dataset.ind;
  656 + var bconfig = th.data.bconfig;
  657 +
  658 + //如果开启了,则不在选择门店
  659 + if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
  660 + return false;
  661 + }
  662 + if (!th.data.only_pk && !th.data.def_pickpu_list) {
  663 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  664 + return false;
  665 + }
  666 +
  667 + if (th.data.only_pk && !th.data.only_pk.length) {
  668 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  669 + return false;
  670 + }
  671 + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
  672 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  673 + return false;
  674 + }
  675 +
  676 +
  677 + if (bconfig && bconfig.is_sort_storage) {
  678 + wx.getLocation({
  679 + type: 'gcj02',
  680 + success: function (res) {
  681 +
  682 + th.data.lat = res.latitude;
  683 + th.data.lon = res.longitude;
  684 + th.data.is_get_local_ok = 1;
  685 + th.setData({
  686 + is_gps: 1
  687 + });
  688 + //th.onShow();
  689 + com.get_sto(th, os);
  690 + },
  691 + fail: function (res) {
  692 + //th.onShow();
  693 + th.data.is_get_local_ok = 1;
  694 + com.get_sto(th, os);
  695 + if (res.errCode == 2) {
  696 + th.setData({
  697 + is_gps: 0
  698 + });
  699 + if (th.data.is_gps == 0) {
  700 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  701 + }
  702 + } else {
  703 + th.setData({
  704 + is_gps: "3"
  705 + });
  706 + }
  707 +
  708 + }
  709 + })
  710 + } else {
  711 + th.data.is_get_local_ok = 1;
  712 + com.get_sto(th, os);
  713 + }
  714 +
  715 + if (ind != undefined && ind != null) {
  716 + this.setData({
  717 + open_ind_store: ind,
  718 + store: 1,
  719 + openSpecModal: !1,
  720 + openSpecModal_pt: !1,
  721 + openSpecModal_flash_normal: !1,
  722 + })
  723 + } else {
  724 + this.setData({
  725 + store: 1,
  726 + openSpecModal: !1,
  727 + openSpecModal_pt: !1,
  728 + openSpecModal_flash_normal: !1
  729 +
  730 + })
  731 + }
  732 + },
  733 + //关闭选择门店
  734 + close_popup: function (e) {
  735 + var th = this;
  736 + this.setData({
  737 + store: 0,
  738 + choice_sort_store: 0,
  739 + sort_store: 0,
  740 + fir_pick_index: 0,
  741 + sec_pick_index: 0
  742 + })
  743 +
  744 + var openindstore = this.data.open_ind_store;
  745 + if (openindstore == 1) {
  746 + th.setData({
  747 + openSpecModal: !0,
  748 + openSpecModal_ind: openindstore,
  749 + });
  750 + } else if (openindstore == 2) {
  751 + th.setData({
  752 + openSpecModal: !0,
  753 + openSpecModal_ind: openindstore,
  754 + });
  755 + } else if (openindstore == 4) { //4就是拼团
  756 + th.setData({
  757 + openSpecModal_pt: 1, //打开拼团购买界面
  758 + store: 0, //关闭门店
  759 + choice_sort_store: 0, //关闭门店2级
  760 + sort_store: 0, //关闭门店2级
  761 + });
  762 + } else {
  763 + th.setData({
  764 + store: 0,
  765 + choice_sort_store: 0,
  766 + sort_store: 0
  767 + })
  768 + }
  769 +
  770 +
  771 + },
  772 +
  773 + //选择更多门店
  774 + more_store: function () {
  775 + this.setData({
  776 + sort_store: 1
  777 + });
  778 + },
  779 + // 返回按钮
  780 + returns: function () {
  781 + this.setData({
  782 + sort_store: 0,
  783 + choice_sort_store: 0
  784 + });
  785 + },
  786 + //---选择分类门店---
  787 + choice_sort_store: function (e) {
  788 + var index = e.currentTarget.dataset.index;
  789 + var region_name = e.currentTarget.dataset.region;
  790 + var item = this.data.all_sto[index];
  791 + this.setData({
  792 + region_name: region_name,
  793 + sort_store: 0,
  794 + choice_sort_store: 1,
  795 + sec_sto: item,
  796 + sec_pick_index: 0
  797 + });
  798 + },
  799 +
  800 + choose_for_store_fir: function (e) {
  801 + var index_c = e.currentTarget.dataset.ind;
  802 + var th = this;
  803 + th.setData({
  804 + fir_pick_index: index_c
  805 + })
  806 +
  807 + },
  808 +
  809 + //确定def_pick为选择的门店
  810 + sure_pick: function (e) {
  811 + var th = this;
  812 + var item = null;
  813 + var openindstore = th.data.open_ind_store;
  814 +
  815 + if (th.data.choice_sort_store == 0) {
  816 + var index = th.data.fir_pick_index;
  817 + if (th.data.is_show_sto_cat == 1) {
  818 + item = th.data.def_pickpu_list[index];
  819 + } else {
  820 + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  821 + }
  822 +
  823 + } else {
  824 + var index = th.data.sec_pick_index;
  825 + item = th.data.sec_sto.s_arr[index];
  826 + }
  827 +
  828 + if(!item) return false;
  829 +
  830 + if (!th.data.sele_g) return false;
  831 +
  832 + th.setData({
  833 + def_pick_store: item,
  834 + sto_sele_name: item.pickup_name,
  835 + sto_sele_id: item.pickup_id,
  836 + sto_sele_distr: item.distr_type,
  837 + store: 0,
  838 + choice_sort_store: 0,
  839 + fir_pick_index: 0,
  840 + openSpecModal: !0,
  841 + });
  842 +
  843 +
  844 + },
  845 + //---点击二级之后的选择---
  846 + choose_for_store: function (e) {
  847 + var index_c = e.currentTarget.dataset.ind;
  848 + var th = this;
  849 + th.setData({
  850 + sec_pick_index: index_c,
  851 + fir_pick_index: index_c
  852 + })
  853 +
  854 + },
  855 + //把选择的门店设置成默认的门店def_pick
  856 + set_def_pick: function (e) {
  857 + var th = this;
  858 + var item = null;
  859 + if (th.data.choice_sort_store == 0) {
  860 + var index = th.data.fir_pick_index;
  861 + if (th.data.is_show_sto_cat == 1) {
  862 + item = th.data.def_pickpu_list[index];
  863 + } else {
  864 + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  865 + }
  866 + } else {
  867 + var index = th.data.sec_pick_index;
  868 + item = th.data.sec_sto.s_arr[index];
  869 + }
  870 +
  871 + if(!item) return false;
  872 +
  873 + th.setData({
  874 + def_pick_store: item,
  875 + sto_sele_name: item.pickup_name,
  876 + sto_sele_id: item.pickup_id,
  877 + sto_sele_distr: item.distr_type,
  878 + store: 0,
  879 + choice_sort_store: 0,
  880 + openSpecModal: !0,
  881 + });
  882 +
  883 + var user_id = getApp().globalData.user_id;
  884 + var def_pickup_id = item.pickup_id;
  885 + getApp().request.put('/api/weshop/users/update', {
  886 + data: {
  887 + user_id: user_id,
  888 + def_pickup_id: def_pickup_id
  889 + },
  890 + success: function (res) {
  891 + if (res.data.code == 0) {
  892 + if (th.data.choice_sort_store == 0) th.setData({
  893 + fir_pick_index: 0
  894 + });
  895 + getApp().globalData.pk_store = item;
  896 + } else {
  897 + getApp().my_warnning("设置默认门店地址失败", 0, th)
  898 + }
  899 +
  900 + }
  901 + });
  902 +
  903 +
  904 + },
  905 + closeSpecModal: function () {
  906 + this.setData({openSpecModal: 0});
  907 + },
  908 +
  909 + buy_libao: function () {
  910 + com.buy_libao(this)
  911 + },
  912 +
  913 +
  914 + clickShare() {
  915 + // if (!getApp().globalData.user_id) {
  916 + // getApp().goto("/packageE/pages/togoin/togoin");
  917 + // return false;
  918 + // }
  919 + this.setData({
  920 + share_hidden: true,
  921 + });
  922 + },
  923 +
  924 + send() {
  925 + this.setData({
  926 + share_hidden: false,
  927 + });
  928 + },
  929 +
  930 + cancel() {
  931 + this.setData({
  932 + share_hidden: false,
  933 + });
  934 + },
  935 +
  936 +
  937 + //--定义的保存图片方法,分享团---
  938 + saveImageToPhotosAlbum: function () {
  939 + //--先判断会员状态--
  940 + var user_info = getApp().globalData.userInfo;
  941 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  942 + //getApp().my_warnning("请先登录",0,this);
  943 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  944 + // return false;
  945 + }
  946 +
  947 + if (this.data.share_hidden) {
  948 + this.setData({share_hidden: false,});
  949 + }
  950 +
  951 + wx.showLoading({title: '生成中...',})
  952 + var that = this, th = that;
  953 + //设置画板显示,才能开始绘图
  954 + that.setData({
  955 + canvasHidden: false
  956 + })
  957 +
  958 + var app = getApp();
  959 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  960 + var scene = th.data.lbId + "";
  961 +
  962 + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
  963 + if (user_id > 0) {
  964 + scene += "_" + user_id;
  965 + }
  966 + ///二微码
  967 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  968 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/giftpack/giftpacklist/giftpacklist";
  969 +
  970 + // 读取文件成功则OK--
  971 + wx.getImageInfo({
  972 + src: path3,
  973 + success: function (res) {
  974 + th.get_goods_temp(function () {
  975 + var vpath = res.path;
  976 + var context = wx.createCanvasContext('share');
  977 + // let share_goods_img = th.params.cover_img
  978 + th.drawPoster(context, unit, th.data.share_goods_img, vpath, 0);
  979 +
  980 + //把画板内容绘制成图片,并回调 画板图片路径
  981 + context.draw(false, function () {
  982 + setTimeout(function () {
  983 + wx.canvasToTempFilePath({
  984 + x: 0,
  985 + y: 0,
  986 + width: 750,
  987 + height: 1217,
  988 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  989 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  990 + canvasId: 'share',
  991 + success: function (res) {
  992 +
  993 + that.setData({
  994 + shareImgPath: res.tempFilePath,
  995 + canvasHidden: true
  996 + })
  997 +
  998 + if (!res.tempFilePath) {
  999 + wx.showModal({
  1000 + title: '提示',
  1001 + content: '图片绘制中,请稍后重试',
  1002 + showCancel: false
  1003 + })
  1004 + return false;
  1005 + }
  1006 +
  1007 + that.setData({
  1008 + showPoster: true,
  1009 + });
  1010 + wx.hideLoading();
  1011 + }
  1012 + })
  1013 + }, 800)
  1014 +
  1015 + });
  1016 + })
  1017 + },
  1018 + fail: function (res) {
  1019 + console.log(res);
  1020 + wx.hideLoading();
  1021 +
  1022 + }
  1023 + });
  1024 + },
  1025 +
  1026 + //-- 小程序绘制海报 --
  1027 + drawPoster(context, unit, img, vpath, type) {
  1028 + // 1.灰色背景
  1029 + context.setFillStyle('#f2f1f6');
  1030 + context.rect(0, 0, 554 * unit, 899 * unit);
  1031 + context.fill();
  1032 +
  1033 + // 2.商城名称
  1034 + let shopName = this.data.sto_sele_name_1;
  1035 + context.setTextAlign('center');
  1036 + context.setFontSize(26 * unit);
  1037 + context.setFillStyle('black');
  1038 + context.fillText(shopName, 277 * unit, 60 * unit);
  1039 +
  1040 + // 3.推荐来源
  1041 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  1042 + context.setTextAlign('center');
  1043 + context.setFontSize(22 * unit);
  1044 + context.setFillStyle('#96959a');
  1045 + context.fillText(fromText, 277 * unit, 105 * unit);
  1046 +
  1047 + // 4.海报背景
  1048 + context.setFillStyle('white');
  1049 + context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
  1050 +
  1051 + // 5.商品图片
  1052 + // 图片的x坐标
  1053 + let bg_x = 37 * unit
  1054 + // 图片的y坐标
  1055 + let bg_y = 157 * unit
  1056 + // 图片宽度
  1057 + let bg_w = 480 * unit
  1058 + // 图片高度
  1059 + let bg_h = 474 * unit
  1060 + // 图片圆角
  1061 + let bg_r = 4
  1062 + // 绘制海报背景图片圆角
  1063 + context.save()
  1064 + context.beginPath()
  1065 + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5)
  1066 + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
  1067 + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
  1068 + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
  1069 + context.clip()
  1070 + context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
  1071 + context.restore();
  1072 +
  1073 + // 6.强烈推荐
  1074 + let src = '';
  1075 + context.beginPath();
  1076 + if (type == 0) { // 普通
  1077 + src = '../../../images/share/q_tj.png';
  1078 + context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
  1079 + context.setFontSize(16 * unit)
  1080 + context.setFillStyle("white")
  1081 + context.setTextAlign('left');
  1082 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
  1083 + }
  1084 +
  1085 +
  1086 + let price = this.data.giftPrice;
  1087 + let giftIntegral = this.data.giftIntegral;
  1088 + context.setFontSize(32 * unit);
  1089 + context.setFillStyle('#DE1117');
  1090 +
  1091 + var price_txt="";
  1092 + if(price || giftIntegral){
  1093 + if(price){
  1094 + price_txt='¥' + price;
  1095 + if(giftIntegral) price_txt+='+';
  1096 + }
  1097 + if(giftIntegral) price_txt+=giftIntegral+'积分';
  1098 + }else{
  1099 + price_txt="¥0";
  1100 + }
  1101 +
  1102 + context.fillText(price_txt, 54 * unit, 735 * unit);
  1103 +
  1104 +
  1105 + var wp= 62 * unit;
  1106 + var hp=765 * unit
  1107 + this.draw_pos_price(context,wp,hp,this.giftPosPrice,unit);
  1108 +
  1109 + // 8.商品标题
  1110 + context.setFontSize(20 * unit);
  1111 + context.setFillStyle('#898989');
  1112 + getApp().draw_Text(context, this.data.giftTitle, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
  1113 +
  1114 + // 9.小程序码
  1115 + context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
  1116 + context.setFontSize(16 * unit);
  1117 + context.setFillStyle('#777');
  1118 + context.fillText('长按识别二维码', 378 * unit, 810 * unit);
  1119 +
  1120 + // 10.竖线
  1121 + context.beginPath();
  1122 + context.setFillStyle('#eee');
  1123 + context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit);
  1124 + context.fill();
  1125 + },
  1126 +
  1127 +
  1128 + //---市场价划掉---
  1129 + draw_pos_price(context,w,h,market_price,unit){
  1130 +
  1131 + if(!this.is_retail_price) return false;
  1132 +
  1133 + context.setFillStyle("gray")
  1134 + context.setFontSize(22 * unit)
  1135 + var pri0 = "¥" + market_price.toFixed(2);
  1136 + context.fillText(pri0, w, h);
  1137 +
  1138 + var c_h=h-6;
  1139 + context.setStrokeStyle('gray');
  1140 + context.setLineWidth(1 * unit);
  1141 + context.moveTo(w - 5, c_h);
  1142 + context.lineTo(w + ut.measureText(pri0, 22 * unit) + 5, c_h);
  1143 + context.stroke();
  1144 +
  1145 + },
  1146 +
  1147 + //--获取商品图片的本地缓存,回调写法--
  1148 + get_goods_temp: function (tt) {
  1149 + var ee = this;
  1150 + if (ee.data.share_goods_img) {
  1151 + tt();
  1152 + return false;
  1153 + }
  1154 + var img_url = ee.data.giftImageCover ? ee.data.giftImageCover : ee.data.giftImage;
  1155 + //获取商品是分享图信息
  1156 + wx.getImageInfo({
  1157 + src: img_url,
  1158 + success: function (res) {
  1159 + //res.path是网络图片的本地地址
  1160 + ee.data.share_goods_img = res.path;
  1161 + tt();
  1162 + },
  1163 + fail: function (res) {
  1164 + //获取默认空白图
  1165 + wx.getImageInfo({
  1166 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  1167 + success: function(res) {
  1168 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  1169 + tt();
  1170 + }
  1171 + })
  1172 + }
  1173 + });
  1174 + },
  1175 +
  1176 + closePoster() {
  1177 + this.setData({
  1178 + showPoster: false,
  1179 + });
  1180 + },
  1181 + // 保存图片到手机
  1182 + savePic() {
  1183 + getApp().savePic(this);
  1184 + },
  1185 + // 预览海报
  1186 + previewPoster() {
  1187 + getApp().globalData.no_clear=1;
  1188 + wx.previewImage({
  1189 + current: this.data.shareImgPath, // 当前显示图片的http链接
  1190 + urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
  1191 + });
  1192 + },
  1193 +
  1194 +
  1195 +
  1196 +});
0 1197 \ No newline at end of file
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "礼包详情",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn",
  5 + "my_confirm": "/components/my_confirm/my_confirm",
  6 + "qr_code": "/components/qr_code/qr_code",
  7 + "nav_b": "/components/nav_b/nav_b",
  8 + "share": "/components/share/share"
  9 + }
  10 +}
0 11 \ No newline at end of file
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.wxml 0 → 100644
  1 +<view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}}">
  2 + <view class="box_top data-v-3a5b7e36">
  3 + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image>
  4 + </view>
  5 + <view class="box_title data-v-3a5b7e36" >
  6 +
  7 + <view class="flex ai_c fs28" style="margin-bottom: 20rpx" wx:if="{{isBuy==0 && pick_up}}">
  8 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>{{pick_up.pickup_name}}
  9 + </view>
  10 +
  11 + <view class="top_title data-v-3a5b7e36">
  12 + <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{giftTitle}}</text>
  13 +
  14 + <!-- 这个是分享按钮 -->
  15 + <!-- <view wx:if="{{c_state<2}}" class="xc-share-frame t-c" bindtap="clickShare">
  16 + <view class="iconfont icon-share fs40" ></view>
  17 + <view class="fs22 c-7b">分享</view>
  18 + </view> -->
  19 +
  20 +
  21 + </view>
  22 + <view class="top_time data-v-3a5b7e36" wx:if="{{!flag}}">
  23 + <block wx:if="{{isBuy==1 && giftTitle && isStart!=1}}" >
  24 + <text class="data-v-3a5b7e36">
  25 + {{"活动开始时间:"+giftStart}}
  26 + </text>
  27 + </block>
  28 +
  29 + <block wx:else>
  30 + <text class="data-v-3a5b7e36" wx:if="{{isBuy==0}}">{{"兑换结束时间:"+giftDate}}</text>
  31 + <text class="data-v-3a5b7e36" wx:if="{{flag == 1}}">
  32 + {{"活动结束时间:"+giftDate}}
  33 + </text>
  34 + </block>
  35 + </view>
  36 + <!-- <view class="top_time data-v-3a5b7e36" wx:if="{{flag == 1 && iswarelbtype}}">
  37 + <text class="data-v-3a5b7e36" wx:if="{{exchangeType == 1}}">
  38 + {{"兑换时间:领取后"+exchangeDay+"天内兑换"}}
  39 + </text>
  40 + <text class="data-v-3a5b7e36" wx:elif="{{exchangeType == 2}}">
  41 + {{"兑换时间:"+exchangeStartTime+"至"+exchangeEndTime}}
  42 + </text>
  43 + </view> -->
  44 +
  45 + <view class="top_price data-v-3a5b7e36">
  46 +
  47 +
  48 + <block wx:if="{{giftPrice>0}}">
  49 + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text>
  50 + </block>
  51 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
  52 + <text class="data-v-3a5b7e36">/</text>
  53 + </block>
  54 + <block wx:if="{{giftIntegral>0}}">
  55 + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text>
  56 + </block>
  57 + <block wx:if="{{giftType>0}}">
  58 + <text class="data-v-3a5b7e36">{{actTitle}}</text>
  59 + </block>
  60 +
  61 +
  62 +
  63 +
  64 + </view>
  65 + <view class="top_foot data-v-3a5b7e36">
  66 + <view class="top_foot_price data-v-3a5b7e36">
  67 + <text class="data-v-3a5b7e36"> {{is_retail_price?'零售价:':''}}{{giftPosPrice+"元"}}</text>
  68 + </view>
  69 + <view class="top_foot_qty data-v-3a5b7e36">
  70 + <text class="data-v-3a5b7e36" wx:if="{{!flag}}">{{"已售:"+giftQty+"件"}}</text>
  71 + <text class="data-v-3a5b7e36" wx:elif="{{flag == 1 && giftQty > 0}}">{{"数量:"+giftQty+"件"}}</text>
  72 + </view>
  73 + </view>
  74 + </view>
  75 + <view class="box_ware data-v-3a5b7e36">
  76 + <view class="box_ware_title data-v-3a5b7e36">
  77 + <text class="data-v-3a5b7e36">礼包内容</text>
  78 + </view>
  79 + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id">
  80 + <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">
  81 + <view class="box_ware_img data-v-3a5b7e36">
  82 + <block wx:if="{{item.lbType==1}}">
  83 + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  84 + </block>
  85 + <block wx:if="{{item.lbType==2}}">
  86 + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  87 + </block>
  88 + <block wx:if="{{item.lbType==3}}">
  89 + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  90 + </block>
  91 + <block wx:if="{{item.lbType==4}}">
  92 + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  93 + </block>
  94 + <block wx:if="{{item.lbType==5}}">
  95 + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  96 + </block>
  97 + </view>
  98 + <view class="box_ware_item data-v-3a5b7e36">
  99 + <view class="box_ware_item_title data-v-3a5b7e36">
  100 + <text class="data-v-3a5b7e36">{{item.couponName}}</text>
  101 + </view>
  102 + <view class="box_ware_item_price data-v-3a5b7e36">
  103 + <text class="data-v-3a5b7e36"></text>
  104 + </view>
  105 + <view class="box_ware_item_qty data-v-3a5b7e36 flex">
  106 + <text class="data-v-3a5b7e36 ellipsis-1">
  107 + {{"数量:"+item.num}}
  108 + </text>
  109 + <!-- <block wx:if="{{isBuy==0 && !flag && item.lbType==1}}">
  110 + <text style="margin-left:10rpx" wx:if="{{item.useState}}">
  111 + 已核销
  112 + </text>
  113 + <text style="margin-left:10rpx" wx:else>
  114 + 未核销
  115 + </text>
  116 + </block> -->
  117 + </view>
  118 +
  119 + <!-- <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">
  120 + <block wx:if="{{isBuy==0&item.lbType==1}}">
  121 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image>
  122 + </block>
  123 +
  124 + <block wx:if="{{isBuy==0&item.lbType==2}}">
  125 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image>
  126 + </block>
  127 + <block wx:if="{{isBuy==0&item.lbType==3}}">
  128 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>
  129 + </block>
  130 + <block wx:if="{{isBuy==0&item.lbType>3}}">
  131 + <text class="data-v-3a5b7e36">奖励已发放</text>
  132 + </block>
  133 + </view> -->
  134 + </view>
  135 + </view>
  136 + </block>
  137 + </view>
  138 + <view class="foot_box data-v-3a5b7e36">
  139 + <view class="foot_box_title data-v-3a5b7e36">
  140 + <text class="data-v-3a5b7e36">活动说明</text>
  141 + </view>
  142 + <view class="foot_box_remark data-v-3a5b7e36">
  143 + <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
  144 + </view>
  145 + </view>
  146 +
  147 +
  148 + <view class="foot_empty data-v-3a5b7e36"></view>
  149 +
  150 + <!-- <block wx:if="{{flag != 1}}">
  151 + <block wx:if="{{isBuy==1 && giftTitle}}">
  152 + <block wx:if="{{isStart==1}}">
  153 + <view class="foot_button data-v-3a5b7e36">
  154 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
  155 + <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
  156 + <text class="data-v-3a5b7e36 ">立即购买</text>
  157 + </view>
  158 + <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
  159 + <text class="data-v-3a5b7e36">立即兑换</text>
  160 + </view>
  161 + </block>
  162 + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">
  163 + <view class="foot_button_buy data-v-3a5b7e36 " data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}">
  164 + <text class="data-v-3a5b7e36">立即购买</text>
  165 + </view>
  166 + </block>
  167 + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">
  168 + <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
  169 + <text class="data-v-3a5b7e36">立即兑换</text>
  170 + </view>
  171 + </block>
  172 +
  173 + <block wx:if="{{giftPrice<=0 && giftIntegral<=0}}">
  174 + <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetFree" data-id="{{lbId}}">
  175 + <text class="data-v-3a5b7e36">免费领取</text>
  176 + </view>
  177 + </block>
  178 +
  179 +
  180 + </view>
  181 + </block>
  182 + <block wx:else>
  183 + <view class="foot_button data-v-3a5b7e36">
  184 + <view class="foot_button_intalge data-v-3a5b7e36 gray ">
  185 + <text class="data-v-3a5b7e36">活动还未开始</text>
  186 + </view>
  187 + </view>
  188 + </block>
  189 +
  190 + </block>
  191 + <block wx:if="{{isBuy==0}}">
  192 + <view class="foot_button data-v-3a5b7e36">
  193 + <block wx:if="{{is_lb!=1}}">
  194 + <view class="foot_button_buy data-v-3a5b7e36 overdue">
  195 + <text class="data-v-3a5b7e36">无核销商品</text>
  196 + </view>
  197 + </block>
  198 + <block wx:else>
  199 + <view wx:if="{{c_state==-1}}" class="foot_button_buy data-v-3a5b7e36 overdue" >
  200 + <text class="data-v-3a5b7e36">兑换未开始</text>
  201 + </view>
  202 + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">
  203 + <text class="data-v-3a5b7e36">立即使用</text>
  204 + </view>
  205 + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode">
  206 + <text class="data-v-3a5b7e36">商品已核销</text>
  207 + </view>
  208 + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">
  209 + <text class="data-v-3a5b7e36">商品兑换时间已过</text>
  210 + </view>
  211 + </block>
  212 + </view>
  213 + </block>
  214 + </block> -->
  215 +
  216 +</view>
  217 +<!-- 引入提示组件 -->
  218 +<warn id="warn"></warn>
  219 +<my_confirm id="my_confirm"></my_confirm>
  220 +<!-- 弹出框扫描 -->
  221 +<qr_code id="qc_com"></qr_code>
  222 +<!-- 制作一个圆球导航 -->
  223 +<!-- <nav_b id="nav_b"></nav_b> -->
  224 +
  225 +<include src="../public/buy_com.wxml"></include>
  226 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas>
  227 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>
  228 +
  229 +
  230 +<view wx:if="{{showPoster}}">
  231 + <view class="mask" catchtap="closePoster"></view>
  232 + <view class="poster-container">
  233 + <view class="poster-wrapper">
  234 + <view class="poster" bindtap="previewPoster">
  235 + <!-- <view class="poster" bindtap="previewImage"> -->
  236 + <image src="{{shareImgPath}}" class="poster-img"></image>
  237 + <view class="btn-close" catchtap="closePoster">
  238 + <text class="iconfont icon-close"></text>
  239 + </view>
  240 + </view>
  241 + <view class="btn-container">
  242 + <!-- <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> -->
  243 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  244 + </view>
  245 + </view>
  246 + </view>
  247 +</view>
0 248 \ No newline at end of file
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.wxss 0 → 100644
  1 +@charset "UTF-8";
  2 +/* @import '../../goods/goodsInfo/goodsInfo.wxss'; */
  3 +@import "../../../../utils/wxParse/wxParse.wxss";
  4 +.box.data-v-3a5b7e36 {
  5 + -webkit-align-content: center;
  6 + align-content: center;
  7 + background-color: #e85f93;
  8 +}
  9 +
  10 +.box_top.data-v-3a5b7e36 {
  11 + width: 100%;
  12 +}
  13 +
  14 +.box_top image.data-v-3a5b7e36 {
  15 + width: 100%;
  16 + max-height: 540rpx;
  17 +}
  18 +
  19 +.box_title.data-v-3a5b7e36 {
  20 + margin: 10rpx 20rpx 20rpx 20rpx;
  21 + padding: 35rpx;
  22 + background-color: #fff;
  23 + border-radius: 40rpx;
  24 +}
  25 +
  26 +.top_title.data-v-3a5b7e36 {
  27 + font-size: 30rpx;
  28 + margin-bottom: 10rpx;
  29 + position: relative;
  30 +}
  31 +
  32 +.top_time.data-v-3a5b7e36 {
  33 + font-size: 27rpx;
  34 + color: #b9b5b5;
  35 +}
  36 +
  37 +.top_price.data-v-3a5b7e36 {
  38 + font-size: 35rpx;
  39 + color: #d61b30;
  40 + margin-top: 30rpx;
  41 + margin-bottom: 5rpx;
  42 + position: relative;
  43 +}
  44 +
  45 +.top_foot.data-v-3a5b7e36 {
  46 + display: -webkit-box;
  47 + display: -webkit-flex;
  48 + display: flex;
  49 +}
  50 +
  51 +.top_foot_price.data-v-3a5b7e36 {
  52 + font-size: 22rpx;
  53 + color: #b9b5b5;
  54 + width: 50%;
  55 + text-decoration: line-through;
  56 +}
  57 +
  58 +.top_foot_qty.data-v-3a5b7e36 {
  59 + font-size: 22rpx;
  60 + color: #b9b5b5;
  61 + width: 50%;
  62 + -webkit-align-content: flex-end;
  63 + align-content: flex-end;
  64 + text-align: right;
  65 +}
  66 +
  67 +.box_ware.data-v-3a5b7e36 {
  68 + margin: 10rpx 20rpx 20rpx 20rpx;
  69 + padding: 35rpx;
  70 + background-color: #fff;
  71 + border-radius: 40rpx;
  72 +}
  73 +
  74 +.box_ware_title.data-v-3a5b7e36 {
  75 + font-size: 35rpx;
  76 + margin: 5rpx 0rpx 30rpx 0rpx;
  77 +}
  78 +
  79 +.box_ware_box.data-v-3a5b7e36 {
  80 + display: -webkit-box;
  81 + display: -webkit-flex;
  82 + display: flex;
  83 + margin: 10rpx 0rpx 25rpx 0rpx;
  84 +}
  85 +
  86 +/* .box_ware_img.data-v-3a5b7e36 {
  87 + width: 30%;
  88 + height: 180rpx;
  89 + border: #999999 solid 1rpx;
  90 +} */
  91 +
  92 +.box_ware_img image.data-v-3a5b7e36 {
  93 + /* width: 185rpx;
  94 + height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */
  95 + border: 2rpx solid #999;
  96 + width: 120rpx;
  97 + height: 120rpx;
  98 + background-color: #f8f8f8;
  99 +}
  100 +
  101 +.box_ware_item.data-v-3a5b7e36 {
  102 + width: 70%;
  103 + margin-left: 25rpx;
  104 + position: relative;
  105 +}
  106 +
  107 +.box_ware_item_title.data-v-3a5b7e36 {
  108 + font-size: 24rpx;
  109 + word-break: break-all;
  110 + text-overflow: ellipsis;
  111 + display: -webkit-box;
  112 + -webkit-box-orient: vertical;
  113 + -webkit-line-clamp: 2;
  114 + overflow: hidden;
  115 +}
  116 +
  117 +.box_ware_count.data-v-3a5b7e36 {
  118 + display: -webkit-box;
  119 + display: -webkit-flex;
  120 + display: flex;
  121 +}
  122 +
  123 +.box_ware_item_price.data-v-3a5b7e36 {
  124 + font-size: 25rpx;
  125 + color: #b9b5b5;
  126 + position: absolute;
  127 + bottom: 60rpx;
  128 + left: 0;
  129 +}
  130 +
  131 +.box_ware_item_qty.data-v-3a5b7e36 {
  132 + font-size: 22rpx;
  133 + position: absolute;
  134 + bottom: 15rpx;
  135 + left: 0;
  136 +}
  137 +
  138 +.box_ware_code.data-v-3a5b7e36 {
  139 + position: absolute;
  140 + right: 10rpx;
  141 + bottom: 10rpx;
  142 +}
  143 +
  144 +.box_ware_code image.data-v-3a5b7e36 {
  145 + width: 50rpx;
  146 + height: 50rpx;
  147 +}
  148 +
  149 +.box_ware_code text.data-v-3a5b7e36 {
  150 + font-size: 20rpx;
  151 +}
  152 +
  153 +.foot_box.data-v-3a5b7e36 {
  154 + margin: 10rpx 20rpx 50rpx 20rpx;
  155 + padding: 35rpx;
  156 + background-color: #fff;
  157 + border-radius: 40rpx;
  158 +}
  159 +
  160 +.foot_box_title.data-v-3a5b7e36 {
  161 + font-size: 35rpx;
  162 + margin-bottom: 30rpx;
  163 +}
  164 +
  165 +.foot_box_remark.data-v-3a5b7e36 {
  166 + font-size: 27rpx;
  167 + line-height: 40rpx;
  168 +}
  169 +
  170 +.foot_empty.data-v-3a5b7e36 {
  171 + height: 90rpx;
  172 +}
  173 +
  174 +.foot_button.data-v-3a5b7e36 {
  175 + display: -webkit-box;
  176 + display: -webkit-flex;
  177 + display: flex;
  178 + margin: 20rpx 0rpx 0rpx 0rpx;
  179 + padding: 25rpx 0rpx;
  180 + background: #fff;
  181 + text-align: center;
  182 + -webkit-box-pack: center;
  183 + -webkit-justify-content: center;
  184 + justify-content: center;
  185 + position: fixed;
  186 + bottom: 0;
  187 + left: 0;
  188 + width: 100%;
  189 +}
  190 +
  191 +.foot_button_left.data-v-3a5b7e36 {
  192 + background: #e4010c;
  193 + color: #fff;
  194 + width: 250rpx;
  195 + height: 70rpx;
  196 + font-size: 28rpx;
  197 + line-height: 70rpx;
  198 + border-radius: 40rpx;
  199 + margin-right: 20rpx;
  200 +}
  201 +
  202 +.foot_button_right.data-v-3a5b7e36 {
  203 + background: #ffbb42;
  204 + color: #fff;
  205 + width: 250rpx;
  206 + height: 70rpx;
  207 + font-size: 28rpx;
  208 + line-height: 70rpx;
  209 + border-radius: 40rpx;
  210 +}
  211 +
  212 +.foot_button_buy.data-v-3a5b7e36 {
  213 + background: #e4010c;
  214 + color: #fff;
  215 + width: 400rpx;
  216 + height: 70rpx;
  217 + font-size: 28rpx;
  218 + line-height: 70rpx;
  219 + border-radius: 40rpx;
  220 +}
  221 +
  222 +.foot_button_intalge.data-v-3a5b7e36 {
  223 + background: #ffbb42;
  224 + color: #fff;
  225 + width: 400rpx;
  226 + height: 70rpx;
  227 + font-size: 28rpx;
  228 + line-height: 70rpx;
  229 + border-radius: 40rpx;
  230 +}
  231 +
  232 +page.data-v-3a5b7e36 {
  233 + background-color: #e85f93;
  234 +}
  235 +
  236 +.foot_box_remark.data-v-3a5b7e36 ._img {
  237 + width: 100%;
  238 +}
  239 +
  240 +.foot_box_remark.data-v-3a5b7e36 .img {
  241 + line-height: 0;
  242 +}
  243 +.overdue.data-v-3a5b7e36{
  244 + background-color: rgb(153,153,153);
  245 +}
  246 +
  247 +.foot_button_intalge.data-v-3a5b7e36.gray{ background-color: #aaa; }
  248 +
  249 +.xc-share-frame {
  250 + position: absolute; right:0; top: -10rpx;
  251 +}
  252 +
... ...
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/cart/cart2_inte/cart2_inte.js
... ... @@ -245,7 +245,7 @@ Page({
245 245 // let cartList= this.data.cartlist
246 246 // let cartList= arr
247 247 // let length = cartList.length
248   - if(this.data.is_pre_cut==0){
  248 + if(!this.data.is_pre_cut){
249 249 return {}
250 250 }
251 251 wx.showLoading({
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -198,7 +198,7 @@ Page({
198 198 // let cartList= this.data.cartlist
199 199 // let cartList= arr
200 200 // let length = cartList.length
201   - if(this.data.is_pre_cut==0){
  201 + if(!this.data.is_pre_cut){
202 202 return {}
203 203 }
204 204 wx.showLoading({
... ...
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() {
... ... @@ -2151,7 +2191,7 @@ Page({
2151 2191  
2152 2192 }
2153 2193  
2154   - if (th.data.prom_goods) {
  2194 + if (th.data.prom_goods && newd.prom_type!=4 && newd.prom_type!=6 ) {
2155 2195 var prom_d = th.data.prom_goods;
2156 2196 for (var i in prom_d) {
2157 2197 //判断活动有俩种条件,0元 1件
... ... @@ -2172,7 +2212,6 @@ Page({
2172 2212 }
2173 2213 }
2174 2214 }
2175   -
2176 2215 //如果有阶梯促销的时候
2177 2216 if(th.data.jieti_prom && (newd.prom_type==10 || newd.prom_type==0) ){
2178 2217 newd.prom_type = 10;
... ... @@ -6612,6 +6651,15 @@ Page({
6612 6651 var ind = ee.currentTarget.dataset.ind;
6613 6652 var bconfig = th.data.bconfig;
6614 6653  
  6654 + //--先判断会员状态--
  6655 + var user_info = getApp().globalData.userInfo;
  6656 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  6657 + wx.navigateTo({
  6658 + url: '/packageE/pages/togoin/togoin',
  6659 + })
  6660 + return false;
  6661 + }
  6662 +
6615 6663  
6616 6664 //如果开启了,则不在选择门店
6617 6665 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  
... ... @@ -561,6 +562,7 @@ Page({
561 562 getApp().globalData.no_clear = 1;
562 563 var url = "/pages/user/index/index";
563 564  
  565 + var userInfo = getApp().globalData.userInfo;
564 566 if (userInfo) {
565 567 url += "?first_leader=" + getApp().globalData.user_id;
566 568 }
... ...
pages/user/order_detail/order_detail.js
... ... @@ -1607,7 +1607,7 @@ Page({
1607 1607 }).then(res=>{
1608 1608 //-------如果购物车中有相关的数据-------
1609 1609 if (res.data.data.total > 0) {
1610   - b_cart_goods= res.data.data.pageData[0];
  1610 + b_cart_goods= res.data.data.pageData;
1611 1611 }
1612 1612 })
1613 1613  
... ... @@ -1617,14 +1617,14 @@ Page({
1617 1617 if(b_cart_goods) {
1618 1618 for (let jr = 0; jr < b_cart_goods.length; jr++) {
1619 1619 var b_cart_item = b_cart_goods[jr];
1620   - if (g_item.prom_type == 0) {
  1620 + if (!g_item.prom_type || g_item.prom_type == 0) {
1621 1621 if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) {
1622   - is_has = b_cart_item.id;
  1622 + is_has = b_cart_item;
1623 1623 break
1624 1624 }
1625 1625 } else {
1626 1626 if (b_cart_goods.prom_type == g_item.prom_type && b_cart_goods.prom_id == g_item.prom_id) {
1627   - is_has = b_cart_item.id;
  1627 + is_has = b_cart_item;
1628 1628 break
1629 1629 }
1630 1630 }
... ... @@ -1635,8 +1635,8 @@ Page({
1635 1635 //-- 如果就加入过购物车 --
1636 1636 if(is_has){
1637 1637 var updata = {
1638   - id: is_has,
1639   - goods_num: newd.goods_num + b_cart_goods.goods_num,
  1638 + id: is_has.id,
  1639 + goods_num: newd.goods_num + is_has.goods_num,
1640 1640 goods_price: newd.goods_price,
1641 1641 member_goods_price:newd.goods_price,
1642 1642 store_id: os.stoid,
... ...
pages/user/order_list/order_list.js
... ... @@ -1977,7 +1977,7 @@ Page({
1977 1977 var b_cart_item = b_cart_goods[jr];
1978 1978  
1979 1979  
1980   - if (g_item.prom_type == 0) {
  1980 + if (!g_item.prom_type || g_item.prom_type == 0) {
1981 1981 if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) {
1982 1982 is_has = b_cart_item;
1983 1983 break
... ...
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 }
... ...