|
|
@@ -10,6 +10,8 @@
|
|
|
</div> -->
|
|
|
</div>
|
|
|
<div>{{chatToken}}</div>
|
|
|
+ <div>{{step}}</div>
|
|
|
+ <div>{{error}}</div>
|
|
|
<div class="vip-info vip-rights">
|
|
|
<div class="title-view">
|
|
|
<div class="tabitem" :class="{active: ctype == 1}" @click="ctype = 1">
|
|
|
@@ -85,6 +87,8 @@ export default {
|
|
|
],
|
|
|
orderList: [],
|
|
|
page: 1,
|
|
|
+ step: 1,
|
|
|
+ error: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -129,11 +133,13 @@ export default {
|
|
|
data: {
|
|
|
type: type
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
+ this.step = 2
|
|
|
if (res.code === 0) {
|
|
|
// eslint-disable-next-line
|
|
|
this.payObj = res.data
|
|
|
if (typeof WeixinJSBridge == "undefined") {
|
|
|
+ this.error = 'WeixinJSBridge is undefined'
|
|
|
if (document.addEventListener) {
|
|
|
document.addEventListener(
|
|
|
"WeixinJSBridgeReady",
|
|
|
@@ -152,6 +158,8 @@ export default {
|
|
|
},
|
|
|
|
|
|
onBridgeReady() {
|
|
|
+
|
|
|
+ this.step = 3
|
|
|
const that = this
|
|
|
// eslint-disable-next-line
|
|
|
WeixinJSBridge.invoke(
|
|
|
@@ -165,13 +173,15 @@ export default {
|
|
|
paySign: this.payObj.paySign, //微信签名
|
|
|
},
|
|
|
function (res) {
|
|
|
+ that.error = JSON.stringify(res)
|
|
|
+ that.step = 4
|
|
|
console.log('支付结果:', res)
|
|
|
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
alert("支付成功");
|
|
|
}
|
|
|
- that.closePage();
|
|
|
+ // that.closePage();
|
|
|
}
|
|
|
);
|
|
|
},
|