Commit be895886d3e93bed3cd42c3d2cd83fe2a95ad75a

Authored by 后端研发-苏明海
2 parents ab16f4f3 345d37fc

Merge branch 'dev' into 'test'

Dev

See merge request !444
pages/cart/cart2/cart2.js
@@ -481,6 +481,12 @@ Page({ @@ -481,6 +481,12 @@ Page({
481 if(gg.prom_type==5){ 481 if(gg.prom_type==5){
482 t.data.data.prom_id = gg.prom_id ; 482 t.data.data.prom_id = gg.prom_id ;
483 t.data.data.prom_type =5; 483 t.data.data.prom_type =5;
  484 +
  485 + //--主商品要有导购id和导购类型--
  486 + if(gg.guide_id){
  487 + t.data.data.guide_id=gg.guide_id;
  488 + t.data.data.guide_type=gg.guide_type;
  489 + }
484 th.setData({collocation_goods:gg.collocation_goods}); 490 th.setData({collocation_goods:gg.collocation_goods});
485 491
486 var cart_arr=new Array(); 492 var cart_arr=new Array();
@@ -1649,7 +1655,6 @@ Page({ @@ -1649,7 +1655,6 @@ Page({
1649 if (pdata.length==0) return; 1655 if (pdata.length==0) return;
1650 var str = JSON.stringify(pdata); 1656 var str = JSON.stringify(pdata);
1651 1657
1652 -  
1653 wx.showLoading({title: "加载中"}); 1658 wx.showLoading({title: "加载中"});
1654 wx.request({ 1659 wx.request({
1655 url: oo.url + '/api/weshop/order/createWxdOrder', 1660 url: oo.url + '/api/weshop/order/createWxdOrder',
pages/goods/goodsInfo/goodsInfo.js
@@ -370,72 +370,76 @@ Page({ @@ -370,72 +370,76 @@ Page({
370 th.data.fir_def_store={}; //赋值空对象 370 th.data.fir_def_store={}; //赋值空对象
371 return false; 371 return false;
372 } 372 }
373 - var g_distr_type=th.data.data.distr_type;  
374 373
375 - //--如果默认门店的配送方式不对,就不能被选择--  
376 - if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){  
377 - th.data.fir_def_store={}; //赋值空对象  
378 - return false;  
379 - } 374 + //--定时器推迟一下--
  375 + setTimeout(function () {
  376 + var g_distr_type=th.data.data.distr_type;
  377 + //--如果默认门店的配送方式不对,就不能被选择--
  378 + if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){
  379 + th.data.fir_def_store={}; //赋值空对象
  380 + return false;
  381 + }
  382 +
  383 + var appd=getApp().globalData;
  384 + var w_time = setInterval(function() {
  385 + if (that.data.is_get_local_ok == 0) return false;
  386 + clearInterval(w_time);
  387 + var distance = null;
  388 + var e=JSON.parse(JSON.stringify(ee));
  389 +
  390 + //如果有开启近距离的话,同时距离优不一样了
  391 + if (that.data.lat != null) {
  392 + //如果经纬度有变化的话
  393 + if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
  394 + that.data.fir_def_store=e;
  395 + that.setData({
  396 + def_pick_store: e,
  397 + sto_sele_name: e.pickup_name,
  398 + sto_sele_id: e.pickup_id,
  399 + sto_sele_distr: e.distr_type
  400 + })
  401 + }else{
  402 + //要用接口是获取距离,js的计算不准
  403 + getApp().request.promiseGet("/api/weshop/pickup/list",{
  404 + data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon},
  405 + }).then(res=>{
  406 + if(res.data.code==0){
  407 + e=res.data.data.pageData[0];
  408 + if (e){
  409 + appd.pk_store=e;
  410 + that.data.fir_def_store=e;
  411 + that.setData({
  412 + def_pick_store: e,
  413 + sto_sele_name: e.pickup_name,
  414 + sto_sele_id: e.pickup_id,
  415 + sto_sele_distr: e.distr_type
  416 + })
  417 + }
  418 +
  419 + }
  420 + })
  421 + }
  422 +
  423 + //e.distance = distance;
  424 + appd.lat=that.data.lat;
  425 + appd.lon=that.data.lon;
  426 +
  427 + }else{
  428 + if (e) {
  429 + e.distance = null;
  430 + that.data.fir_def_store=e;
  431 + that.setData({
  432 + def_pick_store: e,
  433 + sto_sele_name: e.pickup_name,
  434 + sto_sele_id: e.pickup_id,
  435 + sto_sele_distr: e.distr_type
  436 + })
  437 + }
  438 + }
  439 +
  440 + }, 500)
  441 + },1000)
380 442
381 - var appd=getApp().globalData;  
382 - var w_time = setInterval(function() {  
383 - if (that.data.is_get_local_ok == 0) return false;  
384 - clearInterval(w_time);  
385 - var distance = null;  
386 - var e=JSON.parse(JSON.stringify(ee));  
387 -  
388 - //如果有开启近距离的话,同时距离优不一样了  
389 - if (that.data.lat != null) {  
390 - //如果经纬度有变化的话  
391 - if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){  
392 - that.data.fir_def_store=e;  
393 - that.setData({  
394 - def_pick_store: e,  
395 - sto_sele_name: e.pickup_name,  
396 - sto_sele_id: e.pickup_id,  
397 - sto_sele_distr: e.distr_type  
398 - })  
399 - }else{  
400 - //要用接口是获取距离,js的计算不准  
401 - getApp().request.promiseGet("/api/weshop/pickup/list",{  
402 - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon},  
403 - }).then(res=>{  
404 - if(res.data.code==0){  
405 - e=res.data.data.pageData[0];  
406 - if (e){  
407 - appd.pk_store=e;  
408 - that.data.fir_def_store=e;  
409 - that.setData({  
410 - def_pick_store: e,  
411 - sto_sele_name: e.pickup_name,  
412 - sto_sele_id: e.pickup_id,  
413 - sto_sele_distr: e.distr_type  
414 - })  
415 - }  
416 -  
417 - }  
418 - })  
419 - }  
420 -  
421 - //e.distance = distance;  
422 - appd.lat=that.data.lat;  
423 - appd.lon=that.data.lon;  
424 -  
425 - }else{  
426 - if (e) {  
427 - e.distance = null;  
428 - that.data.fir_def_store=e;  
429 - that.setData({  
430 - def_pick_store: e,  
431 - sto_sele_name: e.pickup_name,  
432 - sto_sele_id: e.pickup_id,  
433 - sto_sele_distr: e.distr_type  
434 - })  
435 - }  
436 - }  
437 -  
438 - }, 500)  
439 }); 443 });
440 444
441 }, 445 },
pages/goods/goodsInfo/goodsInfo.wxml
@@ -344,7 +344,8 @@ @@ -344,7 +344,8 @@
344 <view class="word-line fs24 xc-unit-price">零售价¥{{data.market_price}}</view> 344 <view class="word-line fs24 xc-unit-price">零售价¥{{data.market_price}}</view>
345 </view> 345 </view>
346 <view class="xc-val-price"> 346 <view class="xc-val-price">
347 - <view class="fs30" style='padding-left:13rpx;'>已抢:{{prom_act.buy_num+prom_act.virtual}}件</view> 347 + <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view>
  348 + <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view>
348 <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view> 349 <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view>
349 </view> 350 </view>
350 </view> 351 </view>