Jelajahi Sumber

详情支付修改

zhanghui 2 tahun lalu
induk
melakukan
3e8423d001
1 mengubah file dengan 49 tambahan dan 24 penghapusan
  1. 49 24
      orderPages/orderDetail/index.vue

+ 49 - 24
orderPages/orderDetail/index.vue

@@ -93,10 +93,10 @@
                         <view class="line"></view>
 
                         <view class="flex-row justify-between borderBottom" v-for="(item,index) in order.child" :key="index">
-                            <view class="flex-col justify-center" v-if="order.orderStatus != 3">
-                                <u-icon v-if="item.tick" name="checkmark-circle-fill" color="#38db38" size="20" @click="tick(item,index)"></u-icon>
-                                <u-icon v-else name="/static/order/ud9.png" color="green" size="20" @click="tick(item,index)"></u-icon>
-                            </view>
+<!--                            <view class="flex-col justify-center" v-if="order.orderStatus != 3">-->
+<!--                                <u-icon v-if="item.tick" name="checkmark-circle-fill" color="#38db38" size="20" @click="tick(item,index)"></u-icon>-->
+<!--                                <u-icon v-else name="/static/order/ud9.png" color="green" size="20" @click="tick(item,index)"></u-icon>-->
+<!--                            </view>-->
 
                             <view class="flex-col right">
                                 <view class="flex-row justify-between">
@@ -151,7 +151,7 @@
                     </view>
 
                     <view class="btn" @click="qenPayInfo">
-                        <text lines="1" class="text_33">提交</text>
+                        <text lines="1" class="text_33">一键付款</text>
                     </view>
                 </view>
             </view>
@@ -378,12 +378,18 @@ export default {
         },
 
         qenPayInfo(){
+
+            for(let i=0;i<this.order.child.length;i++){
+                if (this.order.child[i].status==3){
+                    uni.$u.toast('当前有订单正在申诉,不可付款')
+                    return
+                }
+            }
+
           this.getUserInfo();
             let orderServiceIds = []
             this.order.child.forEach(i=>{
-                if (i.tick){
-                    orderServiceIds.push(i.orderServiceId)
-                }
+                orderServiceIds.push(i.orderServiceId)
             })
             this.$api.qenPayInfo({
                 orderServiceIds:orderServiceIds,
@@ -415,22 +421,40 @@ export default {
             this.$refs.appealPopup.open()
         },
 
-        tick(item,index){
-
-          if (item.status === 1 || item.status === 4){
-              this.allPrice = 0
-              this.totalDiscount = 0;
-              item.tick = !item.tick
-              this.$set(this.order.child,index,item)
-              this.order.child.forEach(i=>{
-                  if (i.tick){
-                      this.totalDiscount += i.discountAmount * 1;
-                      this.allPrice += i.payAmount *1;
-                  }
-              })
-              this.allPrice = this.allPrice.toFixed(2)
-              this.totalDiscount = this.totalDiscount.toFixed(2)
-          }
+        // 原来的计算价格逻辑  选择的时候计算
+        // tick(item,index){
+        //
+        //   if (item.status === 1 || item.status === 4){
+        //       this.allPrice = 0
+        //       this.totalDiscount = 0;
+        //       item.tick = !item.tick
+        //       this.$set(this.order.child,index,item)
+        //       this.order.child.forEach(i=>{
+        //           if (i.tick){
+        //               this.totalDiscount += i.discountAmount * 1;
+        //               this.allPrice += i.payAmount *1;
+        //           }
+        //       })
+        //       this.allPrice = this.allPrice.toFixed(2)
+        //       this.totalDiscount = this.totalDiscount.toFixed(2)
+        //   }
+        // },
+
+
+
+        //新的价格计算逻辑  订单加载或刷新的时候计算
+        calculatePrice(){
+            console.log('66666666666666666')
+            this.allPrice = 0
+            this.totalDiscount = 0;
+            this.order.child.forEach(i=>{
+                if (i.status != 3 ){ //不在申诉的子订单
+                    this.totalDiscount += i.discountAmount * 1;
+                    this.allPrice += i.payAmount *1;
+                }
+            })
+            this.allPrice = this.allPrice.toFixed(2)
+            this.totalDiscount = this.totalDiscount.toFixed(2)
         },
 
         getOrderDetailByOrderId(id){
@@ -438,6 +462,7 @@ export default {
                 id:id
             }).then(res=>{
                 this.order= res.data.data
+                this.calculatePrice()
             })
         },
         payItem(num){