video_app/pages/pays/pays.vue

85 lines
1.7 KiB
Vue

<template>
<view style="width: 100%;">
<web-view id="webview" :src="url" style="width: 100%;"></web-view>
</view>
</template>
<script>
import httpsRequest from '@/common/httpRequest.js'
export default {
data() {
return {
ordersId: '',
timer: null,
maxAjaxNum: 5,
ajaxNum: 0,
url: null, //要打开的外部链接
viewerUrl: '/hybrid/html/web/viewer.html',
webviewStyles: {
width: '750px',
height: '100%',
},
}
},
onReady() {},
onShow() {
console.log(this.ordersId);
httpsRequest.getT("/app/wuyou/queryOrder/" + this.ordersId, {}).then(res => {
console.log(res.data);
if (res.data == 1) {
uni.hideLoading()
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
console.log("is ios ", isIos);
if (isIos) {
uni.navigateBack()
uni.showToast({
title: '支付成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
} else {
uni.showToast({
title: '支付成功',
icon: 'none'
})
this.timer = setTimeout(() => {
clearTimeout(this.timer)
uni.navigateBack()
}, 500)
}
} else {
// #ifdef APP
uni.showLoading({
title: '支付中'
})
// #endif
}
});
},
onHide() {
clearInterval(this.timer)
uni.hideLoading()
},
onUnload() {
uni.hideLoading()
},
onLoad: function(option) {
console.log(option)
this.url = option.url
this.ordersId = option.ordersId
console.log('this.ordersId' + this.ordersId);
}
}
</script>
<style lang="scss">
.webview {
width: 100%;
height: 100%;
}
</style>