You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
zhishifufei_uniapp/pages/my/webview.vue

44 lines
869 B

<template>
<BaseContainer class="exam-link flex">
<!-- #ifndef MP-WEIXIN -->
<NavBar title="考试链接" />
<!-- #endif -->
<web-view :src="src" class="web-view"></web-view>
</BaseContainer>
</template>
<script>
export default {
data() {
return {
src: '',
};
},
onLoad({ src }) {
this.src = decodeURIComponent(src);
},
onReady() {
// #ifdef APP-PLUS
const currentWebview = this.$scope.$getAppWebview()
this.pageTitle = uni.getAppBaseInfo().appName
setTimeout(function() {
const top = uni.getSystemInfoSync().statusBarHeight + 44
const wv = currentWebview.children()[0]
wv.setStyle({
top
})
}, 100); //如果是页面初始化调用时,需要延时一下
// #endif
},
};
</script>
<style scope lang="scss">
.exam-link {
flex-direction: column;
.web-view {
flex: 1;
}
}
</style>