From e4aeb891ab4d27dfdfc85ef92f59f44d60b94e53 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期五, 22 三月 2024 17:52:27 +0800
Subject: [PATCH] docs: 峰峰停车场 添加权限限制

---
 src/components/page/IndexXTYH.vue |   93 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 71 insertions(+), 22 deletions(-)

diff --git a/src/components/page/IndexXTYH.vue b/src/components/page/IndexXTYH.vue
index 703934f..7f0fa90 100644
--- a/src/components/page/IndexXTYH.vue
+++ b/src/components/page/IndexXTYH.vue
@@ -7,7 +7,7 @@
         <!--</div>-->
         <div class="weizhang-main-box">
             <div class="weizhang-main-top">
-                <img class="logoPhone" src="../../assets/images/logoImg.png" alt="">
+<!--                <img class="logoPhone" src="../../assets/images/logoImg.png" alt="">-->
                 <span class="weizhang">鍋滆溅鏀惰垂</span>
                 <span class="money">锟{this.statisticData.price}}</span>
             </div>
@@ -33,7 +33,7 @@
                             {{this.statisticData.code}}
                             <!--<el-input v-model="statisticData.code" readonly></el-input>-->
                         </el-form-item>
-                        <el-form-item class="weizhang-footer-box" style="display: flex;justify-content: center;margin-top: 4.498vh" label-width="0" v-show="showFlag">
+                        <el-form-item v-if="isShowjiaofei" class="weizhang-footer-box" style="display: flex;justify-content: center;margin-top: 4.498vh" label-width="0" v-show="showFlag">
                             <el-button class="jiaofei-btn" type="primary" @click="pay()" :loading="payFlag">鍘荤即璐�</el-button>
                         </el-form-item>
                     </el-form>
@@ -47,11 +47,11 @@
                         label="鏃� 鐗� 杞� 杈� 鏌� 璇�">
                       <el-input prefix-icon="el-icon-search" style="margin-top: 20px;border: solid 1px #ccc!important;" v-model="carNo" placeholder="璇疯緭鍏ユ墜鏈哄彿"></el-input>
                     </el-form-item>
-                    <el-form-item class="weizhang-footer-box" style="display: flex;justify-content: center;margin-top: 5.498vh" label-width="0">
-                      <el-button
-                          style="borderColor:'none';background:#121215e0 "
-                          class="jiaofei-btn" type="primary" @click="noCarOut()" v-show="showFlag">鏌ヨ</el-button>
-                    </el-form-item>
+<!--                    <el-form-item class="weizhang-footer-box" style="display: flex;justify-content: center;margin-top: 5.498vh" label-width="0">-->
+<!--                      <el-button-->
+<!--                          style="borderColor:'none';background:#121215e0 "-->
+<!--                          class="jiaofei-btn" type="primary" @click="noCarOut()" v-show="showFlag">鏌ヨ</el-button>-->
+<!--                    </el-form-item>-->
                   </el-form>
 
                 </div>
@@ -101,6 +101,7 @@
         name: 'dashboard',
         data() {
             return {
+                isShowjiaofei: true,
                 dialogVisible:false,
                 payFlag:false,
                 payNowFlag:false,
@@ -131,17 +132,17 @@
             //鏀粯瀹�
             this.type = 1
           }
-          if(this.type == null){
-            this.$message.error("璇风敤寰俊鎴栨敮浠樺疂鎵弿浜岀淮鐮�")
-            return;
-          }
+          // if(this.type == null){
+          //   this.$message.error("璇风敤寰俊鎴栨敮浠樺疂鎵弿浜岀淮鐮�")
+          //   return;
+          // }
 
             var url = window.location.href;
             var count = url.split('?').length-1;
             if(count >1){
-              this.code = this.getCodeFromUrl(url)
-              this.code2 = this.getCode2FromUrl(url)
-              window.location.href = "http://hesuancj.cn/#/index2?code="+this.code+"&state=STATE&code2="+this.code2
+              let codeONE = this.getCodeFromUrl(url)
+              let codeTWO = this.getCode2FromUrl(url)
+              window.location.href = "http://hesuancj.cn/#/index2?code="+codeONE+"&state=STATE&code2="+codeTWO
             }
             var cs = url.split('?')[1];
             var cs_arr = cs.split('&');
@@ -153,19 +154,44 @@
           this.code2 = cs.code2;
           this.code = cs.code;
           if(this.code2 == null || this.code2 == ''){
-            window.location.href = "http://hesuancj.cn/#/index2?code2="+this.code
+            this.$message({
+              message: '1绉掑悗鑷姩璺宠浆锛岃绋嶇瓑',
+              type: 'success',
+              duration:1000,
+            });
+            setTimeout(function(){window.location.href = "http://hesuancj.cn/#/index2?code2="+cs.code},1000);
+            return;
           }
           if(this.code != null && this.code != '') {
             this.dialogVisible = true
           }else {
             this.dialogVisible = false
           }
-          this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/outpark/findByBarrierCode', {code2:cs.code2}, res => {
+          this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/outpark/findByBarrierCode2', {code2:cs.code2}, res => {
             this.statisticData = res.data;
             this.outParkId = this.statisticData.id;
             this.status3 = this.statisticData.status3;
             this.oldCarNo = this.statisticData.carNo;
             this.payFlag = false
+            if(!this.statisticData.enterTime) {
+              this.isShowjiaofei = false
+              this.$message({
+                showClose: false,
+                duration:0,
+                type: 'error',
+                message: '鍏ュ満寮傚父锛岃鑱旂郴绠$悊鍛�'
+              });
+            }else if(this.statisticData.enterTime && (!this.statisticData.price || this.statisticData.price == 0)) {
+              this.isShowjiaofei = false
+              this.$message({
+                showClose: false,
+                duration:0,
+                type: 'error',
+                message: '鍏ュ満寮傚父锛岃鑱旂郴绠$悊鍛�'
+              });
+            }else {
+              this.isShowjiaofei = true
+            }
             if(this.status3==1){
               this.$message({
                 message: '鎮ㄦ湁杩濈珷鏈鐞嗭紝璇峰厛澶勭悊鎴栬仈绯诲仠杞﹀満绠$悊浜哄憳',
@@ -177,8 +203,11 @@
         },
         methods: {
             pay(){
-                this.payFlag = true;
+                console.log('code',this.code)
+                console.log('code2',this.code2)
+                // this.payFlag = true;
                 this.payNowFlag = true;
+                // this.showFlag = true
                 if(this.status3==1){
                     this.$message({
                         message: '鎮ㄦ湁杩濈珷鏈鐞嗭紝璇峰厛澶勭悊鎴栬仈绯诲仠杞﹀満绠$悊浜哄憳',
@@ -189,8 +218,16 @@
                 }
                 this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/api/parkXT', {id:this.outParkId}, res => {
                   if(res.code === 0){
+                    this.payNowFlag = false;
                     this.getCode()
-                    this.showFlag = false
+                    // this.showFlag = false
+                  }else {
+                    this.$message({
+                      message: '鏀粯閿欒锛岃閲嶆柊鏀粯',
+                      type: 'error',
+                      duration:3000,
+                    });
+                    this.payNowFlag = false;
                   }
                 })
             },
@@ -315,12 +352,14 @@
           },
           queryOrder() {
             this.$byutil.postData(this, this.$systemconfig.basePath + '/ffzf/outpark/getById', {id: this.outParkId}, res => {
-              if (res.code == 0) {
+              if (res.code === 0) {
                 let outpark = res.data
-                if(outpark.status == 1){
+                if(outpark.status === 1){
                   window.location.href = "http://hesuancj.cn/#/indexOk?code2="+this.code2
+                  return;
                 }else {
                   window.location.href = "http://hesuancj.cn/#/indexFail?code2="+this.code2
+                  return;
                 }
               }
             })
@@ -333,6 +372,15 @@
 
 
 <style lang="scss">
+.el-message{
+  padding: 30px 15px 30px 20px;
+}
+.el-message__content{
+  font-size: 5vw;
+}
+.el-icon-error:before{
+  font-size: 5vw
+}
     .weizhang-main-bootom{
         .el-input__inner{
             border:none;
@@ -423,16 +471,17 @@
         padding:5.33vw  /* 40/7.5 */;
     }
     .weizhang-main-top{
-        height: 22.489vh  /* 300/13.34 */;
+        height: 21.489vh  /* 300/13.34 */;
         display: flex;
         flex-direction: column;
         justify-content: center;
         align-items: center;
         border-bottom: 1px solid #f0f0f0;
         .money{
-            font-size: 6.93vw  /* 52/7.5 */;
+            font-size: 7.6vw  /* 52/7.5 */;
             font-weight: 550;
             color: #000;
+            margin-top: 1vw;
         }
         .weizhang{
             font-size: 0.4rem  /* 30/75 */;

--
Gitblit v1.9.1