罗广辉
2026-06-18 44dd9c4eb8a2489c63a5eb53fd4254bbb3510e95
src/subPackages/workDetail/mapWork/index.vue
@@ -1,8 +1,41 @@
<!-- 地图展示 -->
<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 });
});
function onPostMessage(data) {
  // #ifndef MP-WEIXIN
  if (data.type === "workDetailback") {
    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>