iOS 适配
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ordersId:'',
|
||||
timer:null,
|
||||
maxAjaxNum:5,
|
||||
ajaxNum:0,
|
||||
ordersId: '',
|
||||
timer: null,
|
||||
maxAjaxNum: 5,
|
||||
ajaxNum: 0,
|
||||
url: null, //要打开的外部链接
|
||||
viewerUrl: '/hybrid/html/web/viewer.html',
|
||||
webviewStyles: {
|
||||
@@ -22,38 +22,41 @@
|
||||
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
// console.log('App plus2')
|
||||
// var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
|
||||
// setTimeout(function() {
|
||||
// wv = currentWebview.children()[0]
|
||||
// wv.setStyle({
|
||||
// scalable: true
|
||||
// })
|
||||
// }, 1000); //如果是页面初始化调用时,需要延时一下
|
||||
// #endif
|
||||
},
|
||||
onReady() {},
|
||||
onShow() {
|
||||
console.log(this.ordersId);
|
||||
|
||||
httpsRequest.getT("/app/wuyou/queryOrder/"+this.ordersId, {}).then(res => {
|
||||
|
||||
httpsRequest.getT("/app/wuyou/queryOrder/" + this.ordersId, {}).then(res => {
|
||||
console.log(res.data);
|
||||
|
||||
if(res.data ==1){
|
||||
|
||||
if (res.data == 1) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title:'支付成功',
|
||||
icon:'none'
|
||||
})
|
||||
this.timer= setTimeout(()=>{
|
||||
clearTimeout(this.timer)
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
console.log("is ios ", isIos);
|
||||
if (isIos) {
|
||||
uni.navigateBack()
|
||||
},500)
|
||||
}else{
|
||||
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:'支付中'
|
||||
title: '支付中'
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
@@ -69,29 +72,8 @@
|
||||
onLoad: function(option) {
|
||||
console.log(option)
|
||||
this.url = option.url
|
||||
this.ordersId=option.ordersId
|
||||
console.log('this.ordersId'+this.ordersId);
|
||||
|
||||
// this.url="https://jiaoyu.xianmxkj.com/file/uploadPath/2023/03/08/b6c0dd4821cc9ce70c897adca3ad22c2.pdf"
|
||||
// h5,使用h5访问的时候记得跨域
|
||||
// #ifdef H5
|
||||
// this.url="https://jiaoyu.xianmxkj.com/file/uploadPath/2023/03/08/b6c0dd4821cc9ce70c897adca3ad22c2.pdf"
|
||||
// this.url = `${this.viewerUrl}?file=${encodeURIComponent(option.url)}`;
|
||||
// this.url = `${this.viewerUrl}?file=${'https://jiaoyu.xianmxkj.com/file/uploadPath/2023/03/08/b6c0dd4821cc9ce70c897adca3ad22c2.pdf'}`;
|
||||
// #endif
|
||||
|
||||
// 在安卓和ios手机上
|
||||
// 判断是手机系统:安卓,使用pdf.js
|
||||
// #ifdef APP-PLUS
|
||||
// if(plus.os.name === 'Android') {
|
||||
// this.url = `${this.viewerUrl}?file=${encodeURIComponent(option.url)}`;
|
||||
// }
|
||||
// // ios,直接访问pdf所在路径
|
||||
// else {
|
||||
// this.url = encodeURIComponent(option.url);
|
||||
// }
|
||||
// #endif
|
||||
|
||||
this.ordersId = option.ordersId
|
||||
console.log('this.ordersId' + this.ordersId);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user