<!-- 返回上一步 -->
<template>
<view>
<web-view :src="webviewStyles" @message="handleMessage"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
webviewStyles: [],
}
},
onLoad: function (option) {
if(uni.getStorageSync('user')){
this.webviewStyles = decodeURIComponent(option.url)+'?key='+uni.getStorageSync('user').last_login_time;
}else{
this.webviewStyles = decodeURIComponent(option.url);
}
let height = 0;
let statusbar = 0;
uni.getSystemInfo({
success: (sysinfo) => {
statusbar = sysinfo.statusBarHeight;
height = sysinfo.windowHeight;
}
});
let currentWebview = this.$scope.$getAppWebview();
setTimeout(function() {
var wv = currentWebview.children()[0];
wv.setStyle({
top: statusbar,
height: height - statusbar,
})
}, 200);
}
}
</script>
<style>
</style>