Selaa lähdekoodia

明细计算赋值

liyuan 4 viikkoa sitten
vanhempi
commit
ce514ee65c
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 9 3
      pages/views/recycling/details.vue

+ 9 - 3
pages/views/recycling/details.vue

@@ -84,7 +84,7 @@
           ></u-number-box>
           <view class="amount-box">
             <text class="amount-symbol">¥</text>
-            <text class="amount-number">{{ (item.productPrice * item.productQuantity).toFixed(2) }}</text>
+            <text class="amount-number">{{ itemAmount(item) }}</text>
           </view>
         </view>
       </view>
@@ -205,6 +205,11 @@ export default {
     selectItem(index) {
       this.selectedIndex = index;
     },
+    itemAmount(row) {
+      let amount = (row.productPrice * row.productQuantity).toFixed(2)
+      row.productAmount = amount
+      return amount
+    },
     async fetchData(reset = false) {
       if (this.loading) return;
 
@@ -350,7 +355,7 @@ export default {
         uni.navigateBack({
           delta: 1
         });
-      }, 1000)
+      }, 500)
     },
     handleUpdate() {
       uni.showLoading({title: '提交中...'});
@@ -394,7 +399,8 @@ export default {
           this.goodsList.push( {
             productName:  res.data[num].dictValue,
             productPrice: res.data[num].dictKey,
-            productQuantity: 0
+            productQuantity: 0,
+            productAmount: 0
           })
         }
         this.orderDetail()