Browse Source

修改nug

cr 4 years ago
parent
commit
a128242d60
5 changed files with 93 additions and 60 deletions
  1. 1 1
      releaselog.md
  2. 20 22
      src/pages/index/difference.vue
  3. 1 1
      src/pages/index/index.vue
  4. 70 35
      src/pages/index/refund.vue
  5. 1 1
      src/pages/manage/index.vue

+ 1 - 1
releaselog.md

@@ -1,5 +1,5 @@
1 1
 
2
-# 0.3.2 (20.12.4 11:00)
2
+# 0.3.2 (20.12.4 11:00)  0.3.21
3 3
 ### 修改bug
4 4
 
5 5
 # 0.3.1 (20.12.3 18:00)

+ 20 - 22
src/pages/index/difference.vue

@@ -54,15 +54,21 @@
54 54
                                     item.refundAmount | minuteToRmb
55 55
                                 }}
56 56
                             </div>
57
-                            <div class="">已退重量:{{item.actualPickingWeight || '0'}}g</div>
57
+                            <div class="">
58
+                                已退重量:{{ item.actualPickingWeight || "0" }}g
59
+                            </div>
58 60
                         </div>
59 61
                     </div>
60 62
                 </label>
61 63
             </checkbox-group>
62 64
         </div>
63 65
         <div class="btn-box">
64
-            <span class="btn"  v-if="!allInvalid" @click="disparity">退差价</span>
65
-            <span class="btn allInvalid" v-if="allInvalid">没有可退差价商品</span>
66
+            <span class="btn" v-if="!allInvalid" @click="disparity"
67
+                >退差价</span
68
+            >
69
+            <span class="btn allInvalid" v-if="allInvalid"
70
+                >没有可退差价商品</span
71
+            >
66 72
         </div>
67 73
     </div>
68 74
 </template>
@@ -81,7 +87,7 @@ export default {
81 87
             curReason: "",
82 88
             curGoodItemIds: [],
83 89
             submitLoading: false,
84
-            allInvalid:false,
90
+            allInvalid: false,
85 91
         };
86 92
     },
87 93
 
@@ -120,13 +126,13 @@ export default {
120 126
                     }
121 127
                 }
122 128
             }
