shuishen
2025-12-19 32febb140d320b35d580c8d4e78a80ef846e75fc
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!--
 * @Author       : yuan
 * @Date         : 2025-12-05 11:32:36
 * @LastEditors  : yuan
 * @LastEditTime : 2025-12-19 15:56:31
 * @FilePath     : \src\subPackages\inProgress\index.vue
 * @Description  : 
 * Copyright 2025 OBKoro1, All Rights Reserved. 
 * 2025-12-05 11:32:36
-->
<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 wayLineJobInfoId = ref(null);
const viewUrl = ref("");
const showComponent = ref(false);
function onPostMessage(data) {
  // #ifdef MP-WEIXIN
  // #endif
 
  // #ifndef MP-WEIXIN
  if (data.type === "back") {
    uni.switchTab({
      url: "/pages/inspectionTask/index",
    });
  } else if (data.type === "control") {
    uni.navigateTo({
      url: `/subPackages/droneConsole/index?wayLineJobInfoId=${wayLineJobInfoId.value}&dockSn=${data.dockSn}`,
    });
  }
  // #endif
}
 
onLoad((options) => {
  wayLineJobInfoId.value = options.wayLineJobInfoId;
  viewUrl.value = getWebViewUrl("/TaskInProgress", {
    wayLineJobInfoId: wayLineJobInfoId.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>