|
@@ -37,9 +37,12 @@
|
|
|
{{ orderInfo.orderNo }}
|
|
|
</p>
|
|
|
<p>
|
|
|
+ <!-- 订单内容:购买的小时数, -->
|
|
|
<span>购买详情:</span>
|
|
|
+ <span>购买:{{ orderInfo.transMinutes | calcMinute }};</span>
|
|
|
+ <span v-if="orderInfo.giveMinutes && orderInfo.giveMinutes > 0">赠送:{{ orderInfo.giveMinutes | calcMinute }};</span>
|
|
|
</p>
|
|
|
- <img class="icon_img" v-if="!ownershipType" src="@/assets/images/icon_cw.png" alt srcset />
|
|
|
+ <!-- <img class="icon_img" v-if="!ownershipType" src="@/assets/images/icon_cw.png" alt srcset /> -->
|
|
|
</div>
|
|
|
<van-button type="info" @click="onRepay" round>返回</van-button>
|
|
|
</div>
|
|
@@ -50,6 +53,7 @@
|
|
|
/* eslint-disable */
|
|
|
import MHeader from "@/components/MHeader"
|
|
|
import { browser } from "@/common/common"
|
|
|
+import { queryByOrderNo } from '@/api/app'
|
|
|
export default {
|
|
|
name: "paymentresult",
|
|
|
components: { MHeader },
|
|
@@ -62,6 +66,7 @@ export default {
|
|
|
orderInfo: {}, // 订单基本信息
|
|
|
smsText: 60,
|
|
|
groupType: null, //订单类型
|
|
|
+ timer: null
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -74,38 +79,28 @@ export default {
|
|
|
__init() {
|
|
|
let params = this.$route.query;
|
|
|
// 支付成功
|
|
|
- // if (params.orderNo) {
|
|
|
+ if (params.orderNo) {
|
|
|
// 是否有订单号
|
|
|
- // checkOrderStatus({ orderNo: params.orderNo }).then(res => {
|
|
|
- // let result = res.data;
|
|
|
- // if (result.code == 200) {
|
|
|
- // let tempResult = result.data;
|
|
|
- // if (
|
|
|
- // tempResult.ownershipType &&
|
|
|
- // tempResult.ownershipType == "COOPERATION"
|
|
|
- // ) {
|
|
|
- // this.ownershipType = true;
|
|
|
- // }
|
|
|
- // this.orderInfo = tempResult.order;
|
|
|
- // this.groupType = tempResult.groupType;
|
|
|
- // if (tempResult.order.type) {
|
|
|
- // this.activeName = tempResult.order.type;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // // 订单处理中
|
|
|
- // this.pageStatus = "paying";
|
|
|
- // this.CountDown();
|
|
|
- // }
|
|
|
- // // this.pageStatus = 'success'
|
|
|
- // });
|
|
|
- // } else {
|
|
|
+ queryByOrderNo({ orderNo: params.orderNo }).then(res => {
|
|
|
+ let result = res.data;
|
|
|
+ if (result.code == 200) {
|
|
|
+ let tempResult = result.data;
|
|
|
+ this.orderInfo = tempResult
|
|
|
+ this.showStatus(tempResult.status)
|
|
|
+ } else {
|
|
|
+ // 订单处理中
|
|
|
+ this.pageStatus = "paying";
|
|
|
+ this.CountDown();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
if (params.type) {
|
|
|
this.pageStatus = params.type;
|
|
|
} else {
|
|
|
this.pageStatus = "paying";
|
|
|
this.CountDown();
|
|
|
}
|
|
|
- // }
|
|
|
+ }
|
|
|
},
|
|
|
getYMDToCn(date) {
|
|
|
if (typeof date == "string") {
|
|
@@ -143,6 +138,7 @@ export default {
|
|
|
onAppBack() {
|
|
|
// app回调页面
|
|
|
let courseApply = localStorage.getItem('courseApply')
|
|
|
+ clearInterval(this.timer)
|
|
|
if(courseApply) {
|
|
|
window.location.replace(
|
|
|
window.location.href.toString().replace(window.location.hash, "") +
|
|
@@ -166,6 +162,7 @@ export default {
|
|
|
},
|
|
|
onRepay() {
|
|
|
let courseApply = localStorage.getItem('courseApply')
|
|
|
+ clearInterval(this.timer)
|
|
|
if(courseApply) {
|
|
|
window.location.replace(
|
|
|
window.location.href.toString().replace(window.location.hash, "") +
|
|
@@ -181,10 +178,10 @@ export default {
|
|
|
CountDown() {
|
|
|
let s = 60;
|
|
|
this.smsText = s;
|
|
|
- let timer = setInterval(() => {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
if (s <= 0) {
|
|
|
window.location.reload();
|
|
|
- clearInterval(timer);
|
|
|
+ clearInterval(this.timer);
|
|
|
} else {
|
|
|
s--;
|
|
|
this.smsText = s;
|