Commit 954e6c449e546b7fbea672e9e007e519e3dffa43

Authored by yvan.ni
1 parent 138c7e16

商品详情的优化

pages/goods/goodsInfo/goodsInfo.js
... ... @@ -3593,30 +3593,41 @@ Page({
3593 3593  
3594 3594 //判断会员的默认的门店是不是匹配指定的门店
3595 3595 if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){
3596   -
3597 3596 //-- 查找一下门店有没有在 --
3598 3597 var idx1=pickup_ids.findIndex(function (e){
3599 3598 return e.pickup_id==th.data.def_pick_store.pickup_id;
3600 3599 })
3601 3600  
3602 3601 if(idx1<0){
3603   - th.data.def_pick_store.is_no_dis_nor=1;
3604 3602 //如果是秒杀的指定门店,就要设置秒杀的
3605 3603 if(!is_normal && (th.data.prom_type==1 || th.data.prom_type==6) ){
3606 3604 th.data.def_pick_store.is_no_dis_act=1;
3607 3605 }else{
3608 3606 th.data.def_pick_store.is_no_dis_nor=1;
3609 3607 }
3610   - that.setData({
3611   - def_pick_store: th.data.def_pick_store
3612   - })
  3608 + }else{
  3609 + th.data.def_pick_store.is_no_dis_nor=0;
  3610 + th.data.def_pick_store.is_no_dis_act=0;
3613 3611 }
3614   - }
3615   -
3616 3612  
  3613 + that.setData({
  3614 + def_pick_store: th.data.def_pick_store
  3615 + })
  3616 + }
3617 3617 e.data.data.pageData=ok_arr; //数组重新赋值
3618 3618 e.data.data.total=ok_arr.length; //数组的长度
3619 3619 }
  3620 + else{
  3621 + //-- 多规格指定门店优化 --
  3622 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){
  3623 + th.data.def_pick_store.is_no_dis_nor=0;
  3624 + th.data.def_pick_store.is_no_dis_act=0;
  3625 + that.setData({
  3626 + def_pick_store: th.data.def_pick_store
  3627 + })
  3628 + }
  3629 +
  3630 + }
3620 3631  
3621 3632 var his_cate_num = 0;
3622 3633 for (let i in e.data.data.pageData) {
... ... @@ -8457,11 +8468,19 @@ Page({
8457 8468 if (arr.length == 1) {
8458 8469 th.data.prom_type = arr[0].prom_type;
8459 8470 th.data.prom_id = arr[0].act_id;
  8471 + //-- 基础的活动类型 --
  8472 + th.data.base_nor_prom_type = arr[0].prom_type;
  8473 + th.data.base_nor_prom_id = arr[0].act_id;
  8474 +
8460 8475 }
8461 8476 //-- 如果只有一个进行中的活动的话 --
8462 8477 else if (arr2.length == 1) {
8463 8478 th.data.prom_type = arr2[0].prom_type;
8464 8479 th.data.prom_id = arr2[0].act_id;
  8480 +
  8481 + //-- 基础的活动类型 --
  8482 + th.data.base_nor_prom_type = arr[0].prom_type;
  8483 + th.data.base_nor_prom_id = arr[0].act_id;
8465 8484 }
8466 8485  
8467 8486 if (arr4.length > 0) {
... ...