吉安感知网项目-前端
chenyao
3 days ago a53ece5036c1fa61a63fe5f9e0cd3519210ab928
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
<template>
  <view class="page-wrap">
    <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage" />
  </view>
</template>
 
<script setup>
import { getWebViewUrl } from "@/utils/index.js";
import WebViewPlus from "@/components/WebViewPlus.vue";
import { onHide, onShow,  } from "@dcloudio/uni-app";
import { useUserStore } from "@/store/index.js";
// const viewUrl = getWebViewUrl("/defaultMap");
 
let envParam = "";
// #ifdef WEB
envParam = "true";
// #endif
// #ifdef APP-PLUS
envParam = "false";
// #endif
 
const userStore = useUserStore();
const userParams = userStore?.userInfo ? JSON.stringify(userStore.userInfo) : '{}';
 
const updateKey = ref(0);
const viewUrl = computed(() => {
  return getWebViewUrl("/defaultMap", {
    isWeb: envParam,
    updateKey: updateKey.value,
  });
});
 
const onPostMessage = (data) => {
};
 
onShow(() => {
  // #ifndef MP-WEIXIN
 
  // #endif
});
 
onHide(() => {
  updateKey.value = updateKey.value + 1;
});
</script>
 
<style scoped lang="scss">
.page-wrap {
  font-size: 20px;
}
</style>