shuishen
2025-10-20 a5025a9428f7bf41b665d773123dd94244518ee4
src/subPackages/workDetail/addWork/index.vue
@@ -1,8 +1,33 @@
<!-- 新建工单 -->
<template>
  <view> 基础 </view>
   <view >
       <WebViewPlus @webMessage="onPostMessage" v-if="isApp" ref="sWebViewRef" :src="`${viewUrl}`" />
   </view>
</template>
<script setup></script>
<script setup>
import {getWebViewUrl} from "@/utils/index.js";
import WebViewPlus from "@/components/WebViewPlus.vue";
const sWebViewRef = ref(null);
const viewUrl = getWebViewUrl('/addWork')
function onPostMessage(data) {
  if (data.type === 'submitSuccess'){
    uni.switchTab({
      url: '/pages/work/index'
    });
  }
}
const isApp = ref(false)
onShow(() => {
  isApp.value = true
});
<style lang="scss" scoped></style>
onHide(() => {
  isApp.value = false
});
</script>
<style scoped lang="scss">
</style>