Commit 5bdc01825513cbc52352c9d55e9a1aa1916389fd

Authored by liuqimichale
1 parent 82fb1f51

赤峰分支

src/components/inout.vue deleted
1 -<template>  
2 - <div class="inout-wrap">  
3 - <div class="title">无牌车{{ toflag =='0' ? '入场' : '出场' }}结算</div>  
4 - <div :class="tipsClass" class="tips-text">{{ tipsText }}</div>  
5 - <div class="inout-fix"></div>  
6 - <input  
7 - v-show="inputType"  
8 - ref="phoneVal"  
9 - type="text"  
10 - placeholder="请输入手机号"  
11 - maxlength="11"  
12 - onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');">  
13 - <input  
14 - v-show="!inputType"  
15 - ref="carVal"  
16 - type="text"  
17 - placeholder="请输入车牌号"  
18 - maxlength="8">  
19 - <div class="toggle-btn" @click="togglebtn">  
20 - <img src="../assets/toggle-btn.png">  
21 - {{ toggleText }}  
22 - </div>  
23 - <div class="commit-btn" @click="commitsure">确定</div>  
24 - </div>  
25 -</template>  
26 -  
27 -<script>  
28 -import { mapActions } from 'vuex'  
29 -  
30 -export default {  
31 - name: 'InOut',  
32 - props: {  
33 - toflag: {  
34 - type: Number,  
35 - default: 0  
36 - }  
37 - },  
38 - data() {  
39 - return {  
40 - tipsText: '请输入手机号',  
41 - toggleText: '切换车牌',  
42 - inputType: true,  
43 - tipsClass: ''  
44 - }  
45 - },  
46 - methods: {  
47 - ...mapActions([  
48 - 'handleShow', 'handleHide', 'handlePayFlag'  
49 - ]),  
50 - togglebtn() {  
51 - this.tipsClass = ''  
52 - this.inputType = !this.inputType  
53 - // this.toggleText=this.toggleText === '切换车牌' ? '切换手机' : '切换车牌'  
54 - if (this.toggleText === '切换车牌') {  
55 - this.toggleText = '切换手机'  
56 - this.tipsText = '请输入车牌号'  
57 - } else {  
58 - this.toggleText = '切换车牌'  
59 - this.tipsText = '请输入手机号'  
60 - }  
61 - },  
62 - commitsure() { // 确定事件  
63 - console.log(this.toflag) // 如果为1 就需要去支付  
64 - if (this.inputType) {  
65 - const phonetext = this.$refs.phoneVal.value.trim()  
66 - const phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/  
67 - if (phonetext) {  
68 - if (phoneReg.test(phonetext)) {  
69 - // ajax  
70 - this.handleShow()  
71 - // 模拟成功  
72 - setTimeout(() => {  
73 - this.handleHide()  
74 - this.tipsText = '绑定成功'  
75 - this.tipsClass = 'successClass'  
76 - if (this.toflag === 1) {  
77 - this.handlePayFlag()  
78 - const passdata = {  
79 - title: '手机号123',  
80 - money: '¥1000.00'  
81 - }  
82 - this.$emit('commitpass', passdata)  
83 - }  
84 - }, 2000)  
85 - } else {  
86 - this.tipsText = '请输入正确手机号'  
87 - this.tipsClass = 'errorClass'  
88 - return  
89 - }  
90 - } else {  
91 - this.tipsText = '请输入手机号'  
92 - this.tipsClass = ''  
93 - return  
94 - }  
95 - } else {  
96 - const cartext = this.$refs.carVal.value.trim()  
97 - const carReg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/  
98 - const carnewreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/  
99 - if (cartext) {  
100 - if (cartext.length === 7) { // 正常车牌  
101 - if (carReg.test(cartext)) {  
102 - // ajax  
103 - this.handleShow()  
104 - // 模拟成功  
105 - setTimeout(() => {  
106 - this.handleHide()  
107 - this.tipsText = '绑定成功'  
108 - this.tipsClass = 'successClass'  
109 - }, 2000)  
110 - } else {  
111 - this.tipsText = '请输入正确车牌号'  
112 - this.tipsClass = 'errorClass'  
113 - return  
114 - }  
115 - } else if (cartext.length === 8) { // 新能源  
116 - if (carnewreg.test(cartext)) {  
117 - // ajax  
118 - this.handleShow()  
119 - // 模拟成功  
120 - setTimeout(() => {  
121 - this.handleHide()  
122 - this.tipsText = '绑定成功'  
123 - this.tipsClass = 'successClass'  
124 - }, 2000)  
125 - } else {  
126 - this.tipsText = '请输入正确车牌号'  
127 - this.tipsClass = 'errorClass'  
128 - return  
129 - }  
130 - } else {  
131 - this.tipsText = '请输入正确车牌号'  
132 - this.tipsClass = 'errorClass'  
133 - return  
134 - }  
135 - } else {  
136 - this.tipsText = '请输入车牌号'  
137 - this.tipsClass = ''  
138 - return  
139 - }  
140 - }  
141 - }  
142 - }  
143 -}  
144 -</script>  
145 -  
146 -<style lang="scss" scoped>  
147 - $corlorwhit: #fff;  
148 - .inout-wrap {  
149 - width: 100%;  
150 - height: 100%;  
151 - background: url("../assets/inout-bg.png") repeat;  
152 - position: relative;  
153 - text-align: center;  
154 - .title {  
155 - height: 42px;  
156 - line-height: 42px;  
157 - background-color: rgba(255, 255, 255, .9);  
158 - font-size: 17px;  
159 - color: #4A4A4A;  
160 - font-weight: 500;  
161 - }  
162 - .tips-text {  
163 - margin-top: 44px;  
164 - margin-bottom: 10px;  
165 - font-size: 17px;  
166 - color: $corlorwhit;  
167 - }  
168 - .normalClass {  
169 - color: $corlorwhit;  
170 - }  
171 - .successClass {  
172 - color: #0f0;  
173 - }  
174 - .errorClass {  
175 - color: #f00;  
176 - }  
177 - input {  
178 - border: 0;  
179 - outline: 0;  
180 - width: 80%;  
181 - height: 1.253333rem;  
182 - line-height: 1.253333rem;  
183 - background-color: #fff;  
184 - font-size: 0.48rem;  
185 - color: #4A4A4A;  
186 - border-radius: 0.106667rem;  
187 - text-align: center;  
188 - font-weight: 500;  
189 - }  
190 - .toggle-btn {  
191 - height: 17px;  
192 - margin-top: 18px;  
193 - text-align: center;  
194 - cursor: pointer;  
195 - color: $corlorwhit;  
196 - font-size: 17px;  
197 - img {  
198 - width: 16px;  
199 - height: 16px;  
200 - vertical-align: top;  
201 - }  
202 - }  
203 - .commit-btn {  
204 - width: 80%;  
205 - height: 42px;  
206 - margin: 156px auto 0;  
207 - line-height: 42px;  
208 - border-radius: 21px;  
209 - background: #fff;  
210 - font-size: 18px;  
211 - color: #75CBBE;  
212 - cursor: pointer;  
213 - }  
214 - .inout-fix {  
215 - width: 100%;  
216 - height: 122px;  
217 - position: absolute;  
218 - bottom: 0;  
219 - background: url("../assets/inout-fix.png") no-repeat;  
220 - background-size: 100% 100%;  
221 - }  
222 - }  
223 -</style>  
src/components/pay.vue deleted
1 -<template>  
2 - <div class="pay-wrap">  
3 - <div class="title">订单支付</div>  
4 - <div class="tipstext">{{ title }}</div>  
5 - <div class="money">{{ money }}</div>  
6 - <div class="choosetext">选择支付方式</div>  
7 - <ul class="pay-way">  
8 - <li v-for="(item, index) in payArr" :key="index" :class="{checkedClass : index===currentId}" @click="currentId = index">  
9 - <span></span>  
10 - {{ item }}  
11 - </li>  
12 - </ul>  
13 - <div class="commit-btn" @click="commitsure">确认支付</div>  
14 - </div>  
15 -</template>  
16 -  
17 -<script>  
18 -export default {  
19 - name: 'Pay',  
20 - props: {  
21 - title: {  
22 - type: String,  
23 - default: ''  
24 - },  
25 - money: {  
26 - type: String,  
27 - default: ''  
28 - }  
29 - },  
30 - data() {  
31 - return {  
32 - payArr: ['支付宝支付', '微信支付'],  
33 - currentId: 0  
34 - }  
35 - },  
36 - methods: {  
37 - commitsure() {  
38 - alert(this.currentId)  
39 - }  
40 - }  
41 -}  
42 -</script>  
43 -  
44 -<style lang="scss" scoped>  
45 - .pay-wrap {  
46 - width: 100%;  
47 - height: 100%;  
48 - background-color: #eff4f5;  
49 - text-align: center;  
50 - .title {  
51 - height: 42px;  
52 - line-height: 42px;  
53 - background-color: rgba(255, 255, 255, .9);  
54 - font-size: 17px;  
55 - color: #4A4A4A;  
56 - font-weight: 500;  
57 - }  
58 - .tipstext {  
59 - margin: 35px auto 35px;  
60 - font-size: 18px;  
61 - font-weight: bold;  
62 - color: rgba(255, 7, 7, 1);  
63 - }  
64 - .money {  
65 - height: 48px;  
66 - line-height: 48px;  
67 - font-size: 48px;  
68 - font-weight: 400;  
69 - color: rgba(74, 74, 74, 1);  
70 - }  
71 - .choosetext {  
72 - padding-left: 10px;  
73 - margin: 60px 0 10px;  
74 - text-align: left;  
75 - font-size: 17px;  
76 - font-weight: 400;  
77 - color: rgba(74, 74, 74, 1);  
78 - }  
79 - .pay-way {  
80 - padding-left: 10px;  
81 - padding-right: 18px;  
82 - background-color: #fff;  
83 - text-align: left;  
84 - cursor: pointer;  
85 - li {  
86 - height: 43px;  
87 - line-height: 43px;  
88 - font-size: 14px;  
89 - font-weight: 400;  
90 - color: rgba(74, 74, 74, 1);  
91 - background-image: url("../assets/unchecked-icon.png");  
92 - background-repeat: no-repeat ;  
93 - background-position: right center ;  
94 - background-size: 18px 18px;  
95 - span {  
96 - width: 24px;  
97 - height: 24px;  
98 - display: inline-block;  
99 - margin-right: 11px;  
100 - vertical-align: middle;  
101 - }  
102 - &:nth-of-type(1) {  
103 - border-bottom: 1px solid rgba(240, 244, 245, 1);  
104 - span {  
105 - background: url("../assets/ali-icon.png") no-repeat;  
106 - background-size: 100% 100%;  
107 - }  
108 - }  
109 - &:nth-of-type(2) {  
110 - span {  
111 - background: url("../assets/wechat-icon.png") no-repeat;  
112 - background-size: 100% 100%;  
113 - }  
114 - }  
115 - }  
116 - .checkedClass{  
117 - background-image: url("../assets/checked-icon.png");  
118 - }  
119 - }  
120 - .commit-btn {  
121 - width: 80%;  
122 - height: 42px;  
123 - line-height: 42px;  
124 - margin: 120px auto 0;  
125 - border-radius: 21px;  
126 - background-color: #75CBBE;  
127 - font-size: 18px;  
128 - font-weight: 400;  
129 - color: rgba(255, 255, 255, 1);  
130 - }  
131 - }  
132 -</style>