|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<div class="paymentResult">
|
|
|
<m-header v-if="headerStatus" :isBack="isBack" />
|
|
|
- <div class="payon" v-if="pageStatus == 'ON'">
|
|
|
+ <div class="payOn" v-if="pageStatus == 'ON'">
|
|
|
<img src="@/assets/images/pay_success.png" alt />
|
|
|
<p>支付成功</p>
|
|
|
<van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
|
</div>
|
|
|
|
|
|
- <div class="payerror" v-if="pageStatus == 'FAILED'">
|
|
|
+ <div class="payError" v-if="pageStatus == 'FAILED' || pageStatus == 'CLOSE' || pageStatus == 'REFUND'">
|
|
|
<img src="@/assets/images/pay_error.png" alt />
|
|
|
<p>支付失败</p>
|
|
|
<van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
@@ -20,7 +20,7 @@
|
|
|
<p class="countdown">到计时{{ smsText }}秒刷新</p>
|
|
|
</div>
|
|
|
|
|
|
- <div class="paysuccess" v-if="pageStatus == 'SUCCESS'">
|
|
|
+ <div class="paySuccess" v-if="pageStatus == 'SUCCESS'">
|
|
|
<div class="status">
|
|
|
<img src="@/assets/images/pay_success.png" alt />
|
|
|
<p>支付成功</p>
|
|
@@ -37,6 +37,7 @@
|
|
|
import MHeader from "@/components/MHeader"
|
|
|
import { paymentResult } from "./adapay/AdapayApi"
|
|
|
import { browser } from "@/utils/common"
|
|
|
+import setLoading from '@/utils/loading'
|
|
|
// import { stat } from 'fs'
|
|
|
export default {
|
|
|
name: "paymentResult",
|
|
@@ -60,90 +61,61 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
pushHistory() {
|
|
|
- var state = {
|
|
|
- title: "title",
|
|
|
- url: "#"
|
|
|
- };
|
|
|
- window.history.pushState(state, "title", "#");
|
|
|
+ var state = {
|
|
|
+ title: "title",
|
|
|
+ url: "#"
|
|
|
+ };
|
|
|
+ window.history.pushState(state, "title", "#");
|
|
|
},
|
|
|
- __init() {
|
|
|
- let params = this.$route.query;
|
|
|
- // 支付成功
|
|
|
- if (params.orderNo) {
|
|
|
- // 是否有订单号
|
|
|
- paymentResult({ orderNo: params.orderNo }).then(res => {
|
|
|
- let result = res.data;
|
|
|
- if (result.code == 200) {
|
|
|
- } else {
|
|
|
- // 订单处理中
|
|
|
- this.pageStatus = "ING";
|
|
|
- this.CountDown();
|
|
|
- }
|
|
|
- // this.pageStatus = 'success'
|
|
|
- });
|
|
|
- } else {
|
|
|
- if (params.type) {
|
|
|
- this.pageStatus = params.type;
|
|
|
+ async __init() {
|
|
|
+ setLoading(true)
|
|
|
+ try {
|
|
|
+ let params = this.$route.query;
|
|
|
+ if (params.orderNo) {
|
|
|
+ // 是否有订单号
|
|
|
+ await paymentResult({ orderNo: params.orderNo }).then(res => {
|
|
|
+ let result = res.data;
|
|
|
+ if (result.code == 200) {
|
|
|
+ const tempResult = result.data.examRegistrationPayment
|
|
|
+ this.pageStatus = tempResult.transStatus
|
|
|
+ } else {
|
|
|
+ // 订单处理中
|
|
|
+ this.pageStatus = "ING";
|
|
|
+ this.CountDown();
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.pageStatus = "ING";
|
|
|
- this.CountDown();
|
|
|
+ if (params.type) {
|
|
|
+ this.pageStatus = params.type;
|
|
|
+ } else {
|
|
|
+ this.pageStatus = "ING";
|
|
|
+ this.CountDown();
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch(err) {
|
|
|
+ this.pageStatus = "ING";
|
|
|
+ this.CountDown();
|
|
|
}
|
|
|
+ setLoading(false)
|
|
|
},
|
|
|
onAppBack() {
|
|
|
// app回调页面
|
|
|
if (browser().android) {
|
|
|
- if (this.groupType == "PRACTICE") {
|
|
|
- // 收费网管课
|
|
|
- window.location.replace(
|
|
|
- window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- "#" +
|
|
|
- "/auditionpay/1"
|
|
|
- );
|
|
|
- this.$router.push("/auditionpay/1");
|
|
|
- } else {
|
|
|
- DAYA.postMessage(JSON.stringify({ api: "back" }));
|
|
|
- }
|
|
|
+ DAYA.postMessage(JSON.stringify({ api: "back" }));
|
|
|
} else if (browser().iPhone) {
|
|
|
- if (this.groupType == "PRACTICE") {
|
|
|
- // 收费网管课
|
|
|
- window.location.replace(
|
|
|
- window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- "#" +
|
|
|
- "/auditionpay/1"
|
|
|
- );
|
|
|
- this.$router.push("/auditionpay/1");
|
|
|
- } else {
|
|
|
- window.webkit.messageHandlers.DAYA.postMessage(
|
|
|
- JSON.stringify({ api: "back" })
|
|
|
- );
|
|
|
- }
|
|
|
+ window.webkit.messageHandlers.DAYA.postMessage(
|
|
|
+ JSON.stringify({ api: "back" })
|
|
|
+ );
|
|
|
} else {
|
|
|
this.onHref()
|
|
|
}
|
|
|
},
|
|
|
onHref() {
|
|
|
- // musicGroupId
|
|
|
- if (this.$route.query.sporadic || this.groupType == "SPORADIC") {
|
|
|
- if (this.orderInfo.organId == 42) { // 42 分部是对外考级报名
|
|
|
- this.$router.replace({
|
|
|
- path: "/levelApply"
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$router.push({
|
|
|
- path: "/SporadicLogin",
|
|
|
- query: {
|
|
|
- id: this.$route.query.sporadic || this.orderInfo.musicGroupId
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
window.location.replace(
|
|
|
window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- "#" + "/transfer/"
|
|
|
+ "#" + "/levelMusic"
|
|
|
);
|
|
|
- this.$router.push("/transfer")
|
|
|
- }
|
|
|
+ this.$router.push("/levelMusic")
|
|
|
},
|
|
|
CountDown() {
|
|
|
let s = 60;
|
|
@@ -166,8 +138,8 @@ export default {
|
|
|
.paymentResult {
|
|
|
min-height: 100vh;
|
|
|
}
|
|
|
-.payerror,
|
|
|
-.payon,
|
|
|
+.payError,
|
|
|
+.payOn,
|
|
|
.paying {
|
|
|
padding-top: 1rem;
|
|
|
img {
|
|
@@ -195,7 +167,7 @@ export default {
|
|
|
height: 0.5rem;
|
|
|
font-size: 0.18rem;
|
|
|
}
|
|
|
-.paysuccess {
|
|
|
+.paySuccess {
|
|
|
.status {
|
|
|
background-color: #fff;
|
|
|
text-align: center;
|