Commit a43c22124dca4d9861b63dc2702f736646004989
1 parent
99130e15
1、 搭配购门店选不到的优化
Showing
2 changed files
with
23 additions
and
19 deletions
packageA/pages/prom_list/prom_list.js
| @@ -241,20 +241,22 @@ Page({ | @@ -241,20 +241,22 @@ Page({ | ||
| 241 | }else{ | 241 | }else{ |
| 242 | ee.setData({ data: t.data.data, }); | 242 | ee.setData({ data: t.data.data, }); |
| 243 | } | 243 | } |
| 244 | - | ||
| 245 | - /*---获取活动的重表---*/ | ||
| 246 | - //调用接口判断订单优惠, | ||
| 247 | - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+ee.data.gid+"/2", {}).then(res => { | ||
| 248 | - if(res.data.code==0){ | ||
| 249 | - var r_data=res.data.data; | ||
| 250 | - th.loop_promise(0,r_data.collocationList,function(){ | ||
| 251 | - ee.setData({ | ||
| 252 | - collocationGoods:r_data.collocationPromList, | ||
| 253 | - collocationList:r_data.collocationList, | ||
| 254 | - }) | ||
| 255 | - }) | ||
| 256 | - } | ||
| 257 | - }) | 244 | + |
| 245 | + if(!ee.data.collocationList){ | ||
| 246 | + /*---获取活动的重表---*/ | ||
| 247 | + //调用接口判断订单优惠, | ||
| 248 | + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+ee.data.gid+"/2", {}).then(res => { | ||
| 249 | + if(res.data.code==0){ | ||
| 250 | + var r_data=res.data.data; | ||
| 251 | + th.loop_promise(0,r_data.collocationList,function(){ | ||
| 252 | + ee.setData({ | ||
| 253 | + collocationGoods:r_data.collocationPromList, | ||
| 254 | + collocationList:r_data.collocationList, | ||
| 255 | + }) | ||
| 256 | + }) | ||
| 257 | + } | ||
| 258 | + }) | ||
| 259 | + } | ||
| 258 | 260 | ||
| 259 | //获取统一条形码,普通商品和优惠促销的商品 | 261 | //获取统一条形码,普通商品和优惠促销的商品 |
| 260 | if ( t.data.data.prom_type == 5){ | 262 | if ( t.data.data.prom_type == 5){ |
| @@ -274,7 +276,7 @@ Page({ | @@ -274,7 +276,7 @@ Page({ | ||
| 274 | } | 276 | } |
| 275 | //---通过接口获取门店的线下库存信息-- | 277 | //---通过接口获取门店的线下库存信息-- |
| 276 | return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ | 278 | return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ |
| 277 | - data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid} | 279 | + data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid,pageSize:2000} |
| 278 | }) | 280 | }) |
| 279 | }).then(res=>{ | 281 | }).then(res=>{ |
| 280 | if(res.data.code==0 && res.data.data.total>0){ | 282 | if(res.data.code==0 && res.data.data.total>0){ |
| @@ -414,7 +416,7 @@ Page({ | @@ -414,7 +416,7 @@ Page({ | ||
| 414 | var pick=th.get_pick_from_list(th.data.sto_sele_id) | 416 | var pick=th.get_pick_from_list(th.data.sto_sele_id) |
| 415 | //---通过接口获取门店的线下库存信息-- | 417 | //---通过接口获取门店的线下库存信息-- |
| 416 | getApp().request.get("/api/weshop/goods/getWareStorages",{ | 418 | getApp().request.get("/api/weshop/goods/getWareStorages",{ |
| 417 | - data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}, | 419 | + data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid,pageSize:2000}, |
| 418 | success:function(res){ | 420 | success:function(res){ |
| 419 | if(res.data.code==0){ | 421 | if(res.data.code==0){ |
| 420 | if(res.data.data.pageData.length>0){ | 422 | if(res.data.data.pageData.length>0){ |
| @@ -943,7 +945,7 @@ Page({ | @@ -943,7 +945,7 @@ Page({ | ||
| 943 | } | 945 | } |
| 944 | //---通过接口获取门店的线下库存信息-- | 946 | //---通过接口获取门店的线下库存信息-- |
| 945 | return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ | 947 | return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ |
| 946 | - data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid} | 948 | + data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid,pageSize:2000} |
| 947 | }) | 949 | }) |
| 948 | }).then(res=>{ | 950 | }).then(res=>{ |
| 949 | if(res.data.code==0){ | 951 | if(res.data.code==0){ |
| @@ -1301,7 +1303,7 @@ Page({ | @@ -1301,7 +1303,7 @@ Page({ | ||
| 1301 | }) | 1303 | }) |
| 1302 | //读取线下的门店库存 | 1304 | //读取线下的门店库存 |
| 1303 | await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ | 1305 | await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ |
| 1304 | - data:{storageNos:item.pickup_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid} | 1306 | + data:{storageNos:item.pickup_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid,pageSize:2000} |
| 1305 | }).then(res=>{ | 1307 | }).then(res=>{ |
| 1306 | if(res.data.code==0 && res.data.data.total>0){ | 1308 | if(res.data.code==0 && res.data.data.total>0){ |
| 1307 | plist=res.data.data.pageData[0]; | 1309 | plist=res.data.data.pageData[0]; |
pages/cart/cart2/cart2.js
| @@ -2173,7 +2173,7 @@ Page({ | @@ -2173,7 +2173,7 @@ Page({ | ||
| 2173 | }) | 2173 | }) |
| 2174 | //读取线下的门店库存 | 2174 | //读取线下的门店库存 |
| 2175 | await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ | 2175 | await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{ |
| 2176 | - data:{storageNos:pick_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid} | 2176 | + data:{storageNos:pick_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid,pageSize:2000} |
| 2177 | }).then(res=>{ | 2177 | }).then(res=>{ |
| 2178 | if(res.data.code==0){ | 2178 | if(res.data.code==0){ |
| 2179 | plist=res.data.data.pageData[0]; | 2179 | plist=res.data.data.pageData[0]; |
| @@ -2848,8 +2848,10 @@ Page({ | @@ -2848,8 +2848,10 @@ Page({ | ||
| 2848 | //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { | 2848 | //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { |
| 2849 | //var arr=th.data.order_prom_list_cart; | 2849 | //var arr=th.data.order_prom_list_cart; |
| 2850 | var arr=order_prom_list_cart; | 2850 | var arr=order_prom_list_cart; |
| 2851 | + if(!arr) arr=[]; | ||
| 2851 | //如果系统有限制使用优惠券 | 2852 | //如果系统有限制使用优惠券 |
| 2852 | if(th.data.is_close_quan) return false; | 2853 | if(th.data.is_close_quan) return false; |
| 2854 | + | ||
| 2853 | //------------开始计算使用优惠券相关------------ | 2855 | //------------开始计算使用优惠券相关------------ |
| 2854 | for(var ind in arr){ | 2856 | for(var ind in arr){ |
| 2855 | var ep=arr[ind]; | 2857 | var ep=arr[ind]; |