From 27dfae193cf228dc582b5694f4de0c315ce79012 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Thu, 8 Jun 2023 12:26:38 +0800 Subject: [PATCH] 虚拟商品的优化 --- packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 51 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 2935434..c8e8c07 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -577,7 +577,7 @@ Page({ var sales_rules = e.sales_rules; //虚拟商品, 代发商品不计算 - if (!getApp().is_virtual(that.data.fir_goods) && !that.data.fir_goods.whsle_id && sales_rules >= 2) { + if (!that.data.fir_goods.whsle_id && sales_rules >= 2) { getApp().waitfor2(that, "wait_for_user_store", "fir_goods", function () { var lock = 0, plist = null; var gd = that.data.fir_goods; @@ -1674,7 +1674,7 @@ Page({ return false; } else { //---如果是线下门店销售的时候--- - if(!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { + if(!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { var pick = th.get_pick_from_list(th.data.sto_sele_id) //---通过接口获取门店的线下库存信息-- // getApp().request.get("/api/weshop/goods/getWareStorages", { @@ -1750,7 +1750,7 @@ Page({ newd.prom_id = 0; //---如果是线下门店销售的时候--- - if(!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { + if(!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { var pick = th.get_pick_from_list(th.data.sto_sele_id) @@ -2246,14 +2246,21 @@ Page({ } var e = th.data.sele_g.store_count; var p_type = parseInt(th.data.prom_type); //&& p_type!=1 && p_type!=4 - if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && + if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2 && ( [1,2,4,6,8,9].indexOf(p_type)==-1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { - if (!th.data.def_pick_store) { - wx.showModal({ title: '请选择门店', }); - return false; - } else { - e = th.data.def_pick_store.CanOutQty; + + //-- 如果是虚拟商品,默认给最大值 -- + if(getApp().is_virtual(th.data.sele_g)){ + e =100000; + }else{ + if (!th.data.def_pick_store) { + wx.showModal({ title: '请选择门店', }); + return false; + } else { + e = th.data.def_pick_store.CanOutQty; + } } + } if (!e) e = 0; //库存不足,不增加 @@ -2339,14 +2346,21 @@ Page({ var e = th.data.sele_g.store_count; var p_type = parseInt(th.data.prom_type); //&& p_type!=1 && p_type!=4 - if (!getApp().is_virtual(th.data.sele_g) && !th.data.sele_g.whsle_id && + if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2 && ([1,2,4,6,8,9].indexOf(p_type)== -1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { - if (!th.data.def_pick_store) { - wx.showModal({ title: '请选择门店', }); - return false; - } else { - e = th.data.def_pick_store.CanOutQty; + + //-- 如果是虚拟商品,默认给最大值 -- + if(getApp().is_virtual(th.data.sele_g)){ + e=100000; + }else{ + if (!th.data.def_pick_store) { + wx.showModal({ title: '请选择门店', }); + return false; + } else { + e = th.data.def_pick_store.CanOutQty; + } } + } if (!e) e = 0; //库存不足,不增加 @@ -4554,7 +4568,7 @@ Page({ } //---如果是线下门店销售的时候--- - if (!getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) { + if (th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) { var pick = th.get_pick_from_list(th.data.sto_sele_id) th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { @@ -4656,6 +4670,11 @@ Page({ var sales_rules = this.data.sales_rules; + //如果默认是商品 + if(getApp().is_virtual(goodsinfo)){ + return func(100000); + } + var lock_rq = { store_id: os.stoid, wareId: goodsinfo.goods_id, -- libgit2 0.21.4