123
-            let num =0;
124
-            for(let item of d.orderItems){
125
-                if(item.invalid){
129
+            let num = 0;
130
+            for (let item of d.orderItems) {
131
+                if (item.invalid) {
126 132
                     num++;
127 133
                 }
128 134
             }
129
-            if(num === d.orderItems.length){
135
+            if (num === d.orderItems.length) {
130 136
                 this.allInvalid = true;
131 137
             }
132 138
             d.orderItems.sort((a, b) => (a.invalid ? 1 : -1));
@@ -218,18 +224,6 @@ export default {
218 224
         user() {
219 225
             return this.$store.state.user.user;
220 226
         },
221
-        refundNum() {
222
-            let num = 0;
223
-            for (let id of this.curGoodItemIds) {
224
-                for (let item of this.orderData.orderItems) {
225
-                    if (item.id === id) {
226
-                        num += item.payAmount;
227
-                    }
228
-                }
229
-            }
230
-            num = num.toFixed(2);
231
-            return num;
232
-        },
233 227
     },
234 228
 
235 229
     // 数据监听
@@ -279,7 +273,7 @@ export default {
279 273
         background-color: #f3f3f3;
280 274
         color: #666;
281 275
     }
282
-    .allInvalid{
276
+    .allInvalid {
283 277
         background-color: #e9e9e9;
284 278
         color: #666;
285 279
     }
@@ -294,6 +288,10 @@ export default {
294 288
         border-bottom: 1px solid #f1f1f1;
295 289
         &.invalid {
296 290
             background-color: #efefef;
291
+
292
+            .difference {
293
+                background-color: #e9e9e9;
294
+            }
297 295
         }
298 296
     }
299 297
     .check {
@@ -389,7 +387,7 @@ export default {
389 387
     display: flex;
390 388
     justify-content: space-between;
391 389
     align-items: center;
392
-    background-color: #e9e9e9;
390
+    background-color: #efefef;
393 391
     color: #666;
394 392
     padding: px(20) px(10);
395 393
     font-size: px(38);

+ 1 - 1
src/pages/index/index.vue

@@ -369,7 +369,7 @@
369 369
                                     </ul>
370 370
                                 </div>
371 371
 
372
-                                <div class="order__btns" v-if="tab !== 5">
372
+                                <div class="order__btns" v-if="tab !== 6 && tab !== 5">
373 373
                                     <div
374 374
                                         class="btn tel"
375 375
                                         @click="makePhone(order)"

+ 70 - 35
src/pages/index/refund.vue

@@ -17,28 +17,45 @@
17 17
                             :value="item.id"
18 18
                         />
19 19
                     </div>
20
-                    <div class="info">
21
-                        <my-image
22
-                            :src="item.productImage"
23
-                            class="img"
24
-                        ></my-image>
25
-                        <div class="data">
26
-                            <div class="tit">
27
-                                {{ item.productName }}
20
+                    <div class="main">
21
+                        <div class="info">
22
+                            <my-image
23
+                                :src="item.productImage"
24
+                                class="img"
25
+                            ></my-image>
26
+                            <div class="data">
27
+                                <div class="tit">
28
+                                    {{ item.productName }}
29
+                                </div>
30
+                                <div>
31
+                                    <span class="num"
32
+                                        >数量:x {{ item.count }}</span
33
+                                    >
34
+                                    <span class="num" v-if="item.skuName"
35
+                                        >规格: {{ item.skuName }}</span
36
+                                    >
37
+                                </div>
38
+                                <div class="des">
39
+                                    支付金额:
40
+                                    <span class="price"
41
+                                        >¥{{
42
+                                            item.payAmount | minuteToRmb
43
+                                        }}</span
44
+                                    >
45
+                                </div>
28 46
                             </div>
29
-                            <div>
30
-                                <span class="num"
31
-                                    >数量:x {{ item.count }}</span
32
-                                >
33
-                                <span class="num" v-if="item.skuName"
34
-                                    >规格: {{ item.skuName }}</span
35
-                                >
47
+                        </div>
48
+                        <div
49
+                            class="difference"
50
+                            v-if="item.refundAmount && item.actualPickingWeight"
51
+                        >
52
+                            <div class="name">
53
+                                已退差价:¥{{
54
+                                    item.refundAmount | minuteToRmb
55
+                                }}
36 56
                             </div>
37
-                            <div class="des">
38
-                                支付金额:
39
-                                <span class="price"
40
-                                    >¥{{ item.payAmount | minuteToRmb }}</span
41
-                                >
57
+                            <div class="">
58
+                                已退重量:{{ item.actualPickingWeight || "0" }}g
42 59
                             </div>
43 60
                         </div>
44 61
                     </div>
@@ -178,8 +195,7 @@ export default {
178 195
                                 if (res.success) {
179 196
                                     this.fn.showToast("提交成功");
180 197
                                     this.router.back();
181
-                                }else{
182
-                                    
198
+                                } else {
183 199
                                     this.fn.showToast(
184 200
                                         "提交失败:" + res.message
185 201
                                     );
@@ -190,7 +206,7 @@ export default {
190 206
         },
191 207
 
192 208
         // 退差价
193
-        disparity(){
209
+        disparity() {
194 210
             if (this.submitLoading) {
195 211
                 return;
196 212
             }
@@ -198,9 +214,9 @@ export default {
198 214
                 return this.fn.showToast("请选择退货项");
199 215
             }
200 216
             let arr = [];
201
-            for(id of this.curGoodItemIds){
202
-                for(let item of this.orderData.orderItems){
203
-                    if(item.id === id){
217
+            for (id of this.curGoodItemIds) {
218
+                for (let item of this.orderData.orderItems) {
219
+                    if (item.id === id) {
204 220
                         arr.push(item);
205 221
                     }
206 222
                 }
@@ -209,20 +225,20 @@ export default {
209 225
                 disparityData: arr,
210 226
             });
211 227
             let id = this.orderData.orderInfo.id;
212
-            console.log(this.orderData,id);
228
+            console.log(this.orderData, id);
213 229
             this.router.replace({
214
-                path:'/pages/index/disparity',
215
-                query:{
216
-                    orderId:id
217
-                }
218
-            })
230
+                path: "/pages/index/disparity",
231
+                query: {
232
+                    orderId: id,
233
+                },
234
+            });
219 235
         },
220 236
 
221 237
         // 取消订单
222 238
         cancelOrder(flag) {
223
-            let str = '确认取消该订单,并全部退款';
224
-            if(flag === true){
225
-                str = '你已选中所有商品,确认后将取消订单全部退款';
239
+            let str = "确认取消该订单,并全部退款";
240
+            if (flag === true) {
241
+                str = "你已选中所有商品,确认后将取消订单全部退款";
226 242
             }
227 243
             let val = this.orderData;
228 244
             this.fn
@@ -277,6 +293,9 @@ export default {
277 293
                 for (let item of this.orderData.orderItems) {
278 294
                     if (item.id === id) {
279 295
                         num += item.payAmount;
296
+                        if(item.refundAmount){
297
+                            num-=item.refundAmount;
298
+                        }
280 299
                     }
281 300
                 }
282 301
             }
@@ -353,6 +372,10 @@ export default {
353 372
     .checkbox {
354 373
         transform: scale(0.8);
355 374
     }
375
+    
376
+    .main {
377
+        width: 100%;
378
+    }
356 379
     .info {
357 380
         width: 100%;
358 381
         display: flex;
@@ -431,4 +454,16 @@ export default {
431 454
         font-size: px(44);
432 455
     }
433 456
 }
457
+.difference {
458
+    display: flex;
459
+    justify-content: space-between;
460
+    align-items: center;
461
+    background-color: #e9e9e9;
462
+    color: #666;
463
+    padding: px(20) px(10);
464
+    font-size: px(38);
465
+    .link {
466
+        text-decoration: underline;
467
+    }
468
+}
434 469
 </style>

+ 1 - 1
src/pages/manage/index.vue

@@ -55,7 +55,7 @@
55 55
 
56 56
         <button class="btn" @click="layout">退出登录</button>
57 57
 
58
-        <div class="ver">0.3.2</div>
58
+        <div class="ver">0.3.21</div>
59 59
     </div>
60 60
 </template>
61 61