|
@@ -55,15 +55,6 @@ import MHeader from "@/components/MHeader"
|
|
|
import { browser } from "@/common/common"
|
|
|
import { queryByOrderNoAuth } from '@/api/app'
|
|
|
|
|
|
-window.addEventListener("popstate",function(e){
|
|
|
- if (browser().android) {
|
|
|
- DAYA.postMessage(JSON.stringify({ api: "close" }));
|
|
|
- } else if (browser().iPhone) {
|
|
|
- window.webkit.messageHandlers.DAYA.postMessage(
|
|
|
- JSON.stringify({ api: "close" })
|
|
|
- );
|
|
|
- }
|
|
|
-},false)
|
|
|
export default {
|
|
|
name: "paymentresult",
|
|
|
components: { MHeader },
|
|
@@ -84,8 +75,23 @@ export default {
|
|
|
this.headerStatus = true;
|
|
|
}
|
|
|
this.__init();
|
|
|
+ this.pushHistory()
|
|
|
+ window.addEventListener("popstate", function(e) {
|
|
|
+ if (browser().android) {
|
|
|
+ DAYA.postMessage(JSON.stringify({ api: 'back' }))
|
|
|
+ } else if (browser().iPhone) {
|
|
|
+ window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({ api: 'back' }))
|
|
|
+ }
|
|
|
+ }, false)
|
|
|
},
|
|
|
methods: {
|
|
|
+ pushHistory() {
|
|
|
+ var state = {
|
|
|
+ title: "title",
|
|
|
+ url: "#"
|
|
|
+ }
|
|
|
+ window.history.pushState(state, "title", "#")
|
|
|
+ },
|
|
|
__init() {
|
|
|
let params = this.$route.query;
|
|
|
// 支付成功
|
|
@@ -147,7 +153,7 @@ export default {
|
|
|
},
|
|
|
onAppBack() {
|
|
|
// app回调页面
|
|
|
- let courseApply = localStorage.getItem('courseApply')
|
|
|
+ let courseApply = window.localStorage.getItem('courseApply')
|
|
|
clearInterval(this.timer)
|
|
|
let historyLength = window.history.length
|
|
|
if(courseApply) {
|
|
@@ -172,7 +178,7 @@ export default {
|
|
|
// }
|
|
|
},
|
|
|
onRepay() {
|
|
|
- let courseApply = localStorage.getItem('courseApply')
|
|
|
+ let courseApply = window.localStorage.getItem('courseApply')
|
|
|
clearInterval(this.timer)
|
|
|
let historyLength = window.history.length
|
|
|
if(courseApply) {
|