罗广辉
2026-04-24 648904d076ae6e17892b40675598b1c8dc474277
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
<!--
 * @Author       : yuan
 * @Date         : 2025-10-22 14:59:10
 * @LastEditors  : yuan
 * @LastEditTime : 2025-12-19 14:52:54
 * @FilePath     : \src\subPackages\workDetail\mapWork\index.vue
 * @Description  : 
 * Copyright 2025 OBKoro1, All Rights Reserved. 
 * 2025-10-22 14:59:10
-->
<!-- 地图展示 -->
<template>
  <WebViewPlus
    ref="sWebViewRef"
    :src="`${viewUrl}`"
    @webMessage="onPostMessage"
  />
</template>
 
<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 });
});
function onPostMessage(data) {
  // #ifdef MP-WEIXIN
  // #endif
 
  // #ifndef MP-WEIXIN
  if (data.type === "workDetailback") {
    // uni.navigateTo({
    //   url: '/subPackages/workDetail/index'
    // });
    uni.navigateBack({
      delta: 1,
    });
  }
 
  if (data.type === "browser") {
    uni.navigateTo({
      url:
        "/subPackages/browser/index?url=" + encodeURIComponent(data.data.url),
    });
  }
  // #endif
}
</script>
 
<style lang="scss" scoped></style>