diff --git a/src/pages/index/preview.vue b/src/pages/index/preview.vue index 94ed0383..b622e637 100644 --- a/src/pages/index/preview.vue +++ b/src/pages/index/preview.vue @@ -10,7 +10,7 @@ :fullscreen="true" :webview-styles="{ width: '100%', - height: '100%' + height: windowHeight }"> @@ -22,6 +22,7 @@ import { getToken, getPhoneEnvBool, getUserInfo } from '@/common/common' import { downloadFile } from '@/api/common.js' import { get_base_url } from '@/api/request.js' var wv +var windowInfo = uni.getWindowInfo() export default { data() { return { @@ -32,7 +33,9 @@ export default { viewerUrl: '/static/view-pdf/pdf.html', showView: true, wv: null, - userParams: '' + userParams: '', + windowHeight: '100%', + topHeight: 100 } }, onLoad(params) { @@ -42,6 +45,9 @@ export default { } const userInfo = getUserInfo(); this.userParams = '/' + (userInfo?.loginName??'') + '?tk=' + getToken() + console.log(windowInfo.screenHeight) + this.topHeight = windowInfo.statusBarHeight + 45 + this.windowHeight = windowInfo.screenHeight - this.topHeight + 'px' }, onShow() { if (getPhoneEnvBool('AND')) { @@ -71,10 +77,11 @@ export default { methods: { setHeight(res){ //#ifdef APP-PLUS - if(!wv) return + if(!wv) return wv.setStyle({ top: res.height + 40 }) + this.windowHeight = windowInfo.screenHeight - this.topHeight + 'px' // #endif }, backRouter() { diff --git a/src/static/view-pdf/pdf.html b/src/static/view-pdf/pdf.html index c34e2b08..8e250935 100644 --- a/src/static/view-pdf/pdf.html +++ b/src/static/view-pdf/pdf.html @@ -20,9 +20,9 @@ height: 100%; } - body { + /* body { padding-bottom: 100px; - } + } */ .operate { position: fixed;