Browse Source

直充添加详情页

DaMowang 2 years ago
parent
commit
71ed53c1d1
2 changed files with 49 additions and 5 deletions
  1. 46 2
      src/pagesB/directCharge/orderDetail.vue
  2. 3 3
      src/pagesB/orderingfood/orderlist.vue

+ 46 - 2
src/pagesB/directCharge/orderDetail.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="orderDetail">
-        <div class="Detail_con">
+        <div class="Detail_con" v-if="order.type==3">
             <image :src="order.product_img" class="p_img" mode="widthFix" />
             <div class="p_t">{{ order.product_name }}</div>
         </div>
@@ -11,7 +11,25 @@
             <p @click="copyText(detail.card_pwd)" v-if="detail.card_pwd">卡密:{{ detail.card_pwd }}</p>
             <p @click="copyText(detail.link_url)" v-if="detail.link_url">卡券链接:{{detail.link_url}}</p>
         </div>
+        <div class="money card" v-if="order.type==2">
+            <div class="li flex_r flex_jb">
+                <span>消费金额</span>
+                <span>¥{{ order.order_amount || 0 }}</span>
+            </div>
+            <div class="li flex_r flex_jb">
+                <span>消费金抵扣<span class="corg">{{Integral}}%</span></span>
+                <span class="corg">-¥{{ deduction || 0 }}</span>
+            </div>
+            <div class="li flex_r flex_jb">
+                <span>实付金额</span>
+                <span>¥{{ order.pay_amount || 0 }}</span>
+            </div>
+        </div>
         <div class="info card">
+            <template v-if="order.type==2">
+                <p>产品品牌:{{ order.restaurant_name }}</p>
+                <p>产品名称:{{ order.product_name }}</p>
+            </template>
             <p>订单金额:¥{{ order.pay_amount }}</p>
             <p>订单编号:{{ order.trade_no }}</p>
             <p>下单时间:{{ order.create_time }}</p>
@@ -36,6 +54,8 @@ export default {
             order: {},
             detail: {},
             pda: {},
+            Integral: 0,
+            deduction: 0,
         };
     },
     methods: {
@@ -49,8 +69,17 @@ export default {
                     this.order = da;
                     if(res.data.detail.code == 200){
                         this.detail = res.data.detail.data[0];
-                        [].includes()
                     }
+                    if(this.order.type==2) this.getIntegral()
+                }
+            })
+        },
+        getIntegral() {
+            post("local/getIntegral", { type: 3 }).then(res => {
+                if (res.code == 0) {
+                    let i1 = res.data.integral;
+                    this.Integral = this.$h.Mul(i1, 100);
+                    this.deduction = this.$h.Mul(this.order.order_amount, i1).toFixed(2);
                 }
             })
         },
@@ -149,6 +178,21 @@ export default {
     text-align: center;
     line-height: 80rpx;
 }
+.money{
+    .li{
+        margin-bottom: 16rpx;
+        &:last-child{
+            margin-bottom: 0;
+        }
+        span{
+            font-size: 30rpx;
+        }
+    }
+    .corg{
+        color: #18bb88;
+        margin-left: 5rpx;
+    }
+}
 .msg {
     font-size: 26rpx;
     margin-top: 50rpx;

+ 3 - 3
src/pagesB/orderingfood/orderlist.vue

@@ -69,9 +69,9 @@ export default {
             }
         },
         entrance(i) {
-            if (i.type == 1) this.goto('/pagesB/cinema/cinemaTicket', { tradeNo: i.trade_no })
-            else if (i.type == 0) this.goto('/pagesB/orderingfood/detail', { trade_no: i.trade_no, brand_id: i.brand_id })
-            else if (i.type == 3) this.goto('/pagesB/directCharge/orderDetail', { trade_no: i.trade_no })
+            if (i.type == 0) this.goto('/pagesB/orderingfood/detail', { trade_no: i.trade_no, brand_id: i.brand_id })
+            else if (i.type == 1) this.goto('/pagesB/cinema/cinemaTicket', { tradeNo: i.trade_no })
+            else if ([2,3].includes(i.type)) this.goto('/pagesB/directCharge/orderDetail', { trade_no: i.trade_no })
         },
         seatInfos(va,type){
             if(va&&type==1){