From 8bb7963646f27027c3eac087bdd50fdcfa7426cb Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期三, 16 十月 2024 18:11:33 +0800
Subject: [PATCH] fix: 泊车修改车位缴费页面

---
 src/components/page/invoice/index.vue |  137 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 106 insertions(+), 31 deletions(-)

diff --git a/src/components/page/invoice/index.vue b/src/components/page/invoice/index.vue
index 877c1c0..7b029cf 100644
--- a/src/components/page/invoice/index.vue
+++ b/src/components/page/invoice/index.vue
@@ -1,36 +1,45 @@
 <template>
     <div class="invoice-wrap">
-        <div class="invoice-main">
-            <img class="logoPhone" src="@/assets/images/logoImg.png" alt="">
-            <h1>鍙戠エ鏌ヨ</h1>
+        <div class="weixin-box" v-if="!isWeiXin">
+            <div class="invoice-main">
+                <img class="logoPhone" src="@/assets/images/logoImg.png" alt="">
+                <h1>鍙戠エ鏌ヨ</h1>
+            </div>
+            <div class="invoice-main2">
+                <el-form
+                        :inline="true"
+                        :model="form"
+                        class="invoice-main2-box"
+                        ref="form"
+                        :rules="rules">
+                    <el-form-item
+                            prop="carNo"
+                            class="carNum"
+                            label="杞︾墝鍙�:"
+                            >
+                        <el-input v-model="form.carNo" placeholder="杈撳叆杞︾墝鍙�"></el-input>
+                    </el-form-item>
+                    <el-form-item
+                            prop="phone"
+                            class="carNum"
+                            label="鎵嬫満鍙�:"
+                            >
+                        <el-input v-model="form.phone" placeholder="杈撳叆鎵嬫満鍙�"></el-input>
+                    </el-form-item>
+                    <el-form-item class="invoice-btn" v-if="isShowBtn">
+                        <el-button
+                                id="fixBtn"
+                                @click="submitInvoice('form')"
+                                class="jiaofei-btn"
+                                type="primary">纭畾</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
         </div>
-        <div class="invoice-main2">
-            <el-form
-                 :model="form"
-                 class="invoice-main2-box"
-                 ref="form"
-                 :rules="rules">
-                <el-form-item
-                        prop="carNo"
-                        class="carNum"
-                        label="杞︾墝鍙�:"
-                        label-width="80px">
-                    <el-input v-model="form.carNo" placeholder="杈撳叆杞︾墝鍙�"></el-input>
-                </el-form-item>
-                <el-form-item
-                        prop="phone"
-                        class="carNum"
-                        label="鎵嬫満鍙�:"
-                        label-width="80px">
-                    <el-input v-model="form.phone" placeholder="杈撳叆鎵嬫満鍙�"></el-input>
-                </el-form-item>
-                <el-form-item class="invoice-btn">
-                    <el-button
-                            @click="submitInvoice('form')"
-                            class="jiaofei-btn"
-                            type="primary">纭畾</el-button>
-                </el-form-item>
-            </el-form>
+        <div class="middlePge-wrap" v-else>
+            <div class="middlePge-main">
+                <img src="../../../assets/images/middlePage.png" alt="">
+            </div>
         </div>
     </div>
 </template>
@@ -52,6 +61,10 @@
                 }
             }
             return {
+                isWeiXin: false,
+                isShowBtn: true, //纭畾鎸夐挳鏄剧ず 瑙e喅瀹夊崜button琚《璧风殑闂
+                docmHeight: document.documentElement.clientHeight,  //榛樿灞忓箷楂樺害
+                showHeight: document.documentElement.clientHeight,   //瀹炴椂灞忓箷楂樺害
                 form: {
                     carNo:'',
                     phone:''
@@ -67,7 +80,45 @@
                 }
             }
         },
+        created() {
+            this.checkWeiXin()
+        },
+        watch: {
+            showHeight() {
+                // 瑙e喅瀹夊崜搴曢儴鍥哄畾閮ㄤ綅琚蒋閿洏椤朵笂鍘婚棶棰�
+                //鐩戝惉灞忓箷楂樺害鍙樺寲
+                if(this.docmHeight > this.showHeight){
+                    this.isShowBtn = false
+                }else {
+                    this.isShowBtn = true
+                }
+            }
+        },
+        mounted() {
+            //棣栨杩涘叆鐨勫師濮嬮珮搴�
+            window.addEventListener('resize', this.watchResize);
+        },
         methods: {
+            watchResize() {
+                //瀹炴椂鍙樺寲鐨勭獥鍙i珮搴�
+                this.showHeight = document.body.clientHeight;
+            },
+            checkWeiXin() {
+                // let userAgent = navigator.userAgent;
+                // console.log(userAgent)
+                // if (userAgent.includes("MicroMessenger")) {
+                //     this.isWeiXin = true
+                // } else {
+                //     this.isWeiXin = false
+                // }
+                let ua = window.navigator.userAgent.toLowerCase();
+                //閫氳繃姝e垯琛ㄨ揪寮忓尮閰島a涓槸鍚﹀惈鏈塎icroMessenger瀛楃涓�
+                if(ua.match(/MicroMessenger/i) == 'micromessenger'){
+                    this.isWeiXin = true
+                } else{
+                    this.isWeiXin = false
+                }
+            },
             submitInvoice(formName) {
                 this.$refs[formName].validate(valid => {
                     if(valid) {
@@ -82,7 +133,10 @@
                 })
 
             }
-        }
+        },
+        beforeDestroy() {
+            window.removeEventListener("resize", this.watchResize);
+        },
     }
 </script>
 
@@ -106,12 +160,32 @@
             width: 88%;
             padding-right: 2.67vw  /* 20/7.5 */;
         }
+        .el-form-item__label{
+            font-size: 3.73vw  /* 28/7.5 */;
+            width: 24vw  /* 180/7.5 */;
+        }
+        .el-form-item__content{
+            width: calc(100% - 24vw - 15px);
+        }
+
     }
 .invoice-wrap{
     width: 100%;
     display: flex;
     flex-direction: column;
     height: 100%;
+    .weixin-box{
+        width: 100%;
+        height: 100%;
+    }
+    .middlePge-wrap{
+        width: 100%;
+        height: 100%;
+        background: rgba(0,0,0,0.7);
+        img{
+            width: 100%;
+        }
+    }
    .invoice-main{
         width: 100%;
         display: flex;
@@ -148,6 +222,7 @@
     }
     .carNum{
         margin-top: 10vw;
+        width: 100%;
     }
     .invoice-btn{
         position: absolute;

--
Gitblit v1.9.1