ソースを参照

座位数修改

Monterey 3 年 前
コミット
69f79e9bf0

+ 1 - 0
src/lang/ja.js

@@ -224,6 +224,7 @@ export default {
         title: 'ポイント履歴',
         category: 'ツアーカテゴリ',
         orderNum: '注文番号',
+        orerName:'商品名称',
         transferPoints: 'ポイント移行(入)',
         transferor: '譲渡人',
         integralTransfer: 'ポイント移行(出)',

+ 1 - 1
src/permission.js

@@ -54,7 +54,7 @@ router.beforeEach(async (to, from, next) => {
       } else {
         if (hasToken) {
           // //这里控制个人订单不可回退到确认订单
-          if(from.path=='/toBePaid'&&(to.path=='/linePayConfirm' || to.path=='/linePayCancel')){
+          if(from.path=='/toBePaid'&&(to.path=='/linePayConfirm' || to.path=='/linePayCancel' || to.path=='/confirmOrder')){
             next(`/personal`)
           }else{
             next()

+ 7 - 1
src/views/home/pages/confirmOrder/confirmOrder.vue

@@ -338,7 +338,13 @@ export default {
             };
             aiPay(require).then((res) => {
                 if (res.code == 200) {
-                    window.location = res.data.paymentUrl.web;
+                    if (res.data) {
+                        window.location = res.data.paymentUrl.web;
+                    } else {
+                        this.$router.push({path: "/toBePaid",
+                           query: { type: 2 },
+                           });
+                    }
                 }
             });
         },

+ 30 - 6
src/views/home/pages/productDetails/productDetails.vue

@@ -19,13 +19,14 @@
                         <span>{{commodityDetails.commodity.commodityName}}</span>
                     </van-skeleton>
                 </div>
+                <!--
                 <div class="stock">
                     <van-skeleton :row="1" :loading="loading">
                         <span>{{commodityDetails.commodity.stock}}</span>
                     </van-skeleton>
                     <span>{{$t('productDetails.stock')}}</span>
-
                 </div>
+                -->
             </div>
             <div class="discount" v-if="commodityDetails.commodity.commodityCouponList.length">
                 <div class="left">
@@ -308,7 +309,7 @@ export default {
             let num = 0;
             if (this.travelList[0] && this.travelList[1]) {
                 num =
-                    this.commodityDetails.commodity.stock -
+                    this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) -
                     (this.travelList[0].num + this.travelList[1].num);
             }
             if (num < 0) {
@@ -319,9 +320,9 @@ export default {
         //计算成人票数限制
         adultNum() {
             let num = 0;
-            if (this.commodityDetails.commodity.stock && this.travelList[1]) {
+            if (this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) && this.travelList[1]) {
                 num =
-                    this.commodityDetails.commodity.stock -
+                    this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) -
                     this.travelList[1].num;
             }
             return num;
@@ -329,9 +330,9 @@ export default {
         //计算儿童票数限制
         childrenNum() {
             let num = 0;
-            if (this.commodityDetails.commodity.stock && this.travelList[0]) {
+            if (this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) && this.travelList[0]) {
                 num =
-                    this.commodityDetails.commodity.stock -
+                    this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) -
                     this.travelList[0].num;
             }
             return num;
@@ -739,6 +740,29 @@ export default {
             }
             return day;
         },
+
+        //取得座位数
+        getSeatNum(seatList) {
+            //取得选中日期
+            let departureDate = "";
+            for (let i = 0; i < this.dateList.length; i++) {
+                if (this.dateList[i].active) {
+                    departureDate = this.dateList[i].timeAll;
+                    break;
+                }
+            }
+            console.log(`选中日期:` + departureDate);
+            let seatNum = 0;
+            if (departureDate != "") {
+                for (let i = 0; i < seatList.length; i++) {
+                    if (seatList[i].departureDate == departureDate) {
+                        seatNum = seatList[i].seatNum;
+                        break;
+                    }
+                }
+            }
+            return seatNum;
+        },
     },
 };
 </script>

+ 1 - 1
src/views/personal/pages/detailTtoBePaid/detailTtoBePaid.vue

@@ -18,7 +18,7 @@
             </template>
             <div class="userBox">
                 <span>{{userData.name}}</span>
-                <span>{{userData.phone}}</span>
+                <!--<span>{{userData.phone}}</span>-->
             </div>
             <div class="cell">
                 <div class="top" @click="goDetails">