ZaiZai 2 years ago
parent
commit
a3de6091b7
1 changed files with 10 additions and 12 deletions
  1. 10 12
      pages/task/detail.vue

+ 10 - 12
pages/task/detail.vue

@@ -133,6 +133,7 @@ const getEventChannel = async () => {
 }
 }
 
 
 onLoad(({node}) => {
 onLoad(({node}) => {
+    uni.setNavigationBarTitle({title: '审批任务'})
     const {rows, isTask} = node ? JSON.parse(decodeURIComponent(node)) : {};
     const {rows, isTask} = node ? JSON.parse(decodeURIComponent(node)) : {};
     const res = getArrValue(rows);
     const res = getArrValue(rows);
     if (res.length > 0) {
     if (res.length > 0) {
@@ -160,22 +161,19 @@ const getDataApi = async () => {
 //设置webview样式
 //设置webview样式
 const webViewStyle = ref({})
 const webViewStyle = ref({})
 const setWebViewStyle = async () => {
 const setWebViewStyle = async () => {
-    const appSys = await querySelect(instance,'app-sys')
-    const appSysHeight = appSys.height
-    //顶部
-    const contentBar = await querySelect(instance,'task-detail-content')
-    const contentBarHeight = contentBar?.height ?? 48
+    const {height: appHeight} = await querySelect(instance,'app-sys')
+    const {height: navHeight} = await querySelect(instance,'task-detail-content')
+    const {height: bottomHeight} = await querySelect(instance,'action-bar')
     // #ifdef H5
     // #ifdef H5
-    webViewStyle.value.top = contentBarHeight + 'px'
+    webViewStyle.value.top = navHeight + 'px'
+    webViewStyle.value.height = (appHeight - navHeight - bottomHeight) + 'px'
     // #endif
     // #endif
     // #ifdef APP-PLUS
     // #ifdef APP-PLUS
-    const {statusBarHeight} = uni.getSystemInfoSync()
-    webViewStyle.value.top = statusBarHeight + 45 + contentBarHeight
+    const {screenHeight, safeArea} = uni.getWindowInfo()
+    webViewStyle.value.top = navHeight + 'px'
+    const content = navHeight + (screenHeight - safeArea.bottom) + bottomHeight
+    webViewStyle.value.height = (screenHeight - content) + 'px'
     // #endif
     // #endif
-    //底部
-    const actionBar = await querySelect(instance,'action-bar')
-    const actionBarHeight = actionBar?.height ?? 80
-    webViewStyle.value.height = (appSysHeight - contentBarHeight - actionBarHeight - 2) + 'px'
 }
 }
 
 
 //切换任务
 //切换任务