Commit 05b3e86b76b3072fd25a8bb0f0d22c5fddc8efee

Authored by liuqimichale
1 parent 35b48aa6

eslint

.eslintrc.js
@@ -25,7 +25,7 @@ module.exports = { @@ -25,7 +25,7 @@ module.exports = {
25 "vue/html-self-closing": ["error", { 25 "vue/html-self-closing": ["error", {
26 "html": { 26 "html": {
27 "void": "never", 27 "void": "never",
28 - "normal": "always", 28 + "normal": "never",
29 "component": "always" 29 "component": "always"
30 }, 30 },
31 "svg": "always", 31 "svg": "always",
src/components/home.vue
1 <template> 1 <template>
2 <div class="wrap"> 2 <div class="wrap">
3 - <InOut v-if="inOutVal==='1'" :toFlag="0"/> 3 + <InOut v-if="inOutVal==='1'" :toflag = "0"/>
4 <div v-else-if="inOutVal==='2'&&_getPayFlag">pay</div> 4 <div v-else-if="inOutVal==='2'&&_getPayFlag">pay</div>
5 - <InOut v-else :toFlag="1"/> 5 + <InOut v-else :toflag = "1"/>
6 <Loading v-show="_getshowflag"/> 6 <Loading v-show="_getshowflag"/>
7 </div> 7 </div>
8 </template> 8 </template>
src/components/inout.vue
1 <template> 1 <template>
2 <div class="inout-wrap"> 2 <div class="inout-wrap">
3 - <div class="title">无牌车{{ toFlag =='0' ? '入场' : '出场' }}结算</div> 3 + <div class="title">无牌车{{ toflag =='0' ? '入场' : '出场' }}结算</div>
4 <div :class="tipsClass" class="tips-text" >{{ tipsText }}</div> 4 <div :class="tipsClass" class="tips-text" >{{ tipsText }}</div>
5 - <div class="inout-fix" /> 5 + <div class="inout-fix"></div>
6 <input v-show="inputType" ref="phoneVal" type="text" placeholder="请输入手机号" maxlength="11"> 6 <input v-show="inputType" ref="phoneVal" type="text" placeholder="请输入手机号" maxlength="11">
7 <input v-show="!inputType" ref="carVal" type="text" placeholder="请输入车牌号" maxlength="8"> 7 <input v-show="!inputType" ref="carVal" type="text" placeholder="请输入车牌号" maxlength="8">
8 <div class="toggle-btn" @click="togglebtn"> 8 <div class="toggle-btn" @click="togglebtn">
@@ -18,7 +18,12 @@ import { mapActions } from &#39;vuex&#39; @@ -18,7 +18,12 @@ import { mapActions } from &#39;vuex&#39;
18 18
19 export default { 19 export default {
20 name: 'InOut', 20 name: 'InOut',
21 - props: ['toFlag'], 21 + props: {
  22 + toflag: {
  23 + type: Number,
  24 + default: 0
  25 + }
  26 + },
22 data() { 27 data() {
23 return { 28 return {
24 tipsText: '请输入手机号', 29 tipsText: '请输入手机号',
@@ -44,7 +49,7 @@ export default { @@ -44,7 +49,7 @@ export default {
44 } 49 }
45 }, 50 },
46 commitsure() { // 确定事件 51 commitsure() { // 确定事件
47 - console.log(this.toFlag) // 如果为1 就需要去支付 52 + console.log(this.toflag) // 如果为1 就需要去支付
48 if (this.inputType) { 53 if (this.inputType) {
49 const phonetext = this.$refs.phoneVal.value.trim() 54 const phonetext = this.$refs.phoneVal.value.trim()
50 const phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/ 55 const phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/
@@ -57,7 +62,7 @@ export default { @@ -57,7 +62,7 @@ export default {
57 this.handleHide() 62 this.handleHide()
58 this.tipsText = '绑定成功' 63 this.tipsText = '绑定成功'
59 this.tipsClass = 'successClass' 64 this.tipsClass = 'successClass'
60 - if (this.toFlag === 1) { 65 + if (this.toflag === 1) {
61 this.handlePayFlag() 66 this.handlePayFlag()
62 } 67 }
63 }, 2000) 68 }, 2000)
@@ -74,7 +79,7 @@ export default { @@ -74,7 +79,7 @@ export default {
74 } else { 79 } else {
75 const cartext = this.$refs.carVal.value.trim() 80 const cartext = this.$refs.carVal.value.trim()
76 const carReg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/ 81 const carReg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/
77 - const carnewreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/; 82 + const carnewreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/
78 if (cartext) { 83 if (cartext) {
79 if (cartext.length === 7) { // 正常车牌 84 if (cartext.length === 7) { // 正常车牌
80 if (carReg.test(cartext)) { 85 if (carReg.test(cartext)) {
src/components/loading.vue
@@ -64,6 +64,4 @@ export default { @@ -64,6 +64,4 @@ export default {
64 border-color: lightblue; 64 border-color: lightblue;
65 } 65 }
66 } 66 }
67 -  
68 -  
69 </style> 67 </style>