Commit 0e0c21486f37bd793b441c9cbbc82ee816e36325
1 parent
f89865a6
支付方式不一致,那么购物车就要清空
Showing
1 changed file
with
14 additions
and
2 deletions
packageE/pages/cart/cart2/cart2.js
@@ -5326,9 +5326,21 @@ Page({ | @@ -5326,9 +5326,21 @@ Page({ | ||
5326 | submit: 0, | 5326 | submit: 0, |
5327 | }) | 5327 | }) |
5328 | if(data.code==-2){ | 5328 | if(data.code==-2){ |
5329 | - setTimeout(()=>{ | 5329 | + |
5330 | + | ||
5331 | + //-- 如果是购物车结算,还要删除购物车 -- | ||
5332 | + if (th.data.is_b_now == 0) { | ||
5333 | + console.log(th.data.cartlist_y); | ||
5334 | + var list =JSON.parse(JSON.stringify(th.data.cartlist_y)); | ||
5335 | + for (var i = 0; i < list.length; i++) { | ||
5336 | + //删除购物车 | ||
5337 | + a.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {}); | ||
5338 | + } | ||
5339 | + } | ||
5340 | + | ||
5341 | + setTimeout(()=>{ | ||
5330 | getApp().re_to('/pages/user/order_list/order_list') | 5342 | getApp().re_to('/pages/user/order_list/order_list') |
5331 | - },1300) | 5343 | + },1300) |
5332 | 5344 | ||
5333 | } | 5345 | } |
5334 | 5346 |