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,7 +540,7 @@ Page({ | ||
540 | //--------循环计算总价----------- | 540 | //--------循环计算总价----------- |
541 | for(var j=0;j<item.length;j++){ | 541 | for(var j=0;j<item.length;j++){ |
542 | o_price += item[j].goods_price * item[j].goods_num; | 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 | th.data.cartlist[i].shipping_price = 0; | 545 | th.data.cartlist[i].shipping_price = 0; |
546 | //----------------如果是选择了物流--------------------- | 546 | //----------------如果是选择了物流--------------------- |
@@ -574,6 +574,8 @@ Page({ | @@ -574,6 +574,8 @@ Page({ | ||
574 | th.data.cartlist[i].shipping_price=0; | 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 | var quan_price=0; | 580 | var quan_price=0; |
579 | var coupon_price=0,bn_pick=th.data.bn_pick,pickid=cart_item.pickup_id; | 581 | var coupon_price=0,bn_pick=th.data.bn_pick,pickid=cart_item.pickup_id; |
@@ -599,8 +601,8 @@ Page({ | @@ -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 | coupon_price=quan_price; | 607 | coupon_price=quan_price; |
606 | if( th.data.cartlist[i].order_amount<0){ | 608 | if( th.data.cartlist[i].order_amount<0){ |
@@ -622,9 +624,9 @@ Page({ | @@ -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 | th.data.cartlist[i].order_amount= th.data.cartlist[i].order_amount- th.data.cartlist[i].user_money; //会员使用余额 | 630 | th.data.cartlist[i].order_amount= th.data.cartlist[i].order_amount- th.data.cartlist[i].user_money; //会员使用余额 |
629 | 631 | ||
630 | all_price += o_price; | 632 | all_price += o_price; |
pages/order/refund_order/refund_order.js
@@ -62,7 +62,7 @@ Page({ | @@ -62,7 +62,7 @@ Page({ | ||
62 | }) | 62 | }) |
63 | glist = glist.substring(0, glist.length-1); | 63 | glist = glist.substring(0, glist.length-1); |
64 | console.log(glist); | 64 | console.log(glist); |
65 | - rq.post("/api/weshop/order/returngoods/save", { | 65 | + rq.post("/api/weshop/order/returngoods/saveReturnGoods", { |
66 | data: { | 66 | data: { |
67 | order_id: th.data.orderId, | 67 | order_id: th.data.orderId, |
68 | order_sn: th.data.order_sn, | 68 | order_sn: th.data.order_sn, |
pages/user/order_detail/order_detail.js
@@ -335,7 +335,7 @@ Page({ | @@ -335,7 +335,7 @@ Page({ | ||
335 | success: function(tt) { | 335 | success: function(tt) { |
336 | t.confirm && rq.put("/api/weshop/order/updatebyId", { | 336 | t.confirm && rq.put("/api/weshop/order/updatebyId", { |
337 | data: { | 337 | data: { |
338 | - order_id: a, order_status: 5 | 338 | + order_id: order_id, order_status: 5 |
339 | }, | 339 | }, |
340 | success: function (t) { | 340 | success: function (t) { |
341 | getApp().my_warnning("删除成功",1,th); | 341 | getApp().my_warnning("删除成功",1,th); |
pages/user/order_list/order_list.js
@@ -249,17 +249,18 @@ Page({ | @@ -249,17 +249,18 @@ Page({ | ||
249 | 249 | ||
250 | //-----删除订单----- | 250 | //-----删除订单----- |
251 | deleteOrderData: function(t) { | 251 | deleteOrderData: function(t) { |
252 | + var th=this; | ||
252 | var order_id=t.currentTarget.dataset.order_id; | 253 | var order_id=t.currentTarget.dataset.order_id; |
253 | wx.showModal({ | 254 | wx.showModal({ |
254 | title: "是否取消订单?", | 255 | title: "是否取消订单?", |
255 | success: function(tt) { | 256 | success: function(tt) { |
256 | - t.confirm && rq.put("/api/weshop/order/updatebyId", { | 257 | + tt.confirm && rq.put("/api/weshop/order/updatebyId", { |
257 | data: { | 258 | data: { |
258 | - order_id: a, order_status: 5 | 259 | + order_id: order_id, order_status: 5 |
259 | }, | 260 | }, |
260 | success: function (t) { | 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 | orderList: this.data.orderList | 264 | orderList: this.data.orderList |
264 | }); | 265 | }); |
265 | break; | 266 | break; |
pages/user/return_goods/return_goods.js
@@ -129,7 +129,7 @@ Page({ | @@ -129,7 +129,7 @@ Page({ | ||
129 | var t = this,th=t; | 129 | var t = this,th=t; |
130 | this.checkSubmit(function() { | 130 | this.checkSubmit(function() { |
131 | t.uploadPhotos(function() { | 131 | t.uploadPhotos(function() { |
132 | - a.post("/api/weshop/order/returngoods/save", { | 132 | + a.post("/api/weshop/order/returngoods/saveReturnGoods", { |
133 | /*--- | 133 | /*--- |
134 | data: { | 134 | data: { |
135 | rec_id: t.data.recId, | 135 | rec_id: t.data.recId, |