bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
1
2
3
|
<template>
<div>
<ul class="choose-area">
|
aabd3df4
刘淇
购买会员卡
|
4
5
|
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
6
|
<li>
|
aabd3df4
刘淇
购买会员卡
|
7
8
9
10
|
<div style="color: #666">选择停车场</div>
<div @click="parkNameVisible = true">{{parkName}}</div>
<div class="arrow">></div>
<!--<div class="arrow">></div>-->
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
11
12
|
</li>
|
aabd3df4
刘淇
购买会员卡
|
13
14
15
16
17
18
|
<!--<li>-->
<!--<div style="color: #666">卡名称</div>-->
<!--<div>微纳园卡</div>-->
<!--</li>-->
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
19
20
|
<li>
<div style="color: #666">选择卡类型</div>
|
aabd3df4
刘淇
购买会员卡
|
21
22
|
<div @click="cardTypeListVisible = true">{{carType}}</div>
<div class="arrow">></div>
|
8b40a4fc
刘淇
会员卡
|
23
|
<!--<div class="arrow">></div>-->
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
24
25
26
27
28
29
30
31
32
33
34
|
</li>
<li>
<div style="color: #666">绑定车牌</div>
<div @click="carNumberVisible = true">{{carNumber}}</div>
<div class="arrow">></div>
</li>
<li>
<div style="color: #A31414">生效时间</div>
|
8b40a4fc
刘淇
会员卡
|
35
|
<div style="color: #A31414" @click="selectData">{{ $utils.timestampToTime(startData) }}</div>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
36
37
38
39
40
|
<div class="arrow">></div>
</li>
<li>
<div style="color: #666">有效期至</div>
|
aabd3df4
刘淇
购买会员卡
|
41
|
<div>{{ $utils.timestampToTime(endTimeFunc) }}</div>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
42
43
44
45
46
47
|
</li>
<li>
<div style="color: #666">购买数量</div>
<div class="choose-num">
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
48
|
<span @click="reduceCarNum">-</span>
|
6e6de4e6
刘淇
修改整体颜色
|
49
50
|
<span>{{cardNum}}</span>
<span @click="addCardNum">+</span>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
51
52
53
54
55
|
</div>
</li>
<li>
<div style="color: #666">单价</div>
|
aabd3df4
刘淇
购买会员卡
|
56
|
<div>¥{{ (unitPrice/100).toFixed(2)}}</div>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
57
58
59
60
61
|
</li>
<li>
<div style="color: #666">优惠金额</div>
|
aabd3df4
刘淇
购买会员卡
|
62
|
<div>¥{{(disPrice/100).toFixed(2)}}</div>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
63
64
65
66
|
</li>
<li>
<div style="color: #666">应付金额</div>
|
aabd3df4
刘淇
购买会员卡
|
67
|
<div style="color: #A31414">¥{{(needPay/100).toFixed(2)}}</div>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
68
69
70
71
|
</li>
</ul>
|
aabd3df4
刘淇
购买会员卡
|
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<!--<div class="parkArea leftRightPadding">-->
<!--<p class="parkAreaTitle">-->
<!--<span>本卡同时适用于以下停车场:</span>-->
<!--<span class="parkMore" @click="parkMoreVisible = true">查看更多</span>-->
<!--</p>-->
<!--<p>停车场停车场停车停车场</p>-->
<!--</div>-->
<div style="padding:15px;text-align: center">
<check-icon :value.sync="agreement">
</check-icon>
<p style="display: inline-block;height: 23px;line-height: 23px;">我已阅读并同意 <span style="color: blue"
@click="showHideOnBlur=true">《购买须知》</span>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
85
|
</p>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
86
87
|
</div>
|
aabd3df4
刘淇
购买会员卡
|
88
|
|
8b40a4fc
刘淇
会员卡
|
89
|
<div style="margin-top: 34px" class="leftRightPadding">
|
6e6de4e6
刘淇
修改整体颜色
|
90
|
<mt-button type="primary" size="large" @click="toPay">确定购买</mt-button>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
</div>
<!-- @touchmove.prevent 阻止默认事件,在选择时间时阻止页面也跟着滚动-->
<div @touchmove.prevent>
<mt-datetime-picker
lockScroll="true"
ref="datePicker"
v-model="dateVal"
type="date"
year-format="{value} 年"
month-format="{value} 月"
date-format="{value} 日"
:startDate="startDate"
@confirm="handleConfirm()"
></mt-datetime-picker>
</div>
|
aabd3df4
刘淇
购买会员卡
|
108
109
110
111
112
|
<!--停车场-->
<mt-actionsheet
:actions="parkNameList"
v-model="parkNameVisible">
</mt-actionsheet>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
113
|
|
aabd3df4
刘淇
购买会员卡
|
114
|
<!--卡类型-->
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
115
|
<mt-actionsheet
|
aabd3df4
刘淇
购买会员卡
|
116
117
|
:actions="cardTypeList"
v-model="cardTypeListVisible">
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
118
119
|
</mt-actionsheet>
|
aabd3df4
刘淇
购买会员卡
|
120
|
<!--车牌号-->
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
121
122
123
124
125
126
127
|
<mt-actionsheet
:actions="carNumList"
v-model="carNumberVisible">
</mt-actionsheet>
<mt-popup
v-model="parkMoreVisible" class="park-list-wrap"
|
8b40a4fc
刘淇
会员卡
|
128
|
>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
129
130
131
132
133
|
<ul class="park-list">
<li v-for="(i, index) in 10">{{index+1}}、停车场{{i}}</li>
</ul>
</mt-popup>
|
aabd3df4
刘淇
购买会员卡
|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
<div v-transfer-dom>
<x-dialog v-model="showHideOnBlur" class="dialog-demo" hide-on-blur>
<div class="agreen-box">
<p>
1. 本停车卡为指定停车场有效使用,为特定的场地停车权限,请按照停车场场地自主选择购买。
</p>
<p>
2. 月卡(季卡)一经售出,概不退卡,允许车牌变更1次(有效期内)。
</p>
<p>
3. 年卡可以支持车牌变更3次(有效期内),年卡退卡需要按照原价扣除已经使用月份(不满一个月按照一个月计算)并退回已开具发票。
</p>
<p>
4. 停车场管理方对车辆及车内财务无看管保全义务,车主须遵守停车场管理规定将车辆停在车场的停车位内,乱停车辆引起的贴条和拖车等后果由车主自行承担。
</p>
<p>
5. 友情提醒:妥善关闭和锁定已停车入位的车辆,不在车内放置现金和其它贵重物品,其它停车规定须遵守所辖停车场的管理规定(参见停车场公示)。
</p>
</div>
<div @click="showHideOnBlur=false">
<span class="vux-close">X</span>
</div>
</x-dialog>
</div>
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
160
161
162
163
|
</div>
</template>
<script>
|
aabd3df4
刘淇
购买会员卡
|
164
165
166
167
168
169
170
171
|
import { TransferDomDirective as TransferDom } from "vux";
import {
queryParkListForVipCard,
queryVipCardInfoByPlNo,
queryUserCars,
weixinpay,
createVipCardOrder
} from "@/api/cards/cards";
|
8b40a4fc
刘淇
会员卡
|
172
|
import { timestampToTime } from "../../utils/utils.js";
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
173
|
export default {
|
8b40a4fc
刘淇
会员卡
|
174
|
name: "buyCard",
|
aabd3df4
刘淇
购买会员卡
|
175
176
177
|
directives: {
TransferDom
},
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
178
179
180
|
data() {
return {
startDate: new Date(),
|
8b40a4fc
刘淇
会员卡
|
181
182
|
dateVal: "",
selectedValue: "",
|
aabd3df4
刘淇
购买会员卡
|
183
184
185
186
187
188
189
190
191
|
startData: "",
endDate: "",
parkName: "请点击选择",
parkNameVisible: false,
parkNameList: [], // 停车场
parkNo: "",
cardTypeListVisible: false,
cardTypeList: [], // 卡类型
carType: "请点击选择",
|
8b40a4fc
刘淇
会员卡
|
192
|
carNumList: [
|
aabd3df4
刘淇
购买会员卡
|
193
|
{ name: "前往绑定车牌", method: this.addCar }
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
194
|
],
|
aabd3df4
刘淇
购买会员卡
|
195
|
carNumber: "请选择车牌",
|
8b40a4fc
刘淇
会员卡
|
196
197
|
carNumberVisible: false,
parkMoreVisible: false,
|
aabd3df4
刘淇
购买会员卡
|
198
|
cardNum: 1, // 卡数量
|
6e6de4e6
刘淇
修改整体颜色
|
199
200
201
|
unitPrice: 0, // 单价
disPrice: 0, // 优惠金额
needPay: 0, // 应付
|
aabd3df4
刘淇
购买会员卡
|
202
|
agreement: false,
|
6e6de4e6
刘淇
修改整体颜色
|
203
|
typeNum: 0, // 卡类型判断
|
aabd3df4
刘淇
购买会员卡
|
204
205
206
|
showHideOnBlur: false, // 购买协议
createVipCardOrder: {}, // 创建订单对象
orderId: "" // 订单号
|
8b40a4fc
刘淇
会员卡
|
207
|
};
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
208
|
},
|
aabd3df4
刘淇
购买会员卡
|
209
210
211
212
213
214
215
216
217
218
|
mounted() {
this.queryParkListForVipCard(); // 获取停车场
this.queryUserCars(); // 获取用户车牌
},
computed: {
// 卡类型 1-年卡;2-半年卡;3-季卡;4-月卡;5-日卡;
endTimeFunc() {
if (this.startData) {
switch (this.typeNum) {
case 1:
|
ec828383
刘淇
卡数量 时间区间
|
219
220
|
this.endDate = this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD");
return this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD");
|
aabd3df4
刘淇
购买会员卡
|
221
222
|
break;
case 2:
|
ec828383
刘淇
卡数量 时间区间
|
223
224
|
this.endDate = this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD");
return this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD");
|
aabd3df4
刘淇
购买会员卡
|
225
226
|
break;
case 3:
|
ec828383
刘淇
卡数量 时间区间
|
227
228
|
this.endDate = this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD");
return this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD");
|
aabd3df4
刘淇
购买会员卡
|
229
230
|
break;
case 4:
|
ec828383
刘淇
卡数量 时间区间
|
231
232
|
this.endDate = this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD");
return this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD");
|
aabd3df4
刘淇
购买会员卡
|
233
234
|
break;
case 5:
|
ec828383
刘淇
卡数量 时间区间
|
235
236
|
this.endDate = this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD");
return this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD");
|
aabd3df4
刘淇
购买会员卡
|
237
238
239
240
241
242
243
244
245
246
247
248
|
break;
}
// return this.$moment(this.startData).add(1,"month").format("YYYY-MM-DD");
// return this.startData.getMonth()+1
}
// switch (val){
// case 2:
// return this.startData.setMonth(this.startData.getMonth()+1);
// break;
// }
}
},
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
249
|
methods: {
|
aabd3df4
刘淇
购买会员卡
|
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
// 获取用户绑定车牌
queryUserCars() {
let jsondata = this.$utils.commonParams();
jsondata.sign = this.$utils.signObject(jsondata);
queryUserCars(jsondata).then(data => {
console.log(data);
let res = data.data;
if (data.code == 0) {
if (res.length > 0) {
if (res.length == 3) {
this.carNumList = [];
}
res.forEach((item, index) => {
this.carNumList.unshift({
name: item.carNumber,
method: this.bandingCar
});
});
}
console.log(this.carNumList);
} else {
this.$vux.toast.text(data.message, "top");
}
});
},
// 打开时间选择器
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
276
|
selectData() {
|
6e6de4e6
刘淇
修改整体颜色
|
277
|
this.dateVal = this.startData
|
8b40a4fc
刘淇
会员卡
|
278
279
280
281
|
this.$refs["datePicker"].open();
// console.log(this.startData)
// this.endDate = this.startData.setMonth(this.startData.getMonth()+1)
// console.log(this.endDate)
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
282
|
},
|
aabd3df4
刘淇
购买会员卡
|
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
//
queryParkListForVipCard() {
let jsondata = this.$utils.commonParams();
jsondata.parkName = ""; //搜索的停车场名称
jsondata.sign = this.$utils.signObject(jsondata);
queryParkListForVipCard(jsondata).then(data => {
console.log(data);
if (data.code == 0) {
let res = data.data;
res.parkList.forEach((item, i) => {
this.parkNameList.push({
name: item.plName,
parkNo: item.plNo,
method: this.parkNameAction
});
});
} else {
this.$vux.toast.text(data.message, "top");
}
});
},
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
304
|
handleConfirm() {
|
6e6de4e6
刘淇
修改整体颜色
|
305
|
console.log('11111');
|
8b40a4fc
刘淇
会员卡
|
306
307
|
console.log(this.dateVal);
this.startData = this.$utils.timestampToTime(this.dateVal);
|
aabd3df4
刘淇
购买会员卡
|
308
309
310
311
312
313
314
315
316
|
// this.endDate = this.dateVal.setMonth(this.dateVal.getMonth() + 1);
},
// 停车场选择事件
parkNameAction(e) {
console.log(e);
this.parkName = e.name;
this.parkNo = e.parkNo;
// alert(this.parkNo)
this.queryVipCardInfoByPlNo();
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
317
|
},
|
aabd3df4
刘淇
购买会员卡
|
318
319
320
321
322
323
324
325
326
327
|
// 根据停车场搜卡类型
queryVipCardInfoByPlNo() {
let me = this;
let jsondata = this.$utils.commonParams();
jsondata.plNo = this.parkNo;
jsondata.plNo = this.parkNo;
jsondata.sign = this.$utils.signObject(jsondata);
queryVipCardInfoByPlNo(jsondata).then(data => {
console.log(data);
if (data.code == 0) {
|
a315303d
刘淇
购买会员卡
|
328
329
|
me.cardTypeList = []
me.carType = '请点击选择'
|
aabd3df4
刘淇
购买会员卡
|
330
331
332
333
334
335
336
337
338
339
|
// res.vipCardList =
// this.cardTypeList = res.vipCardList
// { name: "月卡", num: 1, method: this.clickAction },
let vipCardList = data.data.vipCardList;
vipCardList.forEach((item, index) => {
me.$set(item, "name", item.cardName);
me.$set(item, "method", me.vipCardAction);
me.cardTypeList.push(item);
});
console.log(me.cardTypeList);
|
a315303d
刘淇
购买会员卡
|
340
341
342
343
344
345
346
347
348
349
350
|
if(me.carType=='请点击选择'){
}else{
me.cardNum = 1
me.unitPrice = vipCardList[0].price;
me.disPrice = vipCardList[0].price * ((10 - vipCardList[0].discValue) / 10);
me.needPay = this.unitPrice - this.disPrice;
// me.startData = new Date();
me.typeNum = vipCardList[0].cardType;
me.createVipCardOrder = e;
}
|
aabd3df4
刘淇
购买会员卡
|
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
|
} else {
this.$vux.toast.text(data.message, "top");
}
});
},
bandingCar(e) {
this.carNumber = e.name;
},
addCar(e) {
this.$router.push({
path: "addCar",
query: {
source: 1 // 1表示来源是购买车牌页面
}
});
},
vipCardAction(e) {
console.log(e);
|
8b40a4fc
刘淇
会员卡
|
369
|
this.carType = e.name;
|
aabd3df4
刘淇
购买会员卡
|
370
371
372
373
374
375
376
377
378
379
380
381
|
// this.startData = e.expDate;
// this.endDate = e.effDate;
// this.cardNum = e.validNum;
this.unitPrice = e.price;
this.disPrice = e.price * ((10 - e.discValue) / 10);
this.needPay = this.unitPrice - this.disPrice;
this.startData = new Date();
this.typeNum = e.cardType;
this.createVipCardOrder = e;
// this.endDate = this.endTimeFunc(e.carType);
// this.endDate = this.startData;
// 卡类型 1-年卡;2-半年卡;3-季卡;4-月卡;5-日卡;
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
382
|
},
|
8b40a4fc
刘淇
会员卡
|
383
384
|
clickActionCarNum(e) {
this.carNumber = e.name;
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
385
|
},
|
8b40a4fc
刘淇
会员卡
|
386
387
|
addCardNum() { // 增加购买数量
this.cardNum++;
|
ec828383
刘淇
卡数量 时间区间
|
388
|
|
aabd3df4
刘淇
购买会员卡
|
389
|
this.calcMoney();
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
390
|
},
|
8b40a4fc
刘淇
会员卡
|
391
392
393
|
reduceCarNum() { // 增加购买数量
if (this.cardNum == 1) {
return;
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
394
|
}
|
8b40a4fc
刘淇
会员卡
|
395
|
this.cardNum--;
|
aabd3df4
刘淇
购买会员卡
|
396
|
this.calcMoney();
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
397
|
},
|
8b40a4fc
刘淇
会员卡
|
398
|
calcMoney() {
|
aabd3df4
刘淇
购买会员卡
|
399
400
401
402
403
404
405
406
|
this.needPay = this.cardNum * (this.unitPrice - this.disPrice);
},
// 购买
toPay() {
if (this.parkName == "请点击选择") {
this.$vux.toast.text("请选择停车场", "top");
return;
}
|
a315303d
刘淇
购买会员卡
|
407
|
console.log(this.carType)
|
aabd3df4
刘淇
购买会员卡
|
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
|
if (this.carType == "请点击选择") {
this.$vux.toast.text("请选择卡类型", "top");
return;
}
if (this.carNumber == "请选择车牌") {
this.$vux.toast.text("请选择车牌", "top");
return;
}
if (!this.agreement) {
this.$vux.toast.text("请同意购买须知", "top");
return;
}
this.createOrder();
},
createOrder() {
console.log(this.createVipCardOrder);
let me = this;
let jsondata = this.$utils.commonParams();
jsondata.plNo = this.parkNo; // 停车场id
jsondata.cardNo = this.createVipCardOrder.cardNo; // 卡券编码
jsondata.cardType = (this.createVipCardOrder.cardType).toString(); // 卡类型
jsondata.carType = (this.createVipCardOrder.carType).toString(); // 1-大型车;2-小型车
// jsondata.plNo = this.createVipCardOrder.id; // 1-大型车;2-小型车
jsondata.price = (this.createVipCardOrder.price).toString(); // 卡单价
jsondata.totalAmount = (this.needPay).toString(); // 购买的总金额
jsondata.num = this.cardNum; // 购买数量
jsondata.effDate = this.$utils.timestampToTime(this.startData); // 生效时间
jsondata.expDate = this.$utils.timestampToTime(this.endDate); // 失效时间
jsondata.carNumber = this.carNumber; // 卡适用车牌
jsondata.optType = "1"; // 操作类型 1 购买 2 续费
jsondata.forceBuy = "1";
jsondata.sign = this.$utils.signObject(jsondata);
createVipCardOrder(jsondata).then(data => {
console.log(data);
// orderId
if (data.code == 0) {
this.orderId = data.data.orderId;
this.vxPay();
} else {
this.$vux.toast.text(data.message, "top");
}
});
},
vxPay() {
let vm = this;
let jsondata = this.$utils.commonParams();
jsondata.orderId = this.orderId; // 订单号
jsondata.payType = "4"; // 支付方式-- 1:支付宝 2:微信 3:银联.
jsondata.paySrcType = "301"; // 支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费
jsondata.appId = this.$utils.myVxAppId; // 微信标识符
jsondata.terminalSource = "3"; // 请求端来源 1: 任你停 2:pda 3:微信公共号
jsondata.paySource = "3";
jsondata.couponPersonId = "";
jsondata.openId = sessionStorage.getItem("wx_openId");
jsondata.sign = this.$utils.signObject(jsondata);
weixinpay(jsondata).then(res => {
console.log(data);
if (res.code == 0) { //
if (res.data) {
var data = res.data;
console.log(JSON.stringify(data));
if (typeof WeixinJSBridge === "undefined") { // 微信浏览器内置对象。参考微信官方文档
if (document.addEventListener) {
document.addEventListener("WeixinJSBridgeReady", vm.onBridgeReady(data), false);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", vm.onBridgeReady(data));
document.attachEvent("onWeixinJSBridgeReady", vm.onBridgeReady(data));
}
} else {
console.log("准备调用微信支付");
vm.onBridgeReady(data);
}
} else {
alert("没有找到返回值");
}
} else {
alert(res.message);
}
});
},
onBridgeReady(params) {
let me = this;
console.log("调用微信支付WeixinJSBridge");
WeixinJSBridge.invoke(
"getBrandWCPayRequest", params,
//
// 'getBrandWCPayRequest', { // 下面参数内容都是后台返回的
// 'appId': data.appId, // 公众号名称,由商户传入
// 'timeStamp': data.timeStamp, // 时间戳
// 'nonceStr': data.nonceStr, // 随机串
// 'package': data.package, // 预支付id
// 'signType': data.signType, // 微信签名方式
// 'paySign': data.paySign // 微信签名
// },
function(res) {
// 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
if (res.err_msg === "get_brand_wcpay_request:ok") {
console.log("成功");
this.$vux.toast.text("支付成功", "top");
me.$router.go(-2);
} else {
console.log("失败");
alert("支付失败");
me.$router.go(-2);
}
}
);
|
8b40a4fc
刘淇
会员卡
|
515
|
}
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
516
517
518
519
|
},
filters: {
formatDate(time) {
var date = new Date(time);
|
8b40a4fc
刘淇
会员卡
|
520
|
return formatDate(date);
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
521
|
}
|
8b40a4fc
刘淇
会员卡
|
522
523
|
}
};
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
|
</script>
<style scoped lang="scss">
.choose-area {
background: #fff;
padding: 0 10px;
}
.choose-area > li {
padding-right: 20px;
position: relative;
height: 38px;
line-height: 38px;
border-bottom: 1px solid #EFEFEF;
display: flex;
justify-content: space-between;
.arrow {
position: absolute;
right: 0;
top: 0;
font-size: 16px;
}
&:last-child {
border-bottom: 0;
}
}
|
8b40a4fc
刘淇
会员卡
|
550
551
|
.choose-num {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
552
553
554
555
556
|
height: 28px;
margin-top: 5px;
line-height: 28px;
display: flex;
border: 1px solid #D8D8D8;
|
8b40a4fc
刘淇
会员卡
|
557
|
span {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
558
|
display: inline-block;
|
8b40a4fc
刘淇
会员卡
|
559
|
&:nth-of-type(1) {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
560
561
562
563
564
|
width: 28px;
height: 28px;
text-align: center;
cursor: pointer;
}
|
8b40a4fc
刘淇
会员卡
|
565
|
&:nth-of-type(2) {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
566
567
568
569
570
|
width: 50px;
text-align: center;
border-left: 1px solid #D8D8D8;
border-right: 1px solid #D8D8D8;
}
|
8b40a4fc
刘淇
会员卡
|
571
|
&:nth-of-type(3) {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
572
573
574
575
576
577
578
|
width: 28px;
height: 28px;
text-align: center;
cursor: pointer;
}
}
}
|
8b40a4fc
刘淇
会员卡
|
579
580
|
.parkArea {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
581
582
583
584
585
586
|
padding-top: 10px;
padding-bottom: 10px;
margin-top: 10px;
background: #fff;
color: #999;
}
|
8b40a4fc
刘淇
会员卡
|
587
588
|
.parkAreaTitle {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
589
590
591
592
|
display: flex;
justify-content: space-between;
color: #666;
}
|
8b40a4fc
刘淇
会员卡
|
593
594
|
.parkMore {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
595
596
|
cursor: pointer;
}
|
8b40a4fc
刘淇
会员卡
|
597
598
|
.park-list-wrap {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
599
600
601
602
603
|
width: 80%;
max-height: 70%;
overflow-y: scroll;
border-radius: 5px;
}
|
8b40a4fc
刘淇
会员卡
|
604
605
|
.park-list {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
606
|
/*width: 80%;*/
|
8b40a4fc
刘淇
会员卡
|
607
|
li {
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
608
609
610
611
612
|
padding-left: 20px;
line-height: 25px;
}
}
|
aabd3df4
刘淇
购买会员卡
|
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
|
.agreen-box {
padding: 15px;
text-align: left;
p {
margin-bottom: 15px;
}
}
.vux-close {
margin-top: 8px;
margin-bottom: 8px;
font-size: 18px;
}
/deep/ .picker-items {
width: 100%
}
|
bb951693
liuqimichale
赤峰微信公众号 -- 临停支付
|
632
|
</style>
|