|
@@ -477,18 +477,6 @@ export default {
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
// uni.setStorageSync('isReload', '2');
|
|
// uni.setStorageSync('isReload', '2');
|
|
- const platform = getPlatform();
|
|
|
|
- if (platform === 'micromessenger') {
|
|
|
|
- await initWxJsSdkConfig(['chooseWXPay', 'scanQRCode']);
|
|
|
|
- try {
|
|
|
|
- // if (window.wxJsSdkConfigInitPromise) {
|
|
|
|
- // // console.log(window.wxJsSdkConfigInitPromise);
|
|
|
|
- // // window.wxJsSdkConfigInitPromise;
|
|
|
|
- // }
|
|
|
|
- } catch (e) {
|
|
|
|
- console.log(487, e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
const option = this.$route.query;
|
|
const option = this.$route.query;
|
|
this.picUrl = this.$picUrl;
|
|
this.picUrl = this.$picUrl;
|
|
this.payCarno = option.carno;
|
|
this.payCarno = option.carno;
|
|
@@ -506,8 +494,20 @@ export default {
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
- activated() {
|
|
|
|
|
|
+ async activated() {
|
|
console.log('activated', uni.getStorageSync('isReload'));
|
|
console.log('activated', uni.getStorageSync('isReload'));
|
|
|
|
+ const platform = getPlatform();
|
|
|
|
+ if (platform === 'micromessenger') {
|
|
|
|
+ await initWxJsSdkConfig(['chooseWXPay', 'scanQRCode']);
|
|
|
|
+ try {
|
|
|
|
+ // if (window.wxJsSdkConfigInitPromise) {
|
|
|
|
+ // // console.log(window.wxJsSdkConfigInitPromise);
|
|
|
|
+ // // window.wxJsSdkConfigInitPromise;
|
|
|
|
+ // }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(487, e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// if (uni.getStorageSync('isReload') === '3') {
|
|
// if (uni.getStorageSync('isReload') === '3') {
|
|
// console.log(487);
|
|
// console.log(487);
|
|
// this.$router.push({
|
|
// this.$router.push({
|
|
@@ -1501,7 +1501,7 @@ export default {
|
|
},
|
|
},
|
|
// 支付前
|
|
// 支付前
|
|
async toPay() {
|
|
async toPay() {
|
|
- // await this.weixH5Pay()
|
|
|
|
|
|
+ // await this.weixinH5Pay()
|
|
// return
|
|
// return
|
|
this.throttle(() => {
|
|
this.throttle(() => {
|
|
// 北京特殊处理
|
|
// 北京特殊处理
|
|
@@ -1775,11 +1775,11 @@ export default {
|
|
const platform = getPlatform();
|
|
const platform = getPlatform();
|
|
// TODO: h5环境判断
|
|
// TODO: h5环境判断
|
|
if (platform === 'micromessenger') {
|
|
if (platform === 'micromessenger') {
|
|
- const weixH5PayRes = await this.weixH5Pay(prepayJson);
|
|
|
|
|
|
+ const weixinH5PayRes = await this.weixinH5Pay(prepayJson);
|
|
// 微信支付完成,判断结果
|
|
// 微信支付完成,判断结果
|
|
- console.log(1784, weixH5PayRes);
|
|
|
|
|
|
+ console.log(1784, weixinH5PayRes);
|
|
// errMsg: 'requestPayment:ok'
|
|
// errMsg: 'requestPayment:ok'
|
|
- if (weixH5PayRes?.errMsg === 'requestPayment:ok') {
|
|
|
|
|
|
+ if (weixinH5PayRes?.errMsg === 'requestPayment:ok') {
|
|
this.$router.replace({
|
|
this.$router.replace({
|
|
path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
|
|
path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
|
|
});
|
|
});
|
|
@@ -1902,7 +1902,7 @@ export default {
|
|
this.isShow = !this.isShow;
|
|
this.isShow = !this.isShow;
|
|
},
|
|
},
|
|
// 微信公众号H5支付
|
|
// 微信公众号H5支付
|
|
- async weixH5Pay(params) {
|
|
|
|
|
|
+ async weixinH5Pay(params) {
|
|
// console.log(1897);
|
|
// console.log(1897);
|
|
if (window?.wxJsSdkConfigInitPromise) {
|
|
if (window?.wxJsSdkConfigInitPromise) {
|
|
await window.wxJsSdkConfigInitPromise;
|
|
await window.wxJsSdkConfigInitPromise;
|
|
@@ -1937,7 +1937,7 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
scan() {
|
|
scan() {
|
|
- this.$wx.scanQRCode({
|
|
|
|
|
|
+ wx.scanQRCode({
|
|
desc: 'scanQRCode desc',
|
|
desc: 'scanQRCode desc',
|
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
// scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
|
// scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|