Commit 05b3e86b76b3072fd25a8bb0f0d22c5fddc8efee

Authored by liuqimichale
1 parent 35b48aa6

eslint

.eslintrc.js
... ... @@ -25,7 +25,7 @@ module.exports = {
25 25 "vue/html-self-closing": ["error", {
26 26 "html": {
27 27 "void": "never",
28   - "normal": "always",
  28 + "normal": "never",
29 29 "component": "always"
30 30 },
31 31 "svg": "always",
... ...
src/components/home.vue
1 1 <template>
2 2 <div class="wrap">
3   - <InOut v-if="inOutVal==='1'" :toFlag="0"/>
  3 + <InOut v-if="inOutVal==='1'" :toflag = "0"/>
4 4 <div v-else-if="inOutVal==='2'&&_getPayFlag">pay</div>
5   - <InOut v-else :toFlag="1"/>
  5 + <InOut v-else :toflag = "1"/>
6 6 <Loading v-show="_getshowflag"/>
7 7 </div>
8 8 </template>
... ...
src/components/inout.vue
1 1 <template>
2 2 <div class="inout-wrap">
3   - <div class="title">无牌车{{ toFlag =='0' ? '入场' : '出场' }}结算</div>
  3 + <div class="title">无牌车{{ toflag =='0' ? '入场' : '出场' }}结算</div>
4 4 <div :class="tipsClass" class="tips-text" >{{ tipsText }}</div>
5   - <div class="inout-fix" />
  5 + <div class="inout-fix"></div>
6 6 <input v-show="inputType" ref="phoneVal" type="text" placeholder="请输入手机号" maxlength="11">
7 7 <input v-show="!inputType" ref="carVal" type="text" placeholder="请输入车牌号" maxlength="8">
8 8 <div class="toggle-btn" @click="togglebtn">
... ... @@ -18,7 +18,12 @@ import { mapActions } from &#39;vuex&#39;
18 18  
19 19 export default {
20 20 name: 'InOut',
21   - props: ['toFlag'],
  21 + props: {
  22 + toflag: {
  23 + type: Number,
  24 + default: 0
  25 + }
  26 + },
22 27 data() {
23 28 return {
24 29 tipsText: '请输入手机号',
... ... @@ -44,7 +49,7 @@ export default {
44 49 }
45 50 },
46 51 commitsure() { // 确定事件
47   - console.log(this.toFlag) // 如果为1 就需要去支付
  52 + console.log(this.toflag) // 如果为1 就需要去支付
48 53 if (this.inputType) {
49 54 const phonetext = this.$refs.phoneVal.value.trim()
50 55 const phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/
... ... @@ -57,7 +62,7 @@ export default {
57 62 this.handleHide()
58 63 this.tipsText = '绑定成功'
59 64 this.tipsClass = 'successClass'
60   - if (this.toFlag === 1) {
  65 + if (this.toflag === 1) {
61 66 this.handlePayFlag()
62 67 }
63 68 }, 2000)
... ... @@ -74,7 +79,7 @@ export default {
74 79 } else {
75 80 const cartext = this.$refs.carVal.value.trim()
76 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 83 if (cartext) {
79 84 if (cartext.length === 7) { // 正常车牌
80 85 if (carReg.test(cartext)) {
... ...
src/components/loading.vue
... ... @@ -64,6 +64,4 @@ export default {
64 64 border-color: lightblue;
65 65 }
66 66 }
67   -
68   -
69 67 </style>
... ...