chenyao
2025-12-01 08fcc710d0a2acb185b3477d72fe32aff6f2e29a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
  <WebViewPlus v-if="showComponent" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
 
<script setup>
import WebViewPlus from "@/components/WebViewPlus.vue";
import {getWebViewUrl} from "@/utils/index.js";
import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
 
const wayLineJodInfoId = ref(null)
const viewUrl = ref('')
const showComponent = ref(false)
function onPostMessage(data) {
  if (data.type === 'back') {
    uni.switchTab({
      url: '/pages/inspectionTask/index'
    });
  } else if (data.type === 'control') {
    uni.navigateTo({
      url: `/subPackages/droneConsole/index?wayLineJodInfoId=${wayLineJodInfoId.value}&dockSn=${data.dockSn}`
    });
  }
}
 
onLoad((options) => {
  wayLineJodInfoId.value = options.wayLineJodInfoId
  viewUrl.value = getWebViewUrl('/TaskInProgress', {wayLineJodInfoId: wayLineJodInfoId.value})
})
 
onShow(function () {
  showComponent.value = true
  // #ifdef APP-PLUS
  plus.navigator.setFullscreen(false);
  plus.screen.lockOrientation("portrait-primary");
  // #endif
})
 
onHide(() =>{
  showComponent.value = false
})
</script>
 
<style scoped lang="scss">
.page-wrap {
  font-size: 20px;
}
</style>