|
@@ -86,10 +86,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, computed, watch } from "vue";
|
|
|
+import { onMounted, ref, computed, watch, onBeforeUnmount } from "vue";
|
|
|
import { /* useRoute, */ useRouter } from "vue-router";
|
|
|
import { poiList } from "@/config.js";
|
|
|
|
|
|
+console.log("init App.vue...");
|
|
|
+
|
|
|
// const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
|
|
@@ -130,6 +132,7 @@ function onClickLocateBtn() {
|
|
|
isShowText.value = false;
|
|
|
isNavigating.value = true;
|
|
|
}
|
|
|
+
|
|
|
window.messageCenter.subscribe("nav-to-poi", (v) => {
|
|
|
const poiPos = poiList[v].pos;
|
|
|
window.SenseMain.startNavigationMicroApp({
|
|
@@ -143,11 +146,19 @@ window.messageCenter.subscribe("nav-to-poi", (v) => {
|
|
|
isShowText.value = false;
|
|
|
isNavigating.value = true;
|
|
|
});
|
|
|
-window.SenseMain.emitter.on("NAVIGATE_SUB_APP_END", function () {
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ window.messageCenter.unsubscribeAll();
|
|
|
+});
|
|
|
+
|
|
|
+function onNavEnd() {
|
|
|
isNavigating.value = false;
|
|
|
// console.log("[demo] 导航结束信息", JSON.stringify(msg));
|
|
|
// 输出如下,是否为抵达终点后退出导航,可以查看 endType 字段是否为 0
|
|
|
// [demo] 导航终点信息 {"endName":"会议室2002","endPos":{"x":48.59096,"y":-39.54175,"z":0},"floorId":"20200","type":"brand","navChannel":"Brand","nextApp":"qiankun-h5-standard","endType":-1,"floorName":"F20"}
|
|
|
+}
|
|
|
+window.SenseMain.emitter.on("NAVIGATE_SUB_APP_END", onNavEnd);
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ window.SenseMain.emitter.off("NAVIGATE_SUB_APP_END", onNavEnd);
|
|
|
});
|
|
|
|
|
|
// audio相关
|
|
@@ -257,8 +268,8 @@ window.SenseMain.emitter.on("CLICK_POI", (e) => {
|
|
|
> button.open-map {
|
|
|
pointer-events: initial;
|
|
|
position: absolute;
|
|
|
- left: 21px;
|
|
|
- bottom: 32%;
|
|
|
+ right: 11px;
|
|
|
+ bottom: 268px;
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
background-image: url(@/assets/images/icon-locate-colorful.png);
|