Commit e44d50bb55a5b44e82194679789e1848d4e31430
1 parent
0875fe93
购物车金额显示, 订单列表。订单详情
Showing
5 changed files
with
16 additions
and
13 deletions
pages/cart/cart2/cart2.js
... | ... | @@ -540,7 +540,7 @@ Page({ |
540 | 540 | //--------循环计算总价----------- |
541 | 541 | for(var j=0;j<item.length;j++){ |
542 | 542 | o_price += item[j].goods_price * item[j].goods_num; |
543 | - th.data.cartlist[i].goods_price = o_price; //商品总费用 | |
543 | + th.data.cartlist[i].goods_price = o_price.toFixed(2); //商品总费用 | |
544 | 544 | //计算物流费用 |
545 | 545 | th.data.cartlist[i].shipping_price = 0; |
546 | 546 | //----------------如果是选择了物流--------------------- |
... | ... | @@ -574,6 +574,8 @@ Page({ |
574 | 574 | th.data.cartlist[i].shipping_price=0; |
575 | 575 | } |
576 | 576 | |
577 | + th.data.cartlist[i].shipping_price.toFixed(2); | |
578 | + | |
577 | 579 | //---如果有选择优惠券的情况下--- |
578 | 580 | var quan_price=0; |
579 | 581 | var coupon_price=0,bn_pick=th.data.bn_pick,pickid=cart_item.pickup_id; |
... | ... | @@ -599,8 +601,8 @@ Page({ |
599 | 601 | } |
600 | 602 | |
601 | 603 | //总价计算,总价不包含运费 |
602 | - th.data.cartlist[i].order_amount= o_price -quan_price; | |
603 | - th.data.cartlist[i].total_amount= o_price; | |
604 | + th.data.cartlist[i].order_amount= (o_price -quan_price).toFixed(2); | |
605 | + th.data.cartlist[i].total_amount= o_price.toFixed(2); | |
604 | 606 | |
605 | 607 | coupon_price=quan_price; |
606 | 608 | if( th.data.cartlist[i].order_amount<0){ |
... | ... | @@ -622,9 +624,9 @@ Page({ |
622 | 624 | } |
623 | 625 | } |
624 | 626 | |
625 | - | |
626 | - th.data.cartlist[i].coupon_price=coupon_price; | |
627 | - th.data.cartlist[i].goods_price = o_price; | |
627 | + th.data.cartlist[i].user_money = parseFloat(th.data.cartlist[i].user_money).toFixed(2); | |
628 | + th.data.cartlist[i].coupon_price=coupon_price.toFixed(2); | |
629 | + th.data.cartlist[i].goods_price = o_price.toFixed(2); | |
628 | 630 | th.data.cartlist[i].order_amount= th.data.cartlist[i].order_amount- th.data.cartlist[i].user_money; //会员使用余额 |
629 | 631 | |
630 | 632 | all_price += o_price; | ... | ... |
pages/order/refund_order/refund_order.js
... | ... | @@ -62,7 +62,7 @@ Page({ |
62 | 62 | }) |
63 | 63 | glist = glist.substring(0, glist.length-1); |
64 | 64 | console.log(glist); |
65 | - rq.post("/api/weshop/order/returngoods/save", { | |
65 | + rq.post("/api/weshop/order/returngoods/saveReturnGoods", { | |
66 | 66 | data: { |
67 | 67 | order_id: th.data.orderId, |
68 | 68 | order_sn: th.data.order_sn, | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -335,7 +335,7 @@ Page({ |
335 | 335 | success: function(tt) { |
336 | 336 | t.confirm && rq.put("/api/weshop/order/updatebyId", { |
337 | 337 | data: { |
338 | - order_id: a, order_status: 5 | |
338 | + order_id: order_id, order_status: 5 | |
339 | 339 | }, |
340 | 340 | success: function (t) { |
341 | 341 | getApp().my_warnning("删除成功",1,th); | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -249,17 +249,18 @@ Page({ |
249 | 249 | |
250 | 250 | //-----删除订单----- |
251 | 251 | deleteOrderData: function(t) { |
252 | + var th=this; | |
252 | 253 | var order_id=t.currentTarget.dataset.order_id; |
253 | 254 | wx.showModal({ |
254 | 255 | title: "是否取消订单?", |
255 | 256 | success: function(tt) { |
256 | - t.confirm && rq.put("/api/weshop/order/updatebyId", { | |
257 | + tt.confirm && rq.put("/api/weshop/order/updatebyId", { | |
257 | 258 | data: { |
258 | - order_id: a, order_status: 5 | |
259 | + order_id: order_id, order_status: 5 | |
259 | 260 | }, |
260 | 261 | success: function (t) { |
261 | - for (var e = 0; e < this.data.orderList.length; e++) if (this.data.orderList[e].order_id == t) { | |
262 | - this.data.orderList.splice(e, 1), this.setData({ | |
262 | + for (var e = 0; e < th.data.orderList.length; e++) if (th.data.orderList[e].order_id == order_id) { | |
263 | + th.data.orderList.splice(e, 1), th.setData({ | |
263 | 264 | orderList: this.data.orderList |
264 | 265 | }); |
265 | 266 | break; | ... | ... |
pages/user/return_goods/return_goods.js
... | ... | @@ -129,7 +129,7 @@ Page({ |
129 | 129 | var t = this,th=t; |
130 | 130 | this.checkSubmit(function() { |
131 | 131 | t.uploadPhotos(function() { |
132 | - a.post("/api/weshop/order/returngoods/save", { | |
132 | + a.post("/api/weshop/order/returngoods/saveReturnGoods", { | |
133 | 133 | /*--- |
134 | 134 | data: { |
135 | 135 | rec_id: t.data.recId, | ... | ... |