|
@@ -36,24 +36,26 @@
|
|
|
<span>订单号:</span>
|
|
|
{{ orderInfo.orderNo }}
|
|
|
</p>
|
|
|
- <p>
|
|
|
- <!-- 订单内容:购买的小时数, -->
|
|
|
- <span>购买详情:</span>
|
|
|
- <span>购买:{{ orderInfo.transMinutes | calcMinute }};</span>
|
|
|
- <span v-if="orderInfo.giveMinutes && orderInfo.giveMinutes > 0">赠送:{{ orderInfo.giveMinutes | calcMinute }};</span>
|
|
|
- </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 /> -->
|
|
|
</div>
|
|
|
- <van-button type="info" @click="onRepay" round>返回</van-button>
|
|
|
+ <van-button type="info" @click="onAppBack" round>返回</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
/* eslint-disable */
|
|
|
-import MHeader from "@/components/MHeader"
|
|
|
-import { browser } from "@/common/common"
|
|
|
-import { queryByOrderNoAuth } from '@/api/app'
|
|
|
+import MHeader from "@/components/MHeader";
|
|
|
+import { browser, validStudentUrl } from "@/common/common";
|
|
|
+import { queryByOrderNoAuth } from "@/api/app";
|
|
|
|
|
|
export default {
|
|
|
name: "paymentresult",
|
|
@@ -75,22 +77,31 @@ export default {
|
|
|
this.headerStatus = true;
|
|
|
}
|
|
|
this.__init();
|
|
|
- this.pushHistory()
|
|
|
- window.addEventListener("popstate", function(e) {
|
|
|
+ this.pushHistory();
|
|
|
+ window.addEventListener(
|
|
|
+ "popstate",
|
|
|
+ function(e) {
|
|
|
if (browser().android) {
|
|
|
- DAYA.postMessage(JSON.stringify({ api: 'back' }))
|
|
|
+ DAYA.postMessage(JSON.stringify({ api: "back" }));
|
|
|
} else if (browser().iPhone) {
|
|
|
- window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({ api: 'back' }))
|
|
|
+ window.webkit.messageHandlers.DAYA.postMessage(
|
|
|
+ JSON.stringify({ api: "back" })
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ window.location.replace(
|
|
|
+ validStudentUrl() + "/#/teacherDownload")
|
|
|
}
|
|
|
- }, false)
|
|
|
+ },
|
|
|
+ false
|
|
|
+ );
|
|
|
},
|
|
|
methods: {
|
|
|
- pushHistory() {
|
|
|
- var state = {
|
|
|
- title: "title",
|
|
|
- url: "#"
|
|
|
- }
|
|
|
- window.history.pushState(state, "title", "#")
|
|
|
+ pushHistory() {
|
|
|
+ var state = {
|
|
|
+ title: "title",
|
|
|
+ url: "#"
|
|
|
+ };
|
|
|
+ window.history.pushState(state, "title", "#");
|
|
|
},
|
|
|
__init() {
|
|
|
let params = this.$route.query;
|
|
@@ -101,8 +112,8 @@ export default {
|
|
|
let result = res.data;
|
|
|
if (result.code == 200) {
|
|
|
let tempResult = result.data;
|
|
|
- this.orderInfo = tempResult
|
|
|
- this.showStatus(tempResult.status)
|
|
|
+ this.orderInfo = tempResult;
|
|
|
+ this.showStatus(tempResult.status);
|
|
|
} else {
|
|
|
// 订单处理中
|
|
|
this.pageStatus = "paying";
|
|
@@ -140,7 +151,6 @@ export default {
|
|
|
return str;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
showStatus(status, type) {
|
|
|
if (status == "ING") {
|
|
|
this.pageStatus = "paying";
|
|
@@ -153,22 +163,20 @@ export default {
|
|
|
},
|
|
|
onAppBack() {
|
|
|
// app回调页面
|
|
|
- let courseApply = window.localStorage.getItem('courseApply')
|
|
|
- clearInterval(this.timer)
|
|
|
- let historyLength = window.history.length
|
|
|
- if(courseApply) {
|
|
|
- // window.location.replace(
|
|
|
- // window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- // "#" + "/courseApply" );
|
|
|
- // this.$router.push("/courseApply");
|
|
|
- window.history.go(-(historyLength - 1))
|
|
|
+ let courseApply = window.localStorage.getItem("courseApply");
|
|
|
+ clearInterval(this.timer);
|
|
|
+ let historyLength = window.history.length;
|
|
|
+ if (browser().android || browser().iPhone) {
|
|
|
+ if (courseApply) {
|
|
|
+ window.history.go(-(historyLength - 1));
|
|
|
+ } else {
|
|
|
+ window.history.go(-(historyLength - 2));
|
|
|
+ }
|
|
|
} else {
|
|
|
- // window.location.replace(
|
|
|
- // window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- // "#" + "/PeriodExchange" );
|
|
|
- // this.$router.push("/PeriodExchange");
|
|
|
- window.history.go(-(historyLength - 2))
|
|
|
+ window.location.replace(
|
|
|
+ validStudentUrl() + "/#/teacherDownload")
|
|
|
}
|
|
|
+
|
|
|
// if (browser().android) {
|
|
|
// DAYA.postMessage(JSON.stringify({ api: "back" }));
|
|
|
// } else if (browser().iPhone) {
|
|
@@ -177,24 +185,6 @@ export default {
|
|
|
// );
|
|
|
// }
|
|
|
},
|
|
|
- onRepay() {
|
|
|
- let courseApply = window.localStorage.getItem('courseApply')
|
|
|
- clearInterval(this.timer)
|
|
|
- let historyLength = window.history.length
|
|
|
- if(courseApply) {
|
|
|
- // window.location.replace(
|
|
|
- // window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- // "#" + "/courseApply" );
|
|
|
- // this.$router.push("/courseApply");
|
|
|
- window.history.go(-(historyLength - 1))
|
|
|
- } else {
|
|
|
- // window.location.replace(
|
|
|
- // window.location.href.toString().replace(window.location.hash, "") +
|
|
|
- // "#" + "/PeriodExchange" );
|
|
|
- // this.$router.push("/PeriodExchange");
|
|
|
- window.history.go(-(historyLength - 2))
|
|
|
- }
|
|
|
- },
|
|
|
CountDown() {
|
|
|
let s = 60;
|
|
|
this.smsText = s;
|