张含笑
2025-10-16 520c4fef24b9ebcca6bb3c6b3b06c327f0dcc901
feat:地图展示
2 files modified
25 ■■■■ changed files
src/subPackages/workDetail/index.vue 8 ●●●● patch | view | raw | blame | history
src/subPackages/workDetail/mapWork/index.vue 17 ●●●● patch | view | raw | blame | history
src/subPackages/workDetail/index.vue
@@ -6,16 +6,16 @@
</template>
<script setup>
        import {getWebViewUrl} from "@/utils/index.js";
    import { onLoad } from '@dcloudio/uni-app';
    import { useUserStore } from '@/store/index.js'
    const userStore = useUserStore()
    const userInfo = userStore.userInfo
    const sWebViewRef = ref(null);
    const viewUrl = ref(`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}`);
    const viewUrl = ref('')
    onLoad( (options) => {
        const eventNum= options.eventNum;
        viewUrl.value =`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}&eventNum=${eventNum}`
        const eventNum= options.eventNum;
        viewUrl.value = getWebViewUrl('/workDetail', {eventNum:eventNum})
    });
    
    function onPostMessage(data) {
src/subPackages/workDetail/mapWork/index.vue
@@ -1,8 +1,21 @@
<!-- 地图展示 -->
<template>
  <view> 基础 </view>
  <WebViewPlus ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
<script setup></script>
<script setup>
    import {getWebViewUrl} from "@/utils/index.js";
    import { onLoad } from '@dcloudio/uni-app';
    const sWebViewRef = ref(null);
    const viewUrl = ref('')
    onLoad( (options) => {
        const currentItem = options.currentItem
    viewUrl.value = getWebViewUrl('/mapWork', {currentItem:currentItem})
    });
</script>
<style lang="scss" scoped></style>