罗广辉
2026-06-18 44dd9c4eb8a2489c63a5eb53fd4254bbb3510e95
src/subPackages/taskDetail/inProgress/index.vue
@@ -1,43 +1,55 @@
<template>
  <WebViewPlus v-if="showComponent" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
  <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";
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)
const wayLineJobInfoId = ref(null);
const batchNo = ref(null)
const viewUrl = ref("");
const showComponent = ref(false);
function onPostMessage(data) {
  if (data.type === 'back') {
  // #ifndef MP-WEIXIN
  if (data.type === "back") {
    uni.switchTab({
      url: '/pages/inspectionTask/index'
      url: "/pages/inspectionTask/index",
    });
  } else if (data.type === 'control') {
  } else if (data.type === "control") {
    uni.navigateTo({
      url: `/subPackages/droneConsole/index?wayLineJobInfoId=${wayLineJobInfoId.value}&dockSn=${data.dockSn}`
      url: `/subPackages/droneConsole/index?wayLineJobInfoId=${wayLineJobInfoId.value}&dockSn=${data.dockSn}&batchNo=${batchNo.value}`,
    });
  }
  // #endif
}
onLoad((options) => {
  wayLineJobInfoId.value = options.wayLineJobInfoId
  viewUrl.value = getWebViewUrl('/TaskInProgress', {wayLineJobInfoId: wayLineJobInfoId.value})
})
onLoad((queryParams) => {
  wayLineJobInfoId.value = queryParams.wayLineJobInfoId;
  batchNo.value = queryParams.batchNo
  viewUrl.value = getWebViewUrl("/TaskInProgress", {
    wayLineJobInfoId: wayLineJobInfoId.value,
    batchNo: batchNo.value,
  });
});
onShow(function () {
  showComponent.value = true
  showComponent.value = true;
  // #ifdef APP-PLUS
  plus.navigator.setFullscreen(false);
  plus.screen.lockOrientation("portrait-primary");
  // #endif
})
});
onHide(() =>{
  showComponent.value = false
})
onHide(() => {
  showComponent.value = false;
});
</script>
<style scoped lang="scss">