Commit b9524dd2aabb7391582cf90599452b029a36b2ac

Authored by 后端研发-苏明海
2 parents aa56208e ae653f2f

Merge branch 'test' into 'qa'

Test

See merge request !31
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/goods/goodsInfo/goodsInfo.wxss
@@ -2229,5 +2229,5 @@ right:17rpx; top:55rpx; @@ -2229,5 +2229,5 @@ right:17rpx; top:55rpx;
2229 .no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx} 2229 .no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx}
2230 2230
2231 .join-cart>view.no_store { 2231 .join-cart>view.no_store {
2232 - width: 58%; 2232 + width: 58%; background-color: #adadad;
2233 } 2233 }
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
@@ -108,6 +108,8 @@ Page({ @@ -108,6 +108,8 @@ Page({
108 //2.退款被拒绝就要显示可以退款 108 //2.退款被拒绝就要显示可以退款
109 //3.退款已经完成 109 //3.退款已经完成
110 r['is_all_return'] = 0; 110 r['is_all_return'] = 0;
  111 + var rt_ok_num=0;
  112 +
111 if(r['order_status'] == 1 && r['pay_status'] == 1) { 113 if(r['order_status'] == 1 && r['pay_status'] == 1) {
112 goodslist.forEach(function (eeb, iii) { 114 goodslist.forEach(function (eeb, iii) {
113 goodslist[iii]['return_btn'] = 1; 115 goodslist[iii]['return_btn'] = 1;
@@ -120,7 +122,7 @@ Page({ @@ -120,7 +122,7 @@ Page({
120 case 1://退款处理中 122 case 1://退款处理中
121 goodslist[iii]['return_btn'] = 2; break; 123 goodslist[iii]['return_btn'] = 2; break;
122 case 2://退款完成 124 case 2://退款完成
123 - goodslist[iii]['return_btn'] = 4; break; 125 + goodslist[iii]['return_btn'] = 4;rt_ok_num++; break;
124 case 3://已拒绝,重新退款 126 case 3://已拒绝,重新退款
125 goodslist[iii]['return_btn'] = 3; break; 127 goodslist[iii]['return_btn'] = 3; break;
126 default: 128 default:
@@ -134,6 +136,10 @@ Page({ @@ -134,6 +136,10 @@ Page({
134 } 136 }
135 } 137 }
136 138
  139 + //--如果是全部退款,也就可以删除--
  140 + if(rt_ok_num==goodslist.length){
  141 + r['is_all_return_status']=2;
  142 + }
137 r['order_goods'] = goodslist; 143 r['order_goods'] = goodslist;
138 var g_num = 0; 144 var g_num = 0;
139 goodslist.forEach(function (ee, ii) { 145 goodslist.forEach(function (ee, ii) {
@@ -320,6 +326,28 @@ Page({ @@ -320,6 +326,28 @@ Page({
320 }); 326 });
321 }, 327 },
322 328
  329 + //-----删除订单-----
  330 + deleteOrderData: function(t) {
  331 + var th=this;
  332 + var order_id=t.currentTarget.dataset.order_id;
  333 + wx.showModal({
  334 + title: "是否取消订单?",
  335 + success: function(tt) {
  336 + t.confirm && rq.put("/api/weshop/order/updatebyId", {
  337 + data: {
  338 + order_id: order_id, order_status: 5
  339 + },
  340 + success: function (t) {
  341 + getApp().my_warnning("删除成功",1,th);
  342 + setTimeout(function () {
  343 + getApp().goto("/pages/user/order_list/order_list");
  344 + },1000);
  345 + }
  346 + })
  347 + }
  348 + });
  349 + },
  350 +
323 351
324 352
325 }); 353 });
326 \ No newline at end of file 354 \ No newline at end of file
pages/user/order_detail/order_detail.json
1 { 1 {
2 "navigationBarTitleText": "订单详情", 2 "navigationBarTitleText": "订单详情",
3 - "enablePullDownRefresh": false 3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
4 } 7 }
5 \ No newline at end of file 8 \ No newline at end of file
pages/user/order_detail/order_detail.wxml
@@ -140,9 +140,12 @@ @@ -140,9 +140,12 @@
140 <navigator class="tips-btn" hidden="{{!(order.order_status==1&&order.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{order.order_id}}">申请退款</navigator> 140 <navigator class="tips-btn" hidden="{{!(order.order_status==1&&order.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{order.order_id}}">申请退款</navigator>
141 </block> 141 </block>
142 <block wx:else> 142 <block wx:else>
  143 + <view class="tips-btn" wx:if="{{order.is_all_return_status==2}}" bindtap="deleteOrderData" order_id="{{order.order_id}}" >删除订单</view>
143 <navigator class="tips-btn" wx:if="{{order.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{order.order_id}}">重新退款</navigator> 144 <navigator class="tips-btn" wx:if="{{order.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{order.order_id}}">重新退款</navigator>
144 <navigator class="tips-btn" wx:if="{{order.is_all_return_status==0 || order.is_all_return_status==1}}" 145 <navigator class="tips-btn" wx:if="{{order.is_all_return_status==0 || order.is_all_return_status==1}}"
145 url="/pages/user/return_goods_info/return_goods_info?order_id={{order.order_id}}">退款详情</navigator> 146 url="/pages/user/return_goods_info/return_goods_info?order_id={{order.order_id}}">退款详情</navigator>
146 </block> 147 </block>
147 </view> 148 </view>
148 </view> 149 </view>
  150 +
  151 +<warn id="warn"></warn>
pages/user/order_list/order_list.js
@@ -31,11 +31,12 @@ Page({ @@ -31,11 +31,12 @@ Page({
31 }, 31 },
32 onLoad: function(t) { 32 onLoad: function(t) {
33 var e = void 0 === t.type ? this.data.activeCategoryId : t.type; 33 var e = void 0 === t.type ? this.data.activeCategoryId : t.type;
34 - s.init(this, "", "orderList"), this.requestOrderList(e), wx.removeStorageSync("order:order_list:update"); 34 + s.init(this, "", "orderList");
  35 + //this.requestOrderList(e), wx.removeStorageSync("order:order_list:update");
35 }, 36 },
36 onShow: function() { 37 onShow: function() {
37 - wx.getStorageSync("order:order_list:update") && (wx.setStorageSync("order:order_list:update", !1),  
38 - this.resetData(), this.requestOrderList(this.data.activeCategoryId)); 38 + //wx.getStorageSync("order:order_list:update") && (wx.setStorageSync("order:order_list:update", !1),
  39 + this.resetData(), this.requestOrderList(this.data.activeCategoryId);
39 }, 40 },
40 changeTab: function(t) { 41 changeTab: function(t) {
41 this.resetData(), this.requestOrderList(t.currentTarget.id); 42 this.resetData(), this.requestOrderList(t.currentTarget.id);
@@ -46,7 +47,8 @@ Page({ @@ -46,7 +47,8 @@ Page({
46 47
47 /*---------获取订单列表--------*/ 48 /*---------获取订单列表--------*/
48 requestOrderList: function(t) { 49 requestOrderList: function(t) {
49 - var e = this,th=e, r = e.data.url + "/api/weshop/order/page?1=1", a = ""; 50 + var rd=Math.random()*100;
  51 + var e = this,th=e, r = e.data.url + "/api/weshop/order/page?rd="+rd, a = "";
50 switch(t){ 52 switch(t){
51 case "1": 53 case "1":
52 r += "&wait_status=0"; break; 54 r += "&wait_status=0"; break;
@@ -116,6 +118,8 @@ Page({ @@ -116,6 +118,8 @@ Page({
116 //2.退款被拒绝就要显示可以退款 118 //2.退款被拒绝就要显示可以退款
117 //3.退款已经完成 119 //3.退款已经完成
118 data[ind]['is_all_return'] = 0; 120 data[ind]['is_all_return'] = 0;
  121 + var rt_ok_num=0;
  122 +
119 if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { 123 if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) {
120 goodslist.forEach(function (eeb, iii) { 124 goodslist.forEach(function (eeb, iii) {
121 goodslist[iii]['return_btn'] = 1; 125 goodslist[iii]['return_btn'] = 1;
@@ -128,7 +132,7 @@ Page({ @@ -128,7 +132,7 @@ Page({
128 case 1://退款处理中 132 case 1://退款处理中
129 goodslist[iii]['return_btn'] = 2; break; 133 goodslist[iii]['return_btn'] = 2; break;
130 case 2://退款完成 134 case 2://退款完成
131 - goodslist[iii]['return_btn'] = 4; break; 135 + goodslist[iii]['return_btn'] = 4; rt_ok_num++; break;
132 case 3://已拒绝,重新退款 136 case 3://已拒绝,重新退款
133 goodslist[iii]['return_btn'] = 3; break; 137 goodslist[iii]['return_btn'] = 3; break;
134 default: 138 default:
@@ -141,6 +145,11 @@ Page({ @@ -141,6 +145,11 @@ Page({
141 } 145 }
142 } 146 }
143 } 147 }
  148 +
  149 + //--如果是全部退款,也就可以删除--
  150 + if(rt_ok_num==goodslist.length){
  151 + data[ind]['is_all_return_status']=2;
  152 + }
144 153
145 data[ind]['order_goods'] = goodslist; 154 data[ind]['order_goods'] = goodslist;
146 var g_num = 0; 155 var g_num = 0;
@@ -240,12 +249,26 @@ Page({ @@ -240,12 +249,26 @@ Page({
240 249
241 //-----删除订单----- 250 //-----删除订单-----
242 deleteOrderData: function(t) { 251 deleteOrderData: function(t) {
243 - for (var e = 0; e < this.data.orderList.length; e++) if (this.data.orderList[e].order_id == t) {  
244 - this.data.orderList.splice(e, 1), this.setData({  
245 - orderList: this.data.orderList  
246 - });  
247 - break;  
248 - } 252 + var th=this;
  253 + var order_id=t.currentTarget.dataset.order_id;
  254 + wx.showModal({
  255 + title: "是否取消订单?",
  256 + success: function(tt) {
  257 + tt.confirm && rq.put("/api/weshop/order/updatebyId", {
  258 + data: {
  259 + order_id: order_id, order_status: 5
  260 + },
  261 + success: function (t) {
  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({
  264 + orderList: this.data.orderList
  265 + });
  266 + break;
  267 + }
  268 + }
  269 + })
  270 + }
  271 + });
249 }, 272 },
250 273
251 //---判断是不是有退款----- 274 //---判断是不是有退款-----
pages/user/order_list/order_list.wxml
@@ -83,6 +83,7 @@ @@ -83,6 +83,7 @@
83 <navigator class="order-btn" hidden="{{!(item.order_status==1&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> 83 <navigator class="order-btn" hidden="{{!(item.order_status==1&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator>
84 </block> 84 </block>
85 <block wx:else> 85 <block wx:else>
  86 + <view class="order-btn" wx:if="{{item.is_all_return_status==2}}" bindtap="deleteOrderData" data-order_id="{{item.order_id}}" >删除订单</view>
86 <navigator class="order-btn" wx:if="{{item.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator> 87 <navigator class="order-btn" wx:if="{{item.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator>
87 <navigator class="order-btn" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}" 88 <navigator class="order-btn" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}"
88 url="/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator> 89 url="/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator>
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,