Commit 123356536ce12b4ddbf0efa27228e9adf6282a2d
1 parent
06566009
房山临时车牌
Showing
4 changed files
with
666 additions
and
761 deletions
src/components/parkEnter.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div> | ||
| 3 | - <p class="enter-title">请输入手机号码</p> | ||
| 4 | - <mt-field style="width: 60%;margin: 10px auto;border: 1px solid #c1bfc5;font-size: 16px;border-radius: 2px;" label="" placeholder="请输入手机号" type="tel" v-model="phone" :attr="{ maxlength: 11 }"></mt-field> | ||
| 5 | - <p style="color:#3385ff;text-align: center;">手机号码是出场凭证,请您牢记!</p> | ||
| 6 | - <div class="okBtn" @click="onHandle">确定入场</div> | 2 | + <div class="park-enter-container"> |
| 3 | + <!-- 欢迎语模块 --> | ||
| 4 | + <div class="welcome-box">欢迎光临</div> | ||
| 5 | + | ||
| 6 | + <!-- 虚拟车牌展示模块 --> | ||
| 7 | + <div class="virtual-plate-box">{{ virtualPlate }}</div> | ||
| 8 | + | ||
| 9 | + <!-- 截屏提示模块 --> | ||
| 10 | + <div class="tips-red">请截屏保存虚拟车牌</div> | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + <!-- 服务说明模块 --> | ||
| 14 | + <div class="service-desc"> | ||
| 15 | + <!-- 出场方法 --> | ||
| 16 | + <div class="desc-item"> | ||
| 17 | + <i class="icon-car">🚗</i> | ||
| 18 | + <div class="desc-content"> | ||
| 19 | + <p class="title">出场方法</p> | ||
| 20 | + <p class="text">出口扫码缴费即可出场</p> | ||
| 21 | + </div> | ||
| 22 | + </div> | ||
| 23 | + <!-- 注意事项 --> | ||
| 24 | + <div class="desc-item"> | ||
| 25 | + <i class="icon-warning">!</i> | ||
| 26 | + <div class="desc-content"> | ||
| 27 | + <p class="title">注意事项</p> | ||
| 28 | + <p class="text">1.进出场、缴费扫码时,请保持使用同一部手机中同一扫码工具(微信、支付宝)</p> | ||
| 29 | + <p class="text">2.受充电桩功能限制,虚拟车牌不支持充电减免。(充电桩不支持虚拟车牌绑定)</p> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | + | ||
| 34 | + <!-- 确定入场按钮 --> | ||
| 35 | + <!-- <div class="okBtn" @click="onHandle">确定入场</div> --> | ||
| 7 | </div> | 36 | </div> |
| 8 | </template> | 37 | </template> |
| 9 | 38 | ||
| 10 | <script> | 39 | <script> |
| 11 | - | 40 | +// 导入接口(根据实际项目路径调整) |
| 12 | import { noCarQRcodeInOutPark } from '@/api/parkEnter/parkEnter' | 41 | import { noCarQRcodeInOutPark } from '@/api/parkEnter/parkEnter' |
| 13 | 42 | ||
| 14 | export default { | 43 | export default { |
| 15 | name: 'parkEnter', | 44 | name: 'parkEnter', |
| 16 | data() { | 45 | data() { |
| 17 | return { | 46 | return { |
| 47 | + // 页面请求参数 | ||
| 18 | query: {}, | 48 | query: {}, |
| 19 | - phone: '' | 49 | + // 虚拟车牌(实际项目中建议从接口获取,此处先写死示例) |
| 50 | + virtualPlate: '', | ||
| 51 | + // 入场图片地址(可从接口返回) | ||
| 52 | + enterImgUrl: '' | ||
| 20 | } | 53 | } |
| 21 | }, | 54 | }, |
| 22 | created() { | 55 | created() { |
| 23 | - this.query = this.$utils.getQueryString(window.location) | ||
| 24 | - console.log(this.query) | 56 | + // 初始化获取URL请求参数 |
| 57 | + this.initQueryParams() | ||
| 58 | + // 可选:初始化获取虚拟车牌 | ||
| 59 | + | ||
| 60 | + this.getVirtualPlate() | ||
| 25 | }, | 61 | }, |
| 26 | methods: { | 62 | methods: { |
| 27 | - onHandle: function () { | ||
| 28 | - // noCarQRcodeInOutPark | ||
| 29 | - if (!/^1[34578]\d{9}$/.test(this.phone)) { | ||
| 30 | - this.$msgbox('提示', '请输入正确手机号') | ||
| 31 | - return | 63 | + /** |
| 64 | + * 初始化获取URL请求参数 | ||
| 65 | + */ | ||
| 66 | + initQueryParams() { | ||
| 67 | + try { | ||
| 68 | + this.query = this.$utils.getQueryString(window.location) | ||
| 69 | + console.log('入场请求参数:', this.query) | ||
| 70 | + } catch (e) { | ||
| 71 | + console.error('获取请求参数失败:', e) | ||
| 72 | + this.query = {} | ||
| 73 | + } | ||
| 74 | + }, | ||
| 75 | + | ||
| 76 | + /** | ||
| 77 | + * 获取虚拟车牌(对接后端接口示例) | ||
| 78 | + */ | ||
| 79 | + async getVirtualPlate() { | ||
| 80 | + try { | ||
| 81 | + // 此处替换为实际获取虚拟车牌的接口 | ||
| 82 | + const requestParams = { | ||
| 83 | + ...this.query, | ||
| 84 | + app_id: 1, | ||
| 85 | + salt: 2, | ||
| 86 | + deviceInfo: 3, | ||
| 87 | + sign_type: 'md5', | ||
| 88 | + sign: 4, | ||
| 89 | + token: '666', | ||
| 90 | + // carNumber: this.virtualPlate, // 传虚拟车牌(替代原手机号) | ||
| 91 | + terminalSource: "7" // 1:任你听 3:微信公共号 4:云平台 7:H5 | ||
| 32 | } | 92 | } |
| 33 | - if (this.query == null) { | 93 | + const res = await noCarQRcodeInOutPark(requestParams) |
| 94 | + console.log(res); | ||
| 95 | + this.virtualPlate = res.data.plateno | ||
| 96 | + localStorage.setItem('virtualCarPlate', res.data.plateno) | ||
| 97 | + this.$msgbox('提示', '进场信息已录入,请您进场!') | ||
| 98 | + console.log('虚拟车牌已获取') | ||
| 99 | + } catch (e) { | ||
| 100 | + console.error('获取虚拟车牌失败:', e) | ||
| 101 | + this.$msgbox('提示', '获取虚拟车牌失败,请重试') | ||
| 102 | + } | ||
| 103 | + }, | ||
| 104 | + | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 确定入场按钮点击事件 | ||
| 108 | + */ | ||
| 109 | + async onHandle() { | ||
| 110 | + // 1. 校验请求参数 | ||
| 111 | + if (Object.keys(this.query).length === 0) { | ||
| 34 | this.$msgbox('提示', '没有接收到请求参数') | 112 | this.$msgbox('提示', '没有接收到请求参数') |
| 35 | return | 113 | return |
| 36 | } | 114 | } |
| 37 | 115 | ||
| 38 | - this.query.app_id = 1 | ||
| 39 | - this.query.salt = 2 | ||
| 40 | - this.query.deviceInfo = 3 | ||
| 41 | - this.query.sign_type = 'md5' | ||
| 42 | - this.query.sign = 4 | ||
| 43 | - this.query.token = '666' | ||
| 44 | - | ||
| 45 | - this.query.carNumber = this.phone | ||
| 46 | - this.query.terminalSource = "7";//增加字段:1:任你听 3:微信公共号 4:云平台 7:H5 | ||
| 47 | - noCarQRcodeInOutPark(this.query).then(res => { | ||
| 48 | - if (res.code == 0) { | 116 | + // 2. 组装接口请求参数 |
| 117 | + const requestParams = { | ||
| 118 | + ...this.query, | ||
| 119 | + app_id: 1, | ||
| 120 | + salt: 2, | ||
| 121 | + deviceInfo: 3, | ||
| 122 | + sign_type: 'md5', | ||
| 123 | + sign: 4, | ||
| 124 | + token: '666', | ||
| 125 | + carNumber: this.virtualPlate, // 传虚拟车牌(替代原手机号) | ||
| 126 | + terminalSource: "7" // 1:任你听 3:微信公共号 4:云平台 7:H5 | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + try { | ||
| 130 | + // 3. 调用入场接口 | ||
| 131 | + const res = await noCarQRcodeInOutPark(requestParams) | ||
| 132 | + if (res.code === 0) { | ||
| 49 | this.$msgbox('提示', '进场信息已录入,请您进场!') | 133 | this.$msgbox('提示', '进场信息已录入,请您进场!') |
| 50 | } else { | 134 | } else { |
| 51 | - this.$msgbox('提示', res.message) | 135 | + this.$msgbox('提示', res.message || '入场失败,请重试') |
| 52 | } | 136 | } |
| 53 | - }) | ||
| 54 | - | 137 | + } catch (e) { |
| 138 | + console.error('入场接口调用失败:', e) | ||
| 139 | + this.$msgbox('提示', '网络异常,请稍后重试') | ||
| 140 | + } | ||
| 55 | } | 141 | } |
| 56 | } | 142 | } |
| 57 | } | 143 | } |
| 58 | </script> | 144 | </script> |
| 59 | 145 | ||
| 60 | <style scoped lang="scss"> | 146 | <style scoped lang="scss"> |
| 61 | - .enter-title { | ||
| 62 | - margin-top: 45px; | ||
| 63 | - text-align: center; | ||
| 64 | - font-size: 18px; | ||
| 65 | - color: #000; | 147 | +// 全局容器样式 |
| 148 | +.park-enter-container { | ||
| 149 | + width: 100%; | ||
| 150 | + max-width: 500px; // 适配移动端,限制最大宽度 | ||
| 151 | + margin: 0 auto; | ||
| 152 | + padding: 20px 15px; | ||
| 153 | + box-sizing: border-box; | ||
| 154 | + background-color: #fff; | ||
| 155 | +} | ||
| 156 | + | ||
| 157 | +// 欢迎语盒子样式 | ||
| 158 | +.welcome-box { | ||
| 159 | + width: 100%; | ||
| 160 | + padding: 15px 0; | ||
| 161 | + text-align: center; | ||
| 162 | + font-size: 18px; | ||
| 163 | + color: #f97316; // 橙色字体 | ||
| 164 | + border: 1px solid #e5e7eb; | ||
| 165 | + border-radius: 2px; | ||
| 166 | + margin-bottom: 20px; | ||
| 167 | +} | ||
| 168 | + | ||
| 169 | +// 虚拟车牌盒子样式 | ||
| 170 | +.virtual-plate-box { | ||
| 171 | + width: 100%; | ||
| 172 | + height: 80px; | ||
| 173 | + line-height: 80px; | ||
| 174 | + text-align: center; | ||
| 175 | + font-size: 32px; | ||
| 176 | + font-weight: bold; | ||
| 177 | + color: #ffffff; | ||
| 178 | + background: linear-gradient(180deg, #3885D9 0%, #4194EF 100%); | ||
| 179 | + border-radius: 4px; | ||
| 180 | + margin-bottom: 15px; | ||
| 181 | + letter-spacing: 2px; // 增加字符间距,更像车牌 | ||
| 182 | +} | ||
| 183 | + | ||
| 184 | +// 红色提示样式 | ||
| 185 | +.tips-red { | ||
| 186 | + text-align: center; | ||
| 187 | + color: #ef4444; | ||
| 188 | + font-size: 16px; | ||
| 189 | + padding: 10px 0; | ||
| 190 | + border: 1px dashed #ef4444; | ||
| 191 | + border-radius: 2px; | ||
| 192 | + margin-bottom: 25px; | ||
| 193 | +} | ||
| 194 | + | ||
| 195 | + | ||
| 196 | +// 服务说明容器样式 | ||
| 197 | +.service-desc { | ||
| 198 | + margin-bottom: 50px; | ||
| 199 | + | ||
| 200 | + // 说明项样式 | ||
| 201 | + .desc-item { | ||
| 202 | + display: flex; | ||
| 203 | + align-items: flex-start; | ||
| 204 | + margin-bottom: 25px; | ||
| 205 | + | ||
| 206 | + // 图标样式 | ||
| 207 | + i { | ||
| 208 | + font-size: 24px; | ||
| 209 | + margin-right: 15px; | ||
| 210 | + margin-top: 2px; | ||
| 211 | + font-style: normal; // 清除默认斜体 | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + // 车辆图标 | ||
| 215 | + .icon-car { | ||
| 216 | + color: #3885D9; | ||
| 217 | + } | ||
| 218 | + | ||
| 219 | + // 警告图标 | ||
| 220 | + .icon-warning { | ||
| 221 | + display: inline-block; | ||
| 222 | + width: 24px; | ||
| 223 | + height: 24px; | ||
| 224 | + line-height: 24px; | ||
| 225 | + text-align: center; | ||
| 226 | + background: #f59e0b; | ||
| 227 | + color: #fff; | ||
| 228 | + border-radius: 50%; | ||
| 229 | + font-weight: bold; | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + // 说明内容样式 | ||
| 233 | + .desc-content { | ||
| 234 | + flex: 1; | ||
| 235 | + | ||
| 236 | + .title { | ||
| 237 | + font-size: 16px; | ||
| 238 | + color: #000; | ||
| 239 | + margin-bottom: 5px; | ||
| 240 | + font-weight: 500; | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + .text { | ||
| 244 | + font-size: 14px; | ||
| 245 | + color: #ef4444; | ||
| 246 | + line-height: 1.5; | ||
| 247 | + } | ||
| 248 | + } | ||
| 66 | } | 249 | } |
| 67 | - .okBtn{ | ||
| 68 | - background: linear-gradient(180deg, #3885D9 0%, #4194EF 100%); | ||
| 69 | - width: 60%; | ||
| 70 | - margin: 50px auto 0; | ||
| 71 | - height: 48px; | ||
| 72 | - line-height: 48px; | ||
| 73 | - text-align: center; | ||
| 74 | - border-radius: 5px; | ||
| 75 | - color: #ffffff; | ||
| 76 | - font-size: 18px; | ||
| 77 | - cursor: pointer; | 250 | +} |
| 251 | + | ||
| 252 | +// 确定入场按钮样式 | ||
| 253 | +.okBtn { | ||
| 254 | + background: linear-gradient(180deg, #3885D9 0%, #4194EF 100%); | ||
| 255 | + width: 60%; | ||
| 256 | + margin: 0 auto; | ||
| 257 | + height: 48px; | ||
| 258 | + line-height: 48px; | ||
| 259 | + text-align: center; | ||
| 260 | + border-radius: 5px; | ||
| 261 | + color: #ffffff; | ||
| 262 | + font-size: 18px; | ||
| 263 | + cursor: pointer; | ||
| 264 | + &:hover { | ||
| 265 | + opacity: 0.9; | ||
| 78 | } | 266 | } |
| 79 | -</style> | 267 | + &:active { |
| 268 | + opacity: 0.8; | ||
| 269 | + } | ||
| 270 | +} | ||
| 271 | +</style> | ||
| 80 | \ No newline at end of file | 272 | \ No newline at end of file |
src/components/pay.vue
| @@ -354,6 +354,7 @@ export default { | @@ -354,6 +354,7 @@ export default { | ||
| 354 | console.log('12') | 354 | console.log('12') |
| 355 | console.log(response); | 355 | console.log(response); |
| 356 | if (response.code == 0) {//进场 | 356 | if (response.code == 0) {//进场 |
| 357 | + localStorage.removeItem('virtualCarPlate'); | ||
| 357 | document.write(response.data);//打开支付表单 | 358 | document.write(response.data);//打开支付表单 |
| 358 | } else {//其他情况如【该卡号场内已存在】 | 359 | } else {//其他情况如【该卡号场内已存在】 |
| 359 | console.log(response); | 360 | console.log(response); |
| @@ -488,6 +489,7 @@ export default { | @@ -488,6 +489,7 @@ export default { | ||
| 488 | // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 | 489 | // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 |
| 489 | if (res.err_msg === "get_brand_wcpay_request:ok") { | 490 | if (res.err_msg === "get_brand_wcpay_request:ok") { |
| 490 | console.log("成功"); | 491 | console.log("成功"); |
| 492 | + localStorage.removeItem('virtualCarPlate'); | ||
| 491 | me.$msgbox("提示", "支付成功"); | 493 | me.$msgbox("提示", "支付成功"); |
| 492 | } else { | 494 | } else { |
| 493 | console.log("失败"); | 495 | console.log("失败"); |
src/components/plateNumber.vue
| 1 | <template> | 1 | <template> |
| 2 | <div id="page"> | 2 | <div id="page"> |
| 3 | <div class="wrap"> | 3 | <div class="wrap"> |
| 4 | - <!--<p style="margin-bottom: 18px;margin-top: 18px;">请选择车牌颜色</p>--> | ||
| 5 | - | ||
| 6 | - <!--<ul class="color-choose">--> | ||
| 7 | - <!--<li v-for="(i,index) in colorList" :key="i.name" @click="chooseColor(index)"--> | ||
| 8 | - <!--:style="{color:currentColor==index?'#FFF':'',background: currentColor==index?activeBG:'' }"--> | ||
| 9 | - <!-->--> | ||
| 10 | - <!--{{i.name}}--> | ||
| 11 | - <!--</li>--> | ||
| 12 | - | ||
| 13 | - <!--</ul>--> | ||
| 14 | - | ||
| 15 | - <p style="margin-bottom: 18px;margin-top: 18px;"> | ||
| 16 | - {{formData.commonCard == "3"?"请输入手机号码":"请输入车牌号码"}} | ||
| 17 | - </p> | 4 | + <!-- 输入区域:初始隐藏,缓存查询失败后显示 --> |
| 5 | + <div v-if="showInputArea"> | ||
| 6 | + <p style="margin-bottom: 18px;margin-top: 18px;"> | ||
| 7 | + {{formData.commonCard == "3"?"请输入入场时的虚拟临时车牌":"请输入车牌号码"}} | ||
| 8 | + </p> | ||
| 18 | 9 | ||
| 10 | + <div v-if="formData.commonCard == '3'"> | ||
| 11 | + <input type="text" class="iphone-box" v-model="carNum" maxlength="8"> | ||
| 12 | + </div> | ||
| 19 | 13 | ||
| 20 | - <div v-if="formData.commonCard == '3'"> | ||
| 21 | - <input type="text" class="iphone-box" v-model="carNum" maxlength="11" | ||
| 22 | - oninput="value=value.replace(/[^\d]/g,'')"> | ||
| 23 | - </div> | 14 | + <div class="num-box" v-else> |
| 15 | + <div class="num0" @click="clickFirstWrap()"> | ||
| 16 | + <span>{{formData.num0}}</span> | ||
| 17 | + </div> | ||
| 18 | + <div class="num1" @click="clickKeyWordWrap(1)"><span>{{formData.num1}}</span></div> | ||
| 19 | + <div class="num1" @click="clickKeyWordWrap(2)"><span>{{formData.num2}}</span></div> | ||
| 20 | + <div class="num1" @click="clickKeyWordWrap(3)"><span>{{formData.num3}}</span></div> | ||
| 21 | + <div class="num1" @click="clickKeyWordWrap(4)"><span>{{formData.num4}}</span></div> | ||
| 22 | + <div class="num1" @click="clickKeyWordWrap(5)"><span>{{formData.num5}}</span></div> | ||
| 23 | + <div class="num1" @click="clickKeyWordWrap(6)"><span>{{formData.num6}}</span></div> | ||
| 24 | + <div v-if="formData.commonCard == '2'" class="num1" @click="clickKeyWordWrap(7)"><span>{{formData.num7}}</span></div> | ||
| 25 | + </div> | ||
| 24 | 26 | ||
| 25 | - <div class="num-box" v-else> | ||
| 26 | - <div class="num0" @click="clickFirstWrap()"> | ||
| 27 | - <span>{{formData.num0}}</span> | 27 | + <div class="radio-box"> |
| 28 | + <label class="flex-items-center" @click="keyBoardStatus = true"> | ||
| 29 | + <img v-if="formData.commonCard == 1" src="../assets/images/icon_chose_s@2x.png" alt=""> | ||
| 30 | + <img v-else src="../assets/images/icon_chose_n@2x.png" alt=""> | ||
| 31 | + <input type="radio" v-model="formData.commonCard" value="1"/>普通车牌 | ||
| 32 | + </label> | ||
| 33 | + <label class="flex-items-center" @click="keyBoardStatus = true"> | ||
| 34 | + <img v-if="formData.commonCard == 2" src="../assets/images/icon_chose_s@2x.png" alt=""> | ||
| 35 | + <img v-else src="../assets/images/icon_chose_n@2x.png" alt=""> | ||
| 36 | + <input type="radio" v-model="formData.commonCard" value="2"/>新能源车牌 | ||
| 37 | + </label> | ||
| 38 | + <label class="flex-items-center" @click.self="changeTab"> | ||
| 39 | + <img v-if="formData.commonCard == 3" src="../assets/images/icon_chose_s@2x.png" alt=""> | ||
| 40 | + <img v-else src="../assets/images/icon_chose_n@2x.png" alt=""> | ||
| 41 | + <input type="radio" v-model="formData.commonCard" value="3"/>无牌车 | ||
| 42 | + </label> | ||
| 28 | </div> | 43 | </div> |
| 29 | - <div class="num1" @click="clickKeyWordWrap(1)"><span>{{formData.num1}}</span></div> | ||
| 30 | - <!--<em class="spot"></em>--> | ||
| 31 | - <div class="num1" @click="clickKeyWordWrap(2)"><span>{{formData.num2}}</span></div> | ||
| 32 | - <div class="num1" @click="clickKeyWordWrap(3)"><span>{{formData.num3}}</span></div> | ||
| 33 | - <div class="num1" @click="clickKeyWordWrap(4)"><span>{{formData.num4}}</span></div> | ||
| 34 | - <div class="num1" @click="clickKeyWordWrap(5)"><span>{{formData.num5}}</span></div> | ||
| 35 | - <div class="num1" @click="clickKeyWordWrap(6)"><span>{{formData.num6}}</span></div> | ||
| 36 | - <div v-if="formData.commonCard == '2'" class="num1" @click="clickKeyWordWrap(7)"><span>{{formData.num7}}</span> | 44 | + |
| 45 | + <div class="submit-box" @click="submitFn()"> | ||
| 46 | + 查询 | ||
| 37 | </div> | 47 | </div> |
| 38 | </div> | 48 | </div> |
| 39 | 49 | ||
| 40 | - | ||
| 41 | - <div class="radio-box"> | ||
| 42 | - <label class="flex-items-center" @click="keyBoardStatus = true"> | ||
| 43 | - <img v-if="formData.commonCard == 1" | ||
| 44 | - src="../assets/images/icon_chose_s@2x.png" | ||
| 45 | - alt=""> | ||
| 46 | - <img v-else | ||
| 47 | - src="../assets/images/icon_chose_n@2x.png" | ||
| 48 | - alt=""> | ||
| 49 | - <input type="radio" | ||
| 50 | - v-model="formData.commonCard" | ||
| 51 | - value="1"/>普通车牌 | ||
| 52 | - </label> | ||
| 53 | - <label class="flex-items-center" @click="keyBoardStatus = true"> | ||
| 54 | - <img v-if="formData.commonCard == 2" | ||
| 55 | - src="../assets/images/icon_chose_s@2x.png" | ||
| 56 | - alt=""> | ||
| 57 | - <img v-else | ||
| 58 | - src="../assets/images/icon_chose_n@2x.png" | ||
| 59 | - alt=""> | ||
| 60 | - <input type="radio" | ||
| 61 | - v-model="formData.commonCard" | ||
| 62 | - value="2"/>新能源车牌 | ||
| 63 | - </label> | ||
| 64 | - <label class="flex-items-center" @click.self="changeTab"> | ||
| 65 | - <img v-if="formData.commonCard == 3" | ||
| 66 | - src="../assets/images/icon_chose_s@2x.png" | ||
| 67 | - alt=""> | ||
| 68 | - <img v-else | ||
| 69 | - src="../assets/images/icon_chose_n@2x.png" | ||
| 70 | - alt=""> | ||
| 71 | - <input type="radio" | ||
| 72 | - v-model="formData.commonCard" | ||
| 73 | - value="3"/>无牌车 | ||
| 74 | - </label> | 50 | + <!-- 加载提示 --> |
| 51 | + <div v-if="loading" style="text-align: center; padding: 30px 0; font-size: 16px; color: #666;"> | ||
| 52 | + {{ loadingText }} | ||
| 75 | </div> | 53 | </div> |
| 54 | + </div> | ||
| 76 | 55 | ||
| 77 | - | ||
| 78 | - <div class="submit-box" @click="submitFn()"> | ||
| 79 | - 查询 | 56 | + <!-- 省份选择/自定义键盘区域(原有代码不变) --> |
| 57 | + <div class="first-word-wrap" v-if="firstWrapStatus"> | ||
| 58 | + <div class="first-word" @click="selectFirstWord($event)"> | ||
| 59 | + <div class="word"><span>蒙</span></div> | ||
| 60 | + <div class="word"><span>湘</span></div> | ||
| 61 | + <div class="word"><span>津</span></div> | ||
| 62 | + <div class="word"><span>鄂</span></div> | ||
| 63 | + <div class="word"><span>沪</span></div> | ||
| 64 | + <div class="word"><span>粤</span></div> | ||
| 65 | + <div class="word"><span>渝</span></div> | ||
| 66 | + <div class="word"><span>琼</span></div> | ||
| 80 | </div> | 67 | </div> |
| 81 | - </div> | ||
| 82 | - <div class="first-word-wrap" | ||
| 83 | - v-if="firstWrapStatus"> | ||
| 84 | - <div class="first-word" | ||
| 85 | - @click="selectFirstWord($event)"> | ||
| 86 | - <div class="word"> | ||
| 87 | - <span>蒙</span> | ||
| 88 | - </div> | ||
| 89 | - <div class="word"> | ||
| 90 | - <span>湘</span> | ||
| 91 | - </div> | ||
| 92 | - <div class="word"> | ||
| 93 | - <span>津</span> | ||
| 94 | - </div> | ||
| 95 | - <div class="word"> | ||
| 96 | - <span>鄂</span> | ||
| 97 | - </div> | ||
| 98 | - <div class="word"> | ||
| 99 | - <span>沪</span> | ||
| 100 | - </div> | ||
| 101 | - <div class="word"> | ||
| 102 | - <span>粤</span> | ||
| 103 | - </div> | ||
| 104 | - <div class="word"> | ||
| 105 | - <span>渝</span> | ||
| 106 | - </div> | ||
| 107 | - <div class="word"> | ||
| 108 | - <span>琼</span> | ||
| 109 | - </div> | 68 | + <div class="first-word" @click="selectFirstWord($event)"> |
| 69 | + <div class="word"><span>冀</span></div> | ||
| 70 | + <div class="word"><span>川</span></div> | ||
| 71 | + <div class="word"><span>晋</span></div> | ||
| 72 | + <div class="word"><span>贵</span></div> | ||
| 73 | + <div class="word"><span>辽</span></div> | ||
| 74 | + <div class="word"><span>云</span></div> | ||
| 75 | + <div class="word"><span>吉</span></div> | ||
| 76 | + <div class="word"><span>陕</span></div> | ||
| 110 | </div> | 77 | </div> |
| 111 | - <div class="first-word" | ||
| 112 | - @click="selectFirstWord($event)"> | ||
| 113 | - <div class="word"> | ||
| 114 | - <span>冀</span> | ||
| 115 | - </div> | ||
| 116 | - <div class="word"> | ||
| 117 | - <span>川</span> | ||
| 118 | - </div> | ||
| 119 | - <div class="word"> | ||
| 120 | - <span>晋</span> | ||
| 121 | - </div> | ||
| 122 | - <div class="word"> | ||
| 123 | - <span>贵</span> | ||
| 124 | - </div> | ||
| 125 | - <div class="word"> | ||
| 126 | - <span>辽</span> | ||
| 127 | - </div> | ||
| 128 | - <div class="word"> | ||
| 129 | - <span>云</span> | ||
| 130 | - </div> | ||
| 131 | - <div class="word"> | ||
| 132 | - <span>吉</span> | ||
| 133 | - </div> | ||
| 134 | - <div class="word"> | ||
| 135 | - <span>陕</span> | ||
| 136 | - </div> | 78 | + <div class="first-word" @click="selectFirstWord($event)"> |
| 79 | + <div class="word"><span>黑</span></div> | ||
| 80 | + <div class="word"><span>甘</span></div> | ||
| 81 | + <div class="word"><span>苏</span></div> | ||
| 82 | + <div class="word"><span>青</span></div> | ||
| 83 | + <div class="word"><span>浙</span></div> | ||
| 84 | + <div class="word"><span>皖</span></div> | ||
| 85 | + <div class="word"><span>藏</span></div> | ||
| 86 | + <div class="word"><span>闽</span></div> | ||
| 137 | </div> | 87 | </div> |
| 138 | - <div class="first-word" | ||
| 139 | - @click="selectFirstWord($event)"> | ||
| 140 | - <div class="word"> | ||
| 141 | - <span>黑</span> | ||
| 142 | - </div> | ||
| 143 | - <div class="word"> | ||
| 144 | - <span>甘</span> | ||
| 145 | - </div> | ||
| 146 | - <div class="word"> | ||
| 147 | - <span>苏</span> | ||
| 148 | - </div> | ||
| 149 | - <div class="word"> | ||
| 150 | - <span>青</span> | ||
| 151 | - </div> | ||
| 152 | - <div class="word"> | ||
| 153 | - <span>浙</span> | ||
| 154 | - </div> | ||
| 155 | - <div class="word"> | ||
| 156 | - <span>皖</span> | ||
| 157 | - </div> | ||
| 158 | - <div class="word"> | ||
| 159 | - <span>藏</span> | ||
| 160 | - </div> | ||
| 161 | - <div class="word"> | ||
| 162 | - <span>闽</span> | ||
| 163 | - </div> | ||
| 164 | - </div> | ||
| 165 | - <div class="first-word" | ||
| 166 | - @click="selectFirstWord($event)"> | ||
| 167 | - <div class="word"> | ||
| 168 | - <span>京</span> | ||
| 169 | - </div> | ||
| 170 | - <div class="word"> | ||
| 171 | - <span>赣</span> | ||
| 172 | - </div> | ||
| 173 | - <div class="word"> | ||
| 174 | - <span>桂</span> | ||
| 175 | - </div> | ||
| 176 | - <div class="word"> | ||
| 177 | - <span>鲁</span> | ||
| 178 | - </div> | ||
| 179 | - <div class="word"> | ||
| 180 | - <span>宁</span> | ||
| 181 | - </div> | ||
| 182 | - <div class="word"> | ||
| 183 | - <span>豫</span> | ||
| 184 | - </div> | ||
| 185 | - <div class="word"> | ||
| 186 | - <span>新</span> | ||
| 187 | - </div> | ||
| 188 | - <div class="word bordernone"> | ||
| 189 | - <!-- <img src="../assets/images/icon-switch.png" alt=""> --> | ||
| 190 | - </div> | 88 | + <div class="first-word" @click="selectFirstWord($event)"> |
| 89 | + <div class="word"><span>京</span></div> | ||
| 90 | + <div class="word"><span>赣</span></div> | ||
| 91 | + <div class="word"><span>桂</span></div> | ||
| 92 | + <div class="word"><span>鲁</span></div> | ||
| 93 | + <div class="word"><span>宁</span></div> | ||
| 94 | + <div class="word"><span>豫</span></div> | ||
| 95 | + <div class="word"><span>新</span></div> | ||
| 96 | + <div class="word bordernone"></div> | ||
| 191 | </div> | 97 | </div> |
| 192 | </div> | 98 | </div> |
| 193 | <div class="keyboard-wrap" v-show="keyBoardStatus == true"> | 99 | <div class="keyboard-wrap" v-show="keyBoardStatus == true"> |
| 194 | - <!-- <div class="number-wrap"></div> | ||
| 195 | - <div class="letter-wrap"></div> | ||
| 196 | - <div class="cn-wrap"></div> --> | ||
| 197 | <div class="keyboard" v-if="activeKeyWordIndex !== 1"> | 100 | <div class="keyboard" v-if="activeKeyWordIndex !== 1"> |
| 198 | - <span v-for="(item,index) in allKeyWord._1" | ||
| 199 | - :key="index" | ||
| 200 | - @click="clickKeyBoard(item)">{{item}}</span> | 101 | + <span v-for="(item,index) in allKeyWord._1" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 201 | </div> | 102 | </div> |
| 202 | <div class="keyboard" v-if="activeKeyWordIndex !== 1"> | 103 | <div class="keyboard" v-if="activeKeyWordIndex !== 1"> |
| 203 | - <span v-for="(item,index) in allKeyWord._2" | ||
| 204 | - :key="index" | ||
| 205 | - @click="clickKeyBoard(item)">{{item}}</span> | 104 | + <span v-for="(item,index) in allKeyWord._2" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 206 | <span class="bordernone"></span> | 105 | <span class="bordernone"></span> |
| 207 | <span class="bordernone"></span> | 106 | <span class="bordernone"></span> |
| 208 | <span class="bordernone"></span> | 107 | <span class="bordernone"></span> |
| 209 | <span class="bordernone"></span> | 108 | <span class="bordernone"></span> |
| 210 | </div> | 109 | </div> |
| 211 | <div class="keyboard"> | 110 | <div class="keyboard"> |
| 212 | - <span v-for="(item,index) in allKeyWord._3" | ||
| 213 | - :key="index" | ||
| 214 | - @click="clickKeyBoard(item)">{{item}}</span> | 111 | + <span v-for="(item,index) in allKeyWord._3" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 215 | </div> | 112 | </div> |
| 216 | <div class="keyboard"> | 113 | <div class="keyboard"> |
| 217 | - <span v-for="(item,index) in allKeyWord._4" | ||
| 218 | - :key="index" | ||
| 219 | - @click="clickKeyBoard(item)">{{item}}</span> | 114 | + <span v-for="(item,index) in allKeyWord._4" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 220 | </div> | 115 | </div> |
| 221 | <div class="keyboard"> | 116 | <div class="keyboard"> |
| 222 | - <span v-for="(item,index) in allKeyWord._5" | ||
| 223 | - :key="index" | ||
| 224 | - @click="clickKeyBoard(item)">{{item}}</span> | 117 | + <span v-for="(item,index) in allKeyWord._5" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 225 | </div> | 118 | </div> |
| 226 | <div class="keyboard"> | 119 | <div class="keyboard"> |
| 227 | - <span v-for="(item,index) in allKeyWord._6" | ||
| 228 | - :key="index" | ||
| 229 | - @click="clickKeyBoard(item)">{{item}}</span> | 120 | + <span v-for="(item,index) in allKeyWord._6" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 230 | <span class="bordernone"></span> | 121 | <span class="bordernone"></span> |
| 231 | <span class="bordernone"></span> | 122 | <span class="bordernone"></span> |
| 232 | <span class="bordernone"></span> | 123 | <span class="bordernone"></span> |
| 233 | - <!-- <span class="bordernone" v-if="activeKeyWordIndex === 1"></span> | ||
| 234 | - <span class="bordernone" v-if="activeKeyWordIndex === 1"></span> --> | ||
| 235 | - <!-- <span @click="deleteWord" v-if="activeKeyWordIndex === 1">x</span> --> | ||
| 236 | </div> | 124 | </div> |
| 237 | <div class="keyboard" v-if="activeKeyWordIndex !== 1"> | 125 | <div class="keyboard" v-if="activeKeyWordIndex !== 1"> |
| 238 | - <span v-for="(item,index) in allKeyWord._7" | ||
| 239 | - :key="index" | ||
| 240 | - @click="clickKeyBoard(item)">{{item}}</span> | 126 | + <span v-for="(item,index) in allKeyWord._7" :key="index" @click="clickKeyBoard(item)">{{item}}</span> |
| 241 | <span class="bordernone"></span> | 127 | <span class="bordernone"></span> |
| 242 | <span class="delete" @click="deleteWord"><img src="../assets/images/icon-delete.png" alt=""></span> | 128 | <span class="delete" @click="deleteWord"><img src="../assets/images/icon-delete.png" alt=""></span> |
| 243 | </div> | 129 | </div> |
| @@ -245,36 +131,20 @@ | @@ -245,36 +131,20 @@ | ||
| 245 | <span @click="keyBoardStatus = false">完成</span> | 131 | <span @click="keyBoardStatus = false">完成</span> |
| 246 | </div> | 132 | </div> |
| 247 | </div> | 133 | </div> |
| 248 | - | ||
| 249 | - | ||
| 250 | </div> | 134 | </div> |
| 251 | </template> | 135 | </template> |
| 136 | + | ||
| 252 | <script> | 137 | <script> |
| 253 | import { noCarQRcodeInOutPark } from "@/api/plateNumber/plateNumber"; | 138 | import { noCarQRcodeInOutPark } from "@/api/plateNumber/plateNumber"; |
| 254 | export default { | 139 | export default { |
| 255 | data() { | 140 | data() { |
| 256 | return { | 141 | return { |
| 257 | colorList: [ | 142 | colorList: [ |
| 258 | - { | ||
| 259 | - name: "蓝牌", | ||
| 260 | - id: "1" | ||
| 261 | - }, | ||
| 262 | - { | ||
| 263 | - name: "黄牌", | ||
| 264 | - id: "2" | ||
| 265 | - }, | ||
| 266 | - { | ||
| 267 | - name: "绿牌", | ||
| 268 | - id: "3" | ||
| 269 | - }, | ||
| 270 | - { | ||
| 271 | - name: "白牌", | ||
| 272 | - id: "4" | ||
| 273 | - }, | ||
| 274 | - { | ||
| 275 | - name: "黑牌", | ||
| 276 | - id: "5" | ||
| 277 | - } | 143 | + { name: "蓝牌", id: "1" }, |
| 144 | + { name: "黄牌", id: "2" }, | ||
| 145 | + { name: "绿牌", id: "3" }, | ||
| 146 | + { name: "白牌", id: "4" }, | ||
| 147 | + { name: "黑牌", id: "5" } | ||
| 278 | ], | 148 | ], |
| 279 | currentColor: 0, | 149 | currentColor: 0, |
| 280 | activeBG: "#0054C0", | 150 | activeBG: "#0054C0", |
| @@ -298,178 +168,201 @@ export default { | @@ -298,178 +168,201 @@ export default { | ||
| 298 | _6: ["W", "X", "Y", "Z"], | 168 | _6: ["W", "X", "Y", "Z"], |
| 299 | _7: ["港", "澳", "学", "领", "警"] | 169 | _7: ["港", "澳", "学", "领", "警"] |
| 300 | }, | 170 | }, |
| 301 | - activeKeyWordIndex: 1, // 当前车牌号 | 171 | + activeKeyWordIndex: 1, |
| 302 | keyBoardStatus: false, | 172 | keyBoardStatus: false, |
| 303 | - firstWrapStatus: false, // 选择弹窗 | ||
| 304 | - confirmTitle: "", | ||
| 305 | - submitConfirm: false, | ||
| 306 | - submitConfirmFalse: false, | ||
| 307 | - submitConfirmText: "", | 173 | + firstWrapStatus: false, |
| 308 | carNum: "", | 174 | carNum: "", |
| 309 | - tip: "车牌号" | 175 | + // 新增核心状态 |
| 176 | + showInputArea: false, // 是否显示输入框 | ||
| 177 | + loading: true, // 加载状态 | ||
| 178 | + loadingText: "正在查询订单费用...", // 加载提示文本 | ||
| 179 | + queryType: "url" // 当前查询类型:url/缓存/manual | ||
| 310 | }; | 180 | }; |
| 311 | }, | 181 | }, |
| 312 | mounted() { | 182 | mounted() { |
| 313 | - console.log(window.location); | ||
| 314 | - console.log(this.$route.query); | ||
| 315 | - // if (this.$utils.clientBrowser() == "微信") { | ||
| 316 | - // var appID = this.$utils.myVxAppId; | ||
| 317 | - // var code = this.getUrlParam('code'); | ||
| 318 | - // var local = window.location.href; | ||
| 319 | - // if (code == null || code === '') { | ||
| 320 | - // window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appID+'&redirect_uri='+encodeURIComponent(local)+'&response_type=code&scope=snsapi_base&state=1,0#wechat_redirect' | ||
| 321 | - // } else { | ||
| 322 | - // return code; | ||
| 323 | - // } | ||
| 324 | - // } | ||
| 325 | - let params = this.$route.query; | ||
| 326 | - if (Object.keys(params).length == 0) { | 183 | + const params = this.$route.query; |
| 184 | + // URL有参数时,启动「URL参数→缓存→手动」查询流程 | ||
| 185 | + if (Object.keys(params).length > 0) { | ||
| 186 | + this.queryByUrlParams(); | ||
| 327 | } else { | 187 | } else { |
| 328 | - this.noCarQRcodeInOutPark(); | 188 | + this.loading = false; |
| 189 | + this.showInputArea = true; | ||
| 329 | } | 190 | } |
| 330 | }, | 191 | }, |
| 331 | methods: { | 192 | methods: { |
| 332 | - getUrlParam(name) { | ||
| 333 | - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); | ||
| 334 | - var r = window.location.search.substr(1).match(reg); | ||
| 335 | - if (r != null) return unescape(r[2]); | ||
| 336 | - return null; | ||
| 337 | - }, | ||
| 338 | - // chooseColor (index){ // 颜色选择 | ||
| 339 | - // this.currentColor = index | ||
| 340 | - // switch (this.currentColor) { | ||
| 341 | - // case 0 : | ||
| 342 | - // return this.activeBG = '#0054C0' | ||
| 343 | - // break; | ||
| 344 | - // case 1 : | ||
| 345 | - // return this.activeBG = '#FEBE00' | ||
| 346 | - // break; | ||
| 347 | - // case 2 : | ||
| 348 | - // return this.activeBG = '#97DEA1' | ||
| 349 | - // break; | ||
| 350 | - // case 3 : | ||
| 351 | - // return this.activeBG = '#E4E5E7' | ||
| 352 | - // break; | ||
| 353 | - // case 4 : | ||
| 354 | - // return this.activeBG = '#333333' | ||
| 355 | - // break; | ||
| 356 | - // } | ||
| 357 | - // }, | ||
| 358 | - noCarQRcodeInOutPark() { | ||
| 359 | - let params = this.$route.query; | ||
| 360 | - params.payType = this.$utils.IsWeixinOrAlipay();//4:微信 1:支付宝 34:农行 | ||
| 361 | - params.terminalSource = "7";//1:任你听 3:微信公共号 4:云平台 7:H5 | ||
| 362 | - params.app_id = 1; | ||
| 363 | - params.salt = 2; | ||
| 364 | - params.deviceInfo = 3; | ||
| 365 | - params.sign_type = "md5"; | ||
| 366 | - params.sign = 4; | ||
| 367 | - params.token = "666"; | ||
| 368 | - params.carNumber = this.carNum; | ||
| 369 | - noCarQRcodeInOutPark(params).then(res => { | ||
| 370 | - console.log(res); | ||
| 371 | - if (res.code == 0) {//进场 | ||
| 372 | - //alertMsg("出场成功"); | ||
| 373 | - if (res.data) { | ||
| 374 | - var tmpObj = res.data; | ||
| 375 | - console.log(tmpObj); | ||
| 376 | - //判断是否需要支付 | ||
| 377 | - // if (tmpObj.needPay) { | ||
| 378 | - // var queryParams = this.$utils.parseParams(tmpObj); | ||
| 379 | - // console.log(queryParams); | ||
| 380 | - // // // | ||
| 381 | - // this.$router.push({ | ||
| 382 | - // path: "pay", | ||
| 383 | - // query: tmpObj | ||
| 384 | - // }); | ||
| 385 | - // // window.location.href = "../pay.html?" + queryParams; | ||
| 386 | - // } else { | ||
| 387 | - // this.$msgbox("提示", "无需缴费,欢迎下次光临"); | ||
| 388 | - // } | ||
| 389 | - | ||
| 390 | - | 193 | + // 步骤1:用URL参数查询费用 |
| 194 | + queryByUrlParams() { | ||
| 195 | + this.loadingText = "正在查询订单费用..."; | ||
| 196 | + const params = this.$route.query; | ||
| 197 | + // 组装接口参数 | ||
| 198 | + const apiParams = { | ||
| 199 | + ...params, | ||
| 200 | + payType: this.$utils.IsWeixinOrAlipay(), | ||
| 201 | + terminalSource: "7", | ||
| 202 | + app_id: 1, | ||
| 203 | + salt: 2, | ||
| 204 | + deviceInfo: 3, | ||
| 205 | + sign_type: "md5", | ||
| 206 | + sign: 4, | ||
| 207 | + token: "666", | ||
| 208 | + carNumber: params.carNumber || "" // URL中的车牌(如果有) | ||
| 209 | + }; | ||
| 391 | 210 | ||
| 392 | - // var queryParams = this.$utils.parseParams(tmpObj); | ||
| 393 | - sessionStorage.setItem('tmpObjCookie', JSON.stringify(tmpObj)) | 211 | + noCarQRcodeInOutPark(apiParams).then(res => { |
| 212 | + if (res.code === 0 && res.data) { | ||
| 213 | + // URL参数查询到费用 → 跳支付页 | ||
| 214 | + sessionStorage.setItem('tmpObjCookie', JSON.stringify(res.data)); | ||
| 215 | + this.$router.push({ path: "pay" }); | ||
| 216 | + } else { | ||
| 217 | + // URL参数未查询到费用 → 执行步骤2:缓存车牌查询 | ||
| 218 | + this.queryByCachePlate(); | ||
| 219 | + } | ||
| 220 | + }).catch(err => { | ||
| 221 | + console.error("URL参数查询失败:", err); | ||
| 222 | + // URL查询异常 → 执行步骤2:缓存车牌查询 | ||
| 223 | + this.queryByCachePlate(); | ||
| 224 | + }); | ||
| 225 | + }, | ||
| 394 | 226 | ||
| 395 | - // console.log(queryParams); | ||
| 396 | - // // | ||
| 397 | - this.$router.push({ | ||
| 398 | - path: "pay", | ||
| 399 | - // query: tmpObj | ||
| 400 | - }); | 227 | + // 步骤2:用缓存车牌查询费用 |
| 228 | + queryByCachePlate() { | ||
| 229 | + this.loadingText = "正在尝试缓存车牌查询..."; | ||
| 230 | + const cachePlate = localStorage.getItem('virtualCarPlate'); | ||
| 231 | + // 无缓存车牌 → 直接显示输入框 | ||
| 232 | + if (!cachePlate) { | ||
| 233 | + this.loading = false; | ||
| 234 | + this.showInputArea = true; | ||
| 235 | + this.$msgbox("提示", "未查询到订单信息,请手动输入车牌查询"); | ||
| 236 | + return; | ||
| 237 | + } | ||
| 401 | 238 | ||
| 239 | + const params = this.$route.query; | ||
| 240 | + // 组装接口参数(用缓存车牌) | ||
| 241 | + const apiParams = { | ||
| 242 | + ...params, | ||
| 243 | + payType: this.$utils.IsWeixinOrAlipay(), | ||
| 244 | + terminalSource: "7", | ||
| 245 | + app_id: 1, | ||
| 246 | + salt: 2, | ||
| 247 | + deviceInfo: 3, | ||
| 248 | + sign_type: "md5", | ||
| 249 | + sign: 4, | ||
| 250 | + token: "666", | ||
| 251 | + carNumber: cachePlate | ||
| 252 | + }; | ||
| 402 | 253 | ||
| 254 | + noCarQRcodeInOutPark(apiParams).then(res => { | ||
| 255 | + this.loading = false; | ||
| 256 | + if (res.code === 0 && res.data) { | ||
| 257 | + // 缓存车牌查询到费用 → 跳支付页 | ||
| 258 | + sessionStorage.setItem('tmpObjCookie', JSON.stringify(res.data)); | ||
| 259 | + this.$router.push({ path: "pay" }); | ||
| 260 | + } else { | ||
| 261 | + // 缓存车牌未查询到费用 → 显示输入框 | ||
| 262 | + this.showInputArea = true; | ||
| 263 | + this.$msgbox("提示", `缓存车牌【${cachePlate}】未查询到订单,请手动输入车牌查询`); | ||
| 264 | + } | ||
| 265 | + }).catch(err => { | ||
| 266 | + this.loading = false; | ||
| 267 | + console.error("缓存车牌查询失败:", err); | ||
| 268 | + // 缓存查询异常 → 显示输入框 | ||
| 269 | + this.showInputArea = true; | ||
| 270 | + this.$msgbox("提示", "缓存车牌查询失败,请手动输入车牌重试"); | ||
| 271 | + }); | ||
| 272 | + }, | ||
| 403 | 273 | ||
| 404 | - } else { | ||
| 405 | - this.$msgbox("提示", "没有找到订单"); | ||
| 406 | - } | 274 | + // 步骤3:用户手动输入车牌查询 |
| 275 | + submitFn() { | ||
| 276 | + // 校验输入 | ||
| 277 | + let plateLicense = ""; | ||
| 278 | + if (this.formData.commonCard === "1") { | ||
| 279 | + plateLicense = this.palindrome(this.plate_license_1); | ||
| 280 | + if (plateLicense.length < 7) { | ||
| 281 | + this.$msgbox("提示", "请输入正确的普通车牌号(7位)"); | ||
| 282 | + return; | ||
| 407 | } | 283 | } |
| 408 | - else if (res.code == 1031) { // 当前道闸禁止通行 | ||
| 409 | - sessionStorage.setItem("noPassText", res.message); | ||
| 410 | - this.$router.push({ | ||
| 411 | - path: "noPass" | ||
| 412 | - // query: tmpObj.message | ||
| 413 | - }); | 284 | + } else if (this.formData.commonCard === "2") { |
| 285 | + plateLicense = this.palindrome(this.plate_license_2); | ||
| 286 | + if (plateLicense.length < 8) { | ||
| 287 | + this.$msgbox("提示", "请输入正确的新能源车牌号(8位)"); | ||
| 288 | + return; | ||
| 414 | } | 289 | } |
| 415 | - else {//其他情况如【该卡号场内已存在】 | ||
| 416 | - console.log(res.message); | ||
| 417 | - if(res.message == '车辆不在场内'){ | ||
| 418 | - this.$msgbox("提示", '未查询到车辆订单!无牌车请选择无牌车查询订单'); | 290 | + } else if (this.formData.commonCard === "3") { |
| 291 | + plateLicense = this.carNum.trim(); | ||
| 292 | + if (!plateLicense) { | ||
| 293 | + this.$msgbox("提示", "请输入虚拟临时车牌"); | ||
| 294 | + return; | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + this.carNum = plateLicense; | ||
| 419 | 298 | ||
| 420 | - }else{ | ||
| 421 | - this.$msgbox("提示", res.message); | 299 | + // 调用接口查询 |
| 300 | + this.loading = true; | ||
| 301 | + this.loadingText = "正在查询..."; | ||
| 302 | + const params = this.$route.query; | ||
| 303 | + const apiParams = { | ||
| 304 | + ...params, | ||
| 305 | + payType: this.$utils.IsWeixinOrAlipay(), | ||
| 306 | + terminalSource: "7", | ||
| 307 | + app_id: 1, | ||
| 308 | + salt: 2, | ||
| 309 | + deviceInfo: 3, | ||
| 310 | + sign_type: "md5", | ||
| 311 | + sign: 4, | ||
| 312 | + token: "666", | ||
| 313 | + carNumber: plateLicense | ||
| 314 | + }; | ||
| 422 | 315 | ||
| 423 | - } | 316 | + noCarQRcodeInOutPark(apiParams).then(res => { |
| 317 | + this.loading = false; | ||
| 318 | + if (res.code === 0 && res.data) { | ||
| 319 | + // 手动输入查询到费用 → 跳支付页 | ||
| 320 | + sessionStorage.setItem('tmpObjCookie', JSON.stringify(res.data)); | ||
| 321 | + this.$router.push({ path: "pay" }); | ||
| 322 | + } else { | ||
| 323 | + // 手动输入未查询到费用 → 提示 | ||
| 324 | + this.$msgbox("提示", res.message || "未查询到该车牌的订单信息"); | ||
| 424 | } | 325 | } |
| 326 | + }).catch(err => { | ||
| 327 | + this.loading = false; | ||
| 328 | + console.error("手动查询失败:", err); | ||
| 329 | + this.$msgbox("提示", "查询失败,请稍后重试"); | ||
| 425 | }); | 330 | }); |
| 426 | }, | 331 | }, |
| 332 | + | ||
| 333 | + // 原有辅助方法(不变) | ||
| 334 | + getUrlParam(name) { | ||
| 335 | + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); | ||
| 336 | + var r = window.location.search.substr(1).match(reg); | ||
| 337 | + if (r != null) return unescape(r[2]); | ||
| 338 | + return null; | ||
| 339 | + }, | ||
| 427 | changeTab() { | 340 | changeTab() { |
| 428 | - // this.firstSelectStatus = false | ||
| 429 | - // this.firstWrapStatus = false | ||
| 430 | this.keyBoardStatus = false; | 341 | this.keyBoardStatus = false; |
| 431 | - this.firstClickStatus = false; | ||
| 432 | this.firstWrapStatus = false; | 342 | this.firstWrapStatus = false; |
| 433 | }, | 343 | }, |
| 434 | clickFirstWrap() { | 344 | clickFirstWrap() { |
| 435 | - // 点击第一个输入框 | ||
| 436 | - this.firstClickStatus = true; | ||
| 437 | this.firstWrapStatus = true; | 345 | this.firstWrapStatus = true; |
| 438 | this.keyBoardStatus = false; | 346 | this.keyBoardStatus = false; |
| 439 | this.formData.num0 = ""; | 347 | this.formData.num0 = ""; |
| 440 | }, | 348 | }, |
| 441 | selectFirstWord(event) { | 349 | selectFirstWord(event) { |
| 442 | - // 选择省份 | ||
| 443 | - if (event.target.localName !== "span") { | ||
| 444 | - return; | ||
| 445 | - } | 350 | + if (event.target.localName !== "span") return; |
| 446 | this.formData.num0 = event.target.innerText; | 351 | this.formData.num0 = event.target.innerText; |
| 447 | - this.firstSelectStatus = true; | ||
| 448 | this.firstWrapStatus = false; | 352 | this.firstWrapStatus = false; |
| 449 | - this.firstClickStatus = false; | ||
| 450 | this.keyBoardStatus = true; | 353 | this.keyBoardStatus = true; |
| 451 | this.activeKeyWordIndex = 1; | 354 | this.activeKeyWordIndex = 1; |
| 452 | - // this.$refs.num1.focus() | ||
| 453 | - // document.getElementById('num1').focus() | ||
| 454 | }, | 355 | }, |
| 455 | - clickKeyBoard(item) { // 点击自定义键盘 | ||
| 456 | - console.log(item); | 356 | + clickKeyBoard(item) { |
| 457 | this.formData["num" + this.activeKeyWordIndex] = item; | 357 | this.formData["num" + this.activeKeyWordIndex] = item; |
| 458 | - if (this.formData.commonCard === "1") { | 358 | + const maxIndex = this.formData.commonCard === "1" ? 6 : 7; |
| 359 | + if (this.activeKeyWordIndex < maxIndex) { | ||
| 459 | this.activeKeyWordIndex++; | 360 | this.activeKeyWordIndex++; |
| 460 | - if (this.activeKeyWordIndex > 6) { | ||
| 461 | - this.keyBoardStatus = false; | ||
| 462 | - } | ||
| 463 | } else { | 361 | } else { |
| 464 | - this.activeKeyWordIndex++; | ||
| 465 | - if (this.activeKeyWordIndex > 7) { | ||
| 466 | - this.keyBoardStatus = false; | ||
| 467 | - } | 362 | + this.keyBoardStatus = false; |
| 468 | } | 363 | } |
| 469 | }, | 364 | }, |
| 470 | - deleteWord() { // 退格 | ||
| 471 | - // console.log(this.activeKeyWordIndex) | ||
| 472 | - // console.log(this.formData['num' + (this.activeKeyWordIndex - 1)]) | 365 | + deleteWord() { |
| 473 | if (this.activeKeyWordIndex > 1) { | 366 | if (this.activeKeyWordIndex > 1) { |
| 474 | this.formData["num" + (this.activeKeyWordIndex - 1)] = ""; | 367 | this.formData["num" + (this.activeKeyWordIndex - 1)] = ""; |
| 475 | this.activeKeyWordIndex--; | 368 | this.activeKeyWordIndex--; |
| @@ -480,68 +373,13 @@ export default { | @@ -480,68 +373,13 @@ export default { | ||
| 480 | this.activeKeyWordIndex = activeKeyWordIndex; | 373 | this.activeKeyWordIndex = activeKeyWordIndex; |
| 481 | this.formData["num" + this.activeKeyWordIndex] = ""; | 374 | this.formData["num" + this.activeKeyWordIndex] = ""; |
| 482 | }, | 375 | }, |
| 483 | - submitFn() { | ||
| 484 | - | ||
| 485 | - let plateLicense; | ||
| 486 | - if (this.formData.commonCard === "1") { | ||
| 487 | - plateLicense = this.plate_license_1; | ||
| 488 | - plateLicense = this.palindrome(plateLicense); | ||
| 489 | - if (plateLicense.length < 7) { | ||
| 490 | - this.$msgbox("提示", "请输入正确车牌号"); | ||
| 491 | - return; | ||
| 492 | - } | ||
| 493 | - this.carNum = plateLicense; | ||
| 494 | - } | ||
| 495 | - if (this.formData.commonCard === "2") { | ||
| 496 | - plateLicense = this.plate_license_2; | ||
| 497 | - plateLicense = this.palindrome(plateLicense); | ||
| 498 | - if (plateLicense.length < 8) { | ||
| 499 | - this.$msgbox("提示", "请输入正确车牌号"); | ||
| 500 | - return; | ||
| 501 | - } | ||
| 502 | - this.carNum = plateLicense; | ||
| 503 | - } | ||
| 504 | - console.log(plateLicense); | ||
| 505 | - if (this.formData.commonCard === "3") { | ||
| 506 | - plateLicense = this.plate_license_2; | ||
| 507 | - plateLicense = this.palindrome(plateLicense); | ||
| 508 | - if (this.carNum.length < 11) { | ||
| 509 | - this.$msgbox("提示", "请输入正确手机号"); | ||
| 510 | - return; | ||
| 511 | - } | ||
| 512 | - // this.carNum = this.carNum + "111"; | ||
| 513 | - this.carNum = "无"+this.carNum | ||
| 514 | - } | ||
| 515 | - // | ||
| 516 | - // this.$emit('getPlateLicense', plateLicense) | ||
| 517 | - console.log(plateLicense); | ||
| 518 | - // this.$router.push({ | ||
| 519 | - // path: 'pay', | ||
| 520 | - // query: { | ||
| 521 | - // carNumber: plateLicense | ||
| 522 | - // } | ||
| 523 | - // }) | ||
| 524 | - this.noCarQRcodeInOutPark(); | ||
| 525 | - }, | ||
| 526 | palindrome(str) { | 376 | palindrome(str) { |
| 527 | var arr = str.split(""); | 377 | var arr = str.split(""); |
| 528 | arr = arr.filter(function(val) { | 378 | arr = arr.filter(function(val) { |
| 529 | return ( | 379 | return ( |
| 530 | - val !== " " && | ||
| 531 | - val !== "," && | ||
| 532 | - val !== "." && | ||
| 533 | - val !== "?" && | ||
| 534 | - val !== ":" && | ||
| 535 | - val !== ";" && | ||
| 536 | - val !== "`" && | ||
| 537 | - val !== "'" && | ||
| 538 | - val !== "_" && | ||
| 539 | - val !== "/" && | ||
| 540 | - val !== "-" && | ||
| 541 | - val !== "\\" && | ||
| 542 | - val !== "" && | ||
| 543 | - val !== "(" && | ||
| 544 | - val !== ")" | 380 | + val !== " " && val !== "," && val !== "." && val !== "?" && val !== ":" && |
| 381 | + val !== ";" && val !== "`" && val !== "'" && val !== "_" && val !== "/" && | ||
| 382 | + val !== "-" && val !== "\\" && val !== "" && val !== "(" && val !== ")" | ||
| 545 | ); | 383 | ); |
| 546 | }); | 384 | }); |
| 547 | return arr.join(""); | 385 | return arr.join(""); |
| @@ -551,29 +389,11 @@ export default { | @@ -551,29 +389,11 @@ export default { | ||
| 551 | var arr = str.split(""); | 389 | var arr = str.split(""); |
| 552 | arr.forEach(val => { | 390 | arr.forEach(val => { |
| 553 | if ( | 391 | if ( |
| 554 | - val === "!" || | ||
| 555 | - val === "}" || | ||
| 556 | - val === "{" || | ||
| 557 | - val === "]" || | ||
| 558 | - val === "[" || | ||
| 559 | - val === "&" || | ||
| 560 | - val === "$" || | ||
| 561 | - val === "@" || | ||
| 562 | - val === " " || | ||
| 563 | - val === "," || | ||
| 564 | - val === "." || | ||
| 565 | - val === "?" || | ||
| 566 | - val === ":" || | ||
| 567 | - val === ";" || | ||
| 568 | - val === "`" || | ||
| 569 | - val === "'" || | ||
| 570 | - val === "_" || | ||
| 571 | - val === "/" || | ||
| 572 | - val === "-" || | ||
| 573 | - val === "\\" || | ||
| 574 | - val === "" || | ||
| 575 | - val === "(" || | ||
| 576 | - val === ")" | 392 | + val === "!" || val === "}" || val === "{" || val === "]" || val === "[" || |
| 393 | + val === "&" || val === "$" || val === "@" || val === " " || val === "," || | ||
| 394 | + val === "." || val === "?" || val === ":" || val === ";" || val === "`" || | ||
| 395 | + val === "'" || val === "_" || val === "/" || val === "-" || val === "\\" || | ||
| 396 | + val === "" || val === "(" || val === ")" | ||
| 577 | ) { | 397 | ) { |
| 578 | flag = true; | 398 | flag = true; |
| 579 | } | 399 | } |
| @@ -582,298 +402,189 @@ export default { | @@ -582,298 +402,189 @@ export default { | ||
| 582 | }, | 402 | }, |
| 583 | checkIsHasChineseStr(str) { | 403 | checkIsHasChineseStr(str) { |
| 584 | var Reg = /.*[\u4e00-\u9fa5]+.*/; | 404 | var Reg = /.*[\u4e00-\u9fa5]+.*/; |
| 585 | - if (Reg.test(str)) { | ||
| 586 | - return true; | ||
| 587 | - } | ||
| 588 | - return false; | 405 | + return Reg.test(str); |
| 589 | } | 406 | } |
| 590 | }, | 407 | }, |
| 591 | computed: { | 408 | computed: { |
| 592 | plate_license_1() { | 409 | plate_license_1() { |
| 593 | - return ( | ||
| 594 | - this.formData.num0 + | ||
| 595 | - this.formData.num1 + | ||
| 596 | - this.formData.num2 + | ||
| 597 | - this.formData.num3 + | ||
| 598 | - this.formData.num4 + | ||
| 599 | - this.formData.num5 + | ||
| 600 | - this.formData.num6 | ||
| 601 | - ); | 410 | + return this.formData.num0 + this.formData.num1 + this.formData.num2 + |
| 411 | + this.formData.num3 + this.formData.num4 + this.formData.num5 + this.formData.num6; | ||
| 602 | }, | 412 | }, |
| 603 | plate_license_2() { | 413 | plate_license_2() { |
| 604 | - return ( | ||
| 605 | - this.formData.num0 + | ||
| 606 | - this.formData.num1 + | ||
| 607 | - this.formData.num2 + | ||
| 608 | - this.formData.num3 + | ||
| 609 | - this.formData.num4 + | ||
| 610 | - this.formData.num5 + | ||
| 611 | - this.formData.num6 + | ||
| 612 | - this.formData.num7 | ||
| 613 | - ); | 414 | + return this.formData.num0 + this.formData.num1 + this.formData.num2 + |
| 415 | + this.formData.num3 + this.formData.num4 + this.formData.num5 + this.formData.num6 + this.formData.num7; | ||
| 614 | } | 416 | } |
| 615 | } | 417 | } |
| 616 | }; | 418 | }; |
| 617 | </script> | 419 | </script> |
| 420 | + | ||
| 618 | <style lang="scss" scoped> | 421 | <style lang="scss" scoped> |
| 619 | - .flex-items-center { | 422 | +.flex-items-center { |
| 423 | + display: flex; | ||
| 424 | + align-items: center; | ||
| 425 | +} | ||
| 426 | +.wrap { | ||
| 427 | + padding: 0 18px; | ||
| 428 | + .radio-box { | ||
| 620 | display: flex; | 429 | display: flex; |
| 621 | align-items: center; | 430 | align-items: center; |
| 622 | - } | ||
| 623 | - | ||
| 624 | - .wrap { | ||
| 625 | - padding: 0 18px; | ||
| 626 | - .radio-box { | ||
| 627 | - display: flex; | ||
| 628 | - align-items: center; | ||
| 629 | - justify-content: flex-end; | ||
| 630 | - margin-top: 18px; | ||
| 631 | - text-align: right; | ||
| 632 | - font-size:16px; | ||
| 633 | - input[type="radio"] { | ||
| 634 | - display: none; | ||
| 635 | - } | ||
| 636 | - label { | ||
| 637 | - padding-left: 0.6rem; | ||
| 638 | - cursor: pointer; | ||
| 639 | - img { | ||
| 640 | - width:1rem; | ||
| 641 | - margin-right: 0.1rem; | ||
| 642 | - } | ||
| 643 | - } | ||
| 644 | - } | ||
| 645 | - | ||
| 646 | - .color-choose { | ||
| 647 | - width: 265px; | ||
| 648 | - height: 34px; | ||
| 649 | - margin: 0 auto; | ||
| 650 | - background: #F3F3F3; | ||
| 651 | - border-radius: 6px; | ||
| 652 | - display: flex; | ||
| 653 | - li { | ||
| 654 | - flex: 1; | ||
| 655 | - text-align: center; | ||
| 656 | - line-height: 34px; | ||
| 657 | - border-radius: 6px; | ||
| 658 | - } | ||
| 659 | - } | ||
| 660 | - .card-header { | ||
| 661 | - font-size: 0.75rem; | ||
| 662 | - margin: 0.2rem 0 0.5rem; | ||
| 663 | - color: #4a4a4a; | 431 | + justify-content: flex-end; |
| 432 | + margin-top: 18px; | ||
| 433 | + text-align: right; | ||
| 434 | + font-size:16px; | ||
| 435 | + input[type="radio"] { | ||
| 436 | + display: none; | ||
| 664 | } | 437 | } |
| 665 | - // input输入框 | ||
| 666 | - .num-box { | ||
| 667 | - | ||
| 668 | - display: flex; | ||
| 669 | - justify-content: space-between; | ||
| 670 | - align-items: center; | ||
| 671 | - .spot { | ||
| 672 | - width: 0.2rem; | ||
| 673 | - height: 0.2rem; | ||
| 674 | - border-radius: 50%; | ||
| 675 | - background-color: #d8d8d8; | ||
| 676 | - } | ||
| 677 | - & > div { | ||
| 678 | - width: 1.8rem; | ||
| 679 | - height: 1.8rem; | ||
| 680 | - border: 1px solid #e4e4e4; | ||
| 681 | - &.first { | ||
| 682 | - position: relative; | ||
| 683 | - text-align: center; | ||
| 684 | - line-height: 1.7rem; | ||
| 685 | - font-weight: 200; | ||
| 686 | - .input-wrap { | ||
| 687 | - position: absolute; | ||
| 688 | - top: 0; | ||
| 689 | - left: 0; | ||
| 690 | - right: 0; | ||
| 691 | - bottom: 0; | ||
| 692 | - &.active { | ||
| 693 | - z-index: 100; | ||
| 694 | - } | ||
| 695 | - } | ||
| 696 | - em { | ||
| 697 | - color: #979797; | ||
| 698 | - font-size: 1.6rem; | ||
| 699 | - line-height: 1.7rem; | ||
| 700 | - } | ||
| 701 | - span { | ||
| 702 | - display: inline-block; | ||
| 703 | - width: 100%; | ||
| 704 | - height: 100%; | ||
| 705 | - // background-color: #9cbce2; | ||
| 706 | - color: #828282; | ||
| 707 | - line-height: 1.8rem; | ||
| 708 | - } | ||
| 709 | - } | ||
| 710 | - &.active { | ||
| 711 | - border: 1px solid #4a90e2; | ||
| 712 | - &:after { | ||
| 713 | - border-bottom: 0.5rem solid #4a90e2; | ||
| 714 | - } | ||
| 715 | - } | ||
| 716 | - span { | ||
| 717 | - display: flex; | ||
| 718 | - align-items: center; | ||
| 719 | - justify-content: center; | ||
| 720 | - width: 100%; | ||
| 721 | - height: 100%; | ||
| 722 | - font-size: 1rem; | ||
| 723 | - color: #828282; | ||
| 724 | - &.first { | ||
| 725 | - background-color: #9cbce2; | ||
| 726 | - color: #fff; | ||
| 727 | - text-indent: 0.4rem; | ||
| 728 | - border-radius: 0; | ||
| 729 | - } | ||
| 730 | - } | ||
| 731 | - } | ||
| 732 | - } | ||
| 733 | - .submit-box { | ||
| 734 | - width: 100%; | ||
| 735 | - height: 44px; | ||
| 736 | - line-height: 44px; | ||
| 737 | - border-radius: 4px; | ||
| 738 | - font-size: 20px; | ||
| 739 | - margin-top: 18px; | ||
| 740 | - background: linear-gradient(180deg, #3885D9 0%, #4194EF 100%); | ||
| 741 | - color: #fff; | ||
| 742 | - text-align: center; | ||
| 743 | - } | ||
| 744 | - .info { | ||
| 745 | - font-size: 0.5rem; | ||
| 746 | - margin-top: 0.9rem; | ||
| 747 | - color: #828282; | ||
| 748 | - text-align: left; | 438 | + label { |
| 439 | + padding-left: 0.6rem; | ||
| 440 | + cursor: pointer; | ||
| 749 | img { | 441 | img { |
| 750 | - width: 0.6rem; | ||
| 751 | - vertical-align: middle; | 442 | + width:1rem; |
| 443 | + margin-right: 0.1rem; | ||
| 752 | } | 444 | } |
| 753 | } | 445 | } |
| 754 | } | 446 | } |
| 755 | - | ||
| 756 | - .first-word-wrap { | ||
| 757 | - // height: 9.4rem; | ||
| 758 | - background-color: #D2D5DB; | ||
| 759 | - padding: 0.6rem 0.8rem 1.1rem; | ||
| 760 | - position: fixed; | ||
| 761 | - bottom: 0; | ||
| 762 | - left: 0; | ||
| 763 | - right: 0; | ||
| 764 | - .first-word { | ||
| 765 | - display: flex; | ||
| 766 | - justify-content: space-between; | ||
| 767 | - margin-bottom: 0.45rem; | ||
| 768 | - .word { | ||
| 769 | - box-sizing: border-box; | ||
| 770 | - width: 1.8rem; | ||
| 771 | - height: 1.8rem; | ||
| 772 | - // border: 1px solid #9cbce2; | ||
| 773 | - box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35); | ||
| 774 | - border-radius: 0.16rem; | ||
| 775 | - text-align: center; | ||
| 776 | - &.bordernone { | ||
| 777 | - border: none; | ||
| 778 | - box-shadow: none | ||
| 779 | - } | ||
| 780 | - span { | ||
| 781 | - box-sizing: border-box; | ||
| 782 | - display: flex; | ||
| 783 | - align-items: center; | ||
| 784 | - justify-content: center; | ||
| 785 | - text-align: center; | ||
| 786 | - width: 100%; | ||
| 787 | - height: 100%; | ||
| 788 | - background-color: #fff; | ||
| 789 | - color: #000; | ||
| 790 | - // border: 1px solid #fff; | ||
| 791 | - border-radius: 0.125rem; | ||
| 792 | - } | ||
| 793 | - img { | ||
| 794 | - width: 1.6rem; | ||
| 795 | - } | ||
| 796 | - } | ||
| 797 | - &:nth-last-of-type(1) { | ||
| 798 | - margin-bottom: 0rem; | ||
| 799 | - | 447 | + .num-box { |
| 448 | + display: flex; | ||
| 449 | + justify-content: space-between; | ||
| 450 | + align-items: center; | ||
| 451 | + & > div { | ||
| 452 | + width: 1.8rem; | ||
| 453 | + height: 1.8rem; | ||
| 454 | + border: 1px solid #e4e4e4; | ||
| 455 | + span { | ||
| 456 | + display: flex; | ||
| 457 | + align-items: center; | ||
| 458 | + justify-content: center; | ||
| 459 | + width: 100%; | ||
| 460 | + height: 100%; | ||
| 461 | + font-size: 1rem; | ||
| 462 | + color: #828282; | ||
| 800 | } | 463 | } |
| 801 | } | 464 | } |
| 802 | } | 465 | } |
| 803 | - | ||
| 804 | - .keyboard-wrap { | ||
| 805 | - background-color: #D2D5DB; | ||
| 806 | - position: fixed; | ||
| 807 | - bottom: 0; | ||
| 808 | - left: 0; | ||
| 809 | - right: 0; | ||
| 810 | - padding: 0.6rem 0.6rem 0.4rem; | ||
| 811 | - .keyboard { | ||
| 812 | - display: flex; | ||
| 813 | - justify-content: space-between; | ||
| 814 | - align-items: center; | ||
| 815 | - height: 2rem; | ||
| 816 | - margin-bottom: 0.3rem; | 466 | + .submit-box { |
| 467 | + width: 100%; | ||
| 468 | + height: 44px; | ||
| 469 | + line-height: 44px; | ||
| 470 | + border-radius: 4px; | ||
| 471 | + font-size: 20px; | ||
| 472 | + margin-top: 18px; | ||
| 473 | + background: linear-gradient(180deg, #3885D9 0%, #4194EF 100%); | ||
| 474 | + color: #fff; | ||
| 475 | + text-align: center; | ||
| 476 | + cursor: pointer; | ||
| 477 | + } | ||
| 478 | +} | ||
| 479 | +.first-word-wrap { | ||
| 480 | + background-color: #D2D5DB; | ||
| 481 | + padding: 0.6rem 0.8rem 1.1rem; | ||
| 482 | + position: fixed; | ||
| 483 | + bottom: 0; | ||
| 484 | + left: 0; | ||
| 485 | + right: 0; | ||
| 486 | + .first-word { | ||
| 487 | + display: flex; | ||
| 488 | + justify-content: space-between; | ||
| 489 | + margin-bottom: 0.45rem; | ||
| 490 | + .word { | ||
| 491 | + box-sizing: border-box; | ||
| 492 | + width: 1.8rem; | ||
| 493 | + height: 1.8rem; | ||
| 494 | + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35); | ||
| 495 | + border-radius: 0.16rem; | ||
| 496 | + text-align: center; | ||
| 497 | + &.bordernone { | ||
| 498 | + border: none; | ||
| 499 | + box-shadow: none | ||
| 500 | + } | ||
| 817 | span { | 501 | span { |
| 818 | - text-align: center; | 502 | + box-sizing: border-box; |
| 819 | display: flex; | 503 | display: flex; |
| 820 | - width: 1.8rem; | ||
| 821 | align-items: center; | 504 | align-items: center; |
| 822 | justify-content: center; | 505 | justify-content: center; |
| 823 | - height: 1.8rem; | ||
| 824 | - margin: 0 0.3rem; | ||
| 825 | - box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35); | 506 | + text-align: center; |
| 507 | + width: 100%; | ||
| 508 | + height: 100%; | ||
| 826 | background-color: #fff; | 509 | background-color: #fff; |
| 510 | + color: #000; | ||
| 827 | border-radius: 0.125rem; | 511 | border-radius: 0.125rem; |
| 512 | + } | ||
| 513 | + } | ||
| 514 | + &:nth-last-of-type(1) { | ||
| 515 | + margin-bottom: 0rem; | ||
| 516 | + } | ||
| 517 | + } | ||
| 518 | +} | ||
| 519 | +.keyboard-wrap { | ||
| 520 | + background-color: #D2D5DB; | ||
| 521 | + position: fixed; | ||
| 522 | + bottom: 0; | ||
| 523 | + left: 0; | ||
| 524 | + right: 0; | ||
| 525 | + padding: 0.6rem 0.6rem 0.4rem; | ||
| 526 | + .keyboard { | ||
| 527 | + display: flex; | ||
| 528 | + justify-content: space-between; | ||
| 529 | + align-items: center; | ||
| 530 | + height: 2rem; | ||
| 531 | + margin-bottom: 0.3rem; | ||
| 532 | + span { | ||
| 533 | + text-align: center; | ||
| 534 | + display: flex; | ||
| 535 | + width: 1.8rem; | ||
| 536 | + align-items: center; | ||
| 537 | + justify-content: center; | ||
| 538 | + height: 1.8rem; | ||
| 539 | + margin: 0 0.3rem; | ||
| 540 | + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35); | ||
| 541 | + background-color: #fff; | ||
| 542 | + border-radius: 0.125rem; | ||
| 543 | + &:active { | ||
| 544 | + background-color: #e4e4e4; | ||
| 545 | + } | ||
| 546 | + &.bordernone { | ||
| 547 | + border: none; | ||
| 548 | + box-shadow: none; | ||
| 549 | + background-color: #D2D5DB; | ||
| 828 | &:active { | 550 | &:active { |
| 829 | - background-color: #e4e4e4; | ||
| 830 | - } | ||
| 831 | - &.bordernone { | ||
| 832 | - border: none; | ||
| 833 | - box-shadow: none; | ||
| 834 | background-color: #D2D5DB; | 551 | background-color: #D2D5DB; |
| 835 | - &:active { | ||
| 836 | - background-color: #D2D5DB; | ||
| 837 | - } | ||
| 838 | } | 552 | } |
| 839 | - &.delete { | ||
| 840 | - background-color: #465266; | ||
| 841 | - img { | ||
| 842 | - width: 1.15rem; | ||
| 843 | - } | 553 | + } |
| 554 | + &.delete { | ||
| 555 | + background-color: #465266; | ||
| 556 | + img { | ||
| 557 | + width: 1.15rem; | ||
| 844 | } | 558 | } |
| 845 | } | 559 | } |
| 846 | } | 560 | } |
| 847 | - .cancel { | 561 | + } |
| 562 | + .cancel { | ||
| 563 | + display: flex; | ||
| 564 | + justify-content: flex-end; | ||
| 565 | + align-items: center; | ||
| 566 | + span { | ||
| 848 | display: flex; | 567 | display: flex; |
| 849 | - justify-content: flex-end; | ||
| 850 | align-items: center; | 568 | align-items: center; |
| 851 | - span { | ||
| 852 | - display: flex; | ||
| 853 | - align-items: center; | ||
| 854 | - justify-content: center; | ||
| 855 | - width: 3.6rem; | ||
| 856 | - height: 1.8rem; | ||
| 857 | - background-color: #465266; | ||
| 858 | - color: #fff; | ||
| 859 | - border-radius: 0.125rem; | ||
| 860 | - } | 569 | + justify-content: center; |
| 570 | + width: 3.6rem; | ||
| 571 | + height: 1.8rem; | ||
| 572 | + background-color: #465266; | ||
| 573 | + color: #fff; | ||
| 574 | + border-radius: 0.125rem; | ||
| 575 | + cursor: pointer; | ||
| 861 | } | 576 | } |
| 862 | } | 577 | } |
| 863 | - | ||
| 864 | - input[type="text"]:focus { | ||
| 865 | - border: 0; | ||
| 866 | - border: 1px solid #e4e4e4 !important; | ||
| 867 | - } | ||
| 868 | - | ||
| 869 | - .iphone-box { | ||
| 870 | - border: 0; | ||
| 871 | - width: 100%; | ||
| 872 | - height: 1.8rem; | ||
| 873 | - line-height: 1.8rem; | ||
| 874 | - padding-left: 20px; | ||
| 875 | - border: 1px solid #e4e4e4; | ||
| 876 | - font-size: 14px; | ||
| 877 | - } | ||
| 878 | - | ||
| 879 | -</style> | 578 | +} |
| 579 | +input[type="text"]:focus { | ||
| 580 | + border: 1px solid #e4e4e4 !important; | ||
| 581 | +} | ||
| 582 | +.iphone-box { | ||
| 583 | + border: 1px solid #e4e4e4; | ||
| 584 | + width: 100%; | ||
| 585 | + height: 1.8rem; | ||
| 586 | + line-height: 1.8rem; | ||
| 587 | + padding-left: 20px; | ||
| 588 | + font-size: 14px; | ||
| 589 | +} | ||
| 590 | +</style> | ||
| 880 | \ No newline at end of file | 591 | \ No newline at end of file |
src/utils/request.js
| 1 | -import axios from 'axios' | 1 | +import axios from "axios"; |
| 2 | 2 | ||
| 3 | // let _userToken = sessionStorage.getItem('userToken') | 3 | // let _userToken = sessionStorage.getItem('userToken') |
| 4 | // let _url = process.env.API_ROOT | 4 | // let _url = process.env.API_ROOT |
| 5 | // axios.defaults.baseURL = process.env.API_ROOT | 5 | // axios.defaults.baseURL = process.env.API_ROOT |
| 6 | const service = axios.create({ | 6 | const service = axios.create({ |
| 7 | - | ||
| 8 | // https://pay.renniting.cn/ 赤峰正式环境 | 7 | // https://pay.renniting.cn/ 赤峰正式环境 |
| 9 | // http://pay.service.huangshiparking.com/ 黄石 | 8 | // http://pay.service.huangshiparking.com/ 黄石 |
| 10 | 9 | ||
| 11 | // https://dev.renniting.cn/pay/ 赤峰农行测试环境 | 10 | // https://dev.renniting.cn/pay/ 赤峰农行测试环境 |
| 12 | 11 | ||
| 13 | - baseURL: 'https://pay.fangshanparking.com/', // url = base url + request url | 12 | + baseURL: "https://pay.fangshanparking.com/", // url = base url + request url |
| 13 | + // baseURL: 'http://192.168.1.190:8081/', // url = base url + request url | ||
| 14 | // withCredentials: true, // send cookies when cross-domain requests | 14 | // withCredentials: true, // send cookies when cross-domain requests |
| 15 | - timeout: 6000 // request timeout | ||
| 16 | -}) | 15 | + timeout: 6000, // request timeout |
| 16 | +}); | ||
| 17 | 17 | ||
| 18 | service.interceptors.request.use( | 18 | service.interceptors.request.use( |
| 19 | - config => { | 19 | + (config) => { |
| 20 | // let token = _userToken | 20 | // let token = _userToken |
| 21 | // //let token='298bd7ff-a025-4145-a4a3-554769375b48'; | 21 | // //let token='298bd7ff-a025-4145-a4a3-554769375b48'; |
| 22 | // config.headers['X-Auth-Token'] = token | 22 | // config.headers['X-Auth-Token'] = token |
| 23 | - return config | 23 | + return config; |
| 24 | }, | 24 | }, |
| 25 | - error => { | 25 | + (error) => { |
| 26 | // do something with request error | 26 | // do something with request error |
| 27 | - console.log(error) // for debug | ||
| 28 | - return Promise.reject(error) | 27 | + console.log(error); // for debug |
| 28 | + return Promise.reject(error); | ||
| 29 | } | 29 | } |
| 30 | -) | 30 | +); |
| 31 | 31 | ||
| 32 | // response interceptor | 32 | // response interceptor |
| 33 | service.interceptors.response.use( | 33 | service.interceptors.response.use( |
| 34 | - response => { | ||
| 35 | - const res = response.data | 34 | + (response) => { |
| 35 | + const res = response.data; | ||
| 36 | // if the custom code is not 20000, it is judged as an error. | 36 | // if the custom code is not 20000, it is judged as an error. |
| 37 | - if (res.code != '8888') { | ||
| 38 | - return res | 37 | + if (res.code != "8888") { |
| 38 | + return res; | ||
| 39 | } else { | 39 | } else { |
| 40 | - return res | 40 | + return res; |
| 41 | } | 41 | } |
| 42 | }, | 42 | }, |
| 43 | - error => { | ||
| 44 | - console.log('err' + error) // for debug | ||
| 45 | - return Promise.reject(error) | 43 | + (error) => { |
| 44 | + console.log("err" + error); // for debug | ||
| 45 | + return Promise.reject(error); | ||
| 46 | } | 46 | } |
| 47 | -) | 47 | +); |
| 48 | 48 | ||
| 49 | -export default service | 49 | +export default service; |