78 lines
2.5 KiB
Vue
78 lines
2.5 KiB
Vue
|
|
<template>
|
|||
|
|
<view class="file-wrapper">
|
|||
|
|
|
|||
|
|
<headers class="fixedheader" :showBack="true">
|
|||
|
|
|
|||
|
|
<view class="headerName">
|
|||
|
|
文件管理
|
|||
|
|
</view>
|
|||
|
|
</headers>
|
|||
|
|
|
|||
|
|
<conponent-page class="pageView"></conponent-page>
|
|||
|
|
|
|||
|
|
<!-- <web-view class="content" :src="'http://localhost:8080/file?projectSn='+projectSn"></web-view> -->
|
|||
|
|
|
|||
|
|
<!-- <web-view class="content" :src="this.url_config+'?projectSn='+projectSn"></web-view> -->
|
|||
|
|
<!-- <web-view class="content" :src="'http://192.168.34.228:8081/doc/fileManage/index.html?projectSn='+projectSn"></web-view> -->
|
|||
|
|
<!-- <web-view :webview-styles="webStyles" class="content" :src="'http://192.168.34.228:8080?projectSn=' + projectSn"></web-view> -->
|
|||
|
|
|
|||
|
|
</view>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
import conponentPage from '../../components/webViewPage.nvue'
|
|||
|
|
export default {
|
|||
|
|
name: 'File',
|
|||
|
|
data(){
|
|||
|
|
return{
|
|||
|
|
projectSn:'',
|
|||
|
|
statusBarHeight: 0,
|
|||
|
|
webStyles:{
|
|||
|
|
height: '500px',
|
|||
|
|
progress: {
|
|||
|
|
// color: '#FF3333',
|
|||
|
|
color: '#409EFF'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
onShow(){
|
|||
|
|
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
|
|||
|
|
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
|
|||
|
|
},
|
|||
|
|
onLoad(){
|
|||
|
|
console.log(JSON.parse(uni.getStorageSync('userInfo')).sn)
|
|||
|
|
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
|
|||
|
|
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
onReady() {
|
|||
|
|
var that = this;
|
|||
|
|
var height = 0; //定义动态的高度变量,如高度为定值,可以直接写
|
|||
|
|
var statusBarHeight = 0;
|
|||
|
|
uni.getSystemInfo({
|
|||
|
|
//成功获取的回调函数,返回值为系统信息
|
|||
|
|
success: (sysinfo) => {
|
|||
|
|
height = sysinfo.windowHeight - 45 - sysinfo.statusBarHeight; //自行修改,自己需要的高度
|
|||
|
|
statusBarHeight = sysinfo.statusBarHeight;
|
|||
|
|
},
|
|||
|
|
complete: () => {}
|
|||
|
|
});
|
|||
|
|
var currentWebview = this.$scope.$getAppWebview(); //获取当前web-view
|
|||
|
|
setTimeout(function() {
|
|||
|
|
var wv = currentWebview.children()[0];
|
|||
|
|
wv.setStyle({ //设置web-view距离顶部的距离以及自己的高度,单位为px
|
|||
|
|
top: 45 + statusBarHeight,
|
|||
|
|
height: height
|
|||
|
|
})
|
|||
|
|
}, 500); //如页面初始化调用需要写延迟
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
<style scoped>
|
|||
|
|
.content{
|
|||
|
|
margin-top: 40rpx;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
</style>
|