Browse Source

新增webview 视窗

master
453530270@qq.com 2 years ago
parent
commit
6f358f85fc
  1. 8
      pages.json
  2. 36
      pages/paySuccess/paySuccess.vue
  3. 23
      pages/webview/webview.vue

8
pages.json

@ -151,6 +151,14 @@
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/webview/webview",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {

36
pages/paySuccess/paySuccess.vue

@ -93,8 +93,23 @@
},
//
zwdz(){
const zwurl="http://10.24.4.14"
window.location.href=zwurl
let zwurl="http://10.24.4.14"
//
uni.showModal({
title: '提示',
content: '即将打开链接:'+zwurl,
success: res => {
if(res.confirm){
// uni.navigateTo({
// url:zwurl
// })
this.$navTo("pages/webview/webview?url="+zwurl)
// window.location.href=zwurl
}
}
})
//window.location.href=zwurl
},
//
@ -126,7 +141,8 @@
//
downapp(){
const durl ="";
let durl ="https://whreg.xingtongworld.com/"; //h5
//
var u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//
@ -138,8 +154,20 @@
} else if (u.indexOf('Windows Phone') > -1) {//winphone
//alert(' windows Phone')
}
//
uni.showModal({
title: '提示',
content: '即将打开链接:'+durl,
// showCancel: false,
success: res => {
if (res.confirm) {
this.$navTo("pages/webview/webview?url="+durl)
}
}
})
// this.$router.push(durl)
//
window.location.href=durl
// window.location.href=durl
},
//

23
pages/webview/webview.vue

@ -0,0 +1,23 @@
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url:""
}
},
onLoad(item) {
console.log(item)
this.url = item.url
}
}
</script>
<style>
</style>
Loading…
Cancel
Save