Commit 5d869d2c6dee37a6121e2b98b1abc058fcc449f9
1 parent
559eaece
指定门店选择的bug优化
Showing
1 changed file
with
36 additions
and
4 deletions
pages/goods/goodsInfo/goodsInfo.js
@@ -4003,7 +4003,32 @@ Page({ | @@ -4003,7 +4003,32 @@ Page({ | ||
4003 | } | 4003 | } |
4004 | 4004 | ||
4005 | var g_distr_type = th.data.sele_g.distr_type; | 4005 | var g_distr_type = th.data.sele_g.distr_type; |
4006 | - wx.hideLoading(); | 4006 | + wx.hideLoading() |
4007 | + | ||
4008 | + | ||
4009 | + /*--- 判断初始的用户的默认门店要不要弄进去 ---*/ | ||
4010 | + var fid=-1; | ||
4011 | + if(th.data.fir_def_store){ | ||
4012 | + var fid=e.data.data.pageData.findIndex((e)=>{ | ||
4013 | + return e.pickup_id==th.data.fir_def_store.pickup_id; | ||
4014 | + }) | ||
4015 | + } | ||
4016 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | ||
4017 | + if (th.data.fir_def_store && th.data.fir_def_store.pickup_id && fid<0 && | ||
4018 | + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | ||
4019 | + th.data.fir_def_store.CanOutQty = 0; | ||
4020 | + //--当选择的门店是客户默认的门店的时候-- | ||
4021 | + if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { | ||
4022 | + th.setData({ | ||
4023 | + def_pick_store: th.data.fir_def_store | ||
4024 | + }); | ||
4025 | + e.data.data.pageData.unshift(th.data.def_pick_store); | ||
4026 | + } else { | ||
4027 | + e.data.data.pageData.splice(1, 0, th.data.fir_def_store); | ||
4028 | + } | ||
4029 | + } | ||
4030 | + | ||
4031 | + | ||
4007 | 4032 | ||
4008 | //单总量超出10个的时候,同时门店有分类 | 4033 | //单总量超出10个的时候,同时门店有分类 |
4009 | if (e.data.data.total > 10 && e.his_cate_num) { | 4034 | if (e.data.data.total > 10 && e.his_cate_num) { |
@@ -4365,8 +4390,14 @@ Page({ | @@ -4365,8 +4390,14 @@ Page({ | ||
4365 | em.his_cate_num=e.his_cate_num; | 4390 | em.his_cate_num=e.his_cate_num; |
4366 | 4391 | ||
4367 | 4392 | ||
4393 | + var fid=-1; | ||
4394 | + if(th.data.fir_def_store){ | ||
4395 | + var fid=em.data.data.pageData.findIndex((e)=>{ | ||
4396 | + return e.pickup_id==th.data.fir_def_store.pickup_id; | ||
4397 | + }) | ||
4398 | + } | ||
4368 | //--如果找到默认门店,同时也应该判断配送方式对不对-- | 4399 | //--如果找到默认门店,同时也应该判断配送方式对不对-- |
4369 | - if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && | 4400 | + if (th.data.fir_def_store && th.data.fir_def_store.pickup_id && fid<0 && |
4370 | (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | 4401 | (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { |
4371 | th.data.fir_def_store.CanOutQty = 0; | 4402 | th.data.fir_def_store.CanOutQty = 0; |
4372 | //--当选择的门店是客户默认的门店的时候-- | 4403 | //--当选择的门店是客户默认的门店的时候-- |
@@ -7323,6 +7354,7 @@ Page({ | @@ -7323,6 +7354,7 @@ Page({ | ||
7323 | }) | 7354 | }) |
7324 | } | 7355 | } |
7325 | }, | 7356 | }, |
7357 | + | ||
7326 | //关闭选择门店 | 7358 | //关闭选择门店 |
7327 | close_popup: function (e) { | 7359 | close_popup: function (e) { |
7328 | var th = this; | 7360 | var th = this; |
@@ -7528,7 +7560,7 @@ Page({ | @@ -7528,7 +7560,7 @@ Page({ | ||
7528 | 7560 | ||
7529 | if (!item) return false; | 7561 | if (!item) return false; |
7530 | 7562 | ||
7531 | - if (item.is_no_dis_nor) { | 7563 | + if (item.is_no_dis_nor || (item.is_no_dis_act && !th.data.is_normal)){ |
7532 | wx.showToast({ | 7564 | wx.showToast({ |
7533 | title: "该门店不可售,请选择其他门店", | 7565 | title: "该门店不可售,请选择其他门店", |
7534 | icon: 'none', | 7566 | icon: 'none', |
@@ -8551,7 +8583,7 @@ Page({ | @@ -8551,7 +8583,7 @@ Page({ | ||
8551 | let item = f_more[i]; | 8583 | let item = f_more[i]; |
8552 | f_more[i].prom_id = item.act_id; | 8584 | f_more[i].prom_id = item.act_id; |
8553 | f_more[i].prom_type = 1; | 8585 | f_more[i].prom_type = 1; |
8554 | - | 8586 | + |
8555 | var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; | 8587 | var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; |
8556 | await getApp().request.promiseGet(url, {}).then(rs => { | 8588 | await getApp().request.promiseGet(url, {}).then(rs => { |
8557 | if (rs.data.code == 0 && rs.data.data) { | 8589 | if (rs.data.code == 0 && rs.data.data) { |