|
@@ -54,19 +54,22 @@ import Control from "@/components/Controls/Control.Mobile.vue";
|
|
|
import LoadingLogo from "@/components/shared/Loading.vue";
|
|
|
import OpenVideo from "@/components/openVideo/";
|
|
|
|
|
|
-
|
|
|
import { createApp } from "@/app";
|
|
|
import { ref, onMounted, computed, watch } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import browser from "@/utils/browser";
|
|
|
import { useApp, getApp } from "@/app";
|
|
|
+import * as apis from "@/apis/index.js";
|
|
|
|
|
|
const musicPlayer = useMusicPlayer();
|
|
|
|
|
|
let app = null;
|
|
|
|
|
|
const closetagtype = () => {
|
|
|
- store.commit("tag/setTagClickType", "");
|
|
|
+ store.commit("tag/setTagClickType", {
|
|
|
+ type: "",
|
|
|
+ data: {},
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const store = useStore();
|
|
@@ -82,7 +85,7 @@ const controls = computed(() => {
|
|
|
const mode = computed(() => store.getters["mode"]);
|
|
|
const showNavigations = computed(() => store.getters["showNavigations"]);
|
|
|
const scene$ = ref(null);
|
|
|
-const hadVideo = ref(false);
|
|
|
+const hadVideo = ref(!!browser.getURLParam("novideo"));
|
|
|
const show = ref(false);
|
|
|
const dataLoaded = ref(false);
|
|
|
const refMiniMap = ref(null);
|
|
@@ -98,12 +101,14 @@ const resize = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-watch(()=>hadVideo.value,
|
|
|
-(val,old)=>{
|
|
|
- if (val) {
|
|
|
- app.Scene.unlock()
|
|
|
+watch(
|
|
|
+ () => hadVideo.value,
|
|
|
+ (val, old) => {
|
|
|
+ if (val) {
|
|
|
+ app.Scene.unlock();
|
|
|
+ }
|
|
|
}
|
|
|
-});
|
|
|
+);
|
|
|
|
|
|
watch(
|
|
|
() => player.value.showMap,
|
|
@@ -163,17 +168,31 @@ const onClickTagInfo = (el) => {
|
|
|
let item = tags.value.find((item) => item.sid == el.target.dataset.id);
|
|
|
console.log(item);
|
|
|
if (item.type == "commodity") {
|
|
|
- store.commit("tag/setTagClickType", "goodlist");
|
|
|
+ store.commit("tag/setTagClickType", {
|
|
|
+ type: "goodlist",
|
|
|
+ data: item,
|
|
|
+ });
|
|
|
} else if (item.type == "waterfall") {
|
|
|
- store.commit("tag/setTagClickType", "waterfall");
|
|
|
+ store.commit("tag/setTagClickType", {
|
|
|
+ type: "waterfall",
|
|
|
+ data: item,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-onMounted(() => {
|
|
|
+onMounted(async () => {
|
|
|
+ let tags_cdf = (
|
|
|
+ await apis.get_tags_list({
|
|
|
+ num: browser.getURLParam("m"),
|
|
|
+ })
|
|
|
+ ).data;
|
|
|
+
|
|
|
app = createApp({
|
|
|
num: browser.getURLParam("m"),
|
|
|
dom: scene$.value,
|
|
|
mobile: true,
|
|
|
+ isLoadTags:false
|
|
|
+
|
|
|
});
|
|
|
app.use("MinMap", { theme: { camera_fillStyle: "#ED5D18" } });
|
|
|
app.use("Tag");
|
|
@@ -182,13 +201,15 @@ onMounted(() => {
|
|
|
render(data) {
|
|
|
console.log(data, data.type);
|
|
|
if (data.type == "waterfall") {
|
|
|
+ let arr = data.products.map(item=>item.price)
|
|
|
+ let range = `${data.products[0].symbol} ${Math.min.apply(null,arr)} - ${Math.max.apply(null,arr)}`
|
|
|
return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
|
|
|
<div class="tag-body">
|
|
|
<div data-id="${data.sid}" class="tag-commodity">
|
|
|
- <div style="background-image:url({{icon}})" class='tag-avatar'>
|
|
|
+ <div style="background-image:url(${data.products[0].pic})" class='tag-avatar'>
|
|
|
</div>
|
|
|
- <p class="tag-title">這裏是商品標題</p>
|
|
|
- <p class="tag-info">¥ 198 | 查看 ></p>
|
|
|
+ <p class="tag-title">${data.title}</p>
|
|
|
+ <p class="tag-info">${range} | 查看 ></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
`;
|
|
@@ -197,17 +218,17 @@ onMounted(() => {
|
|
|
} else if (data.type == "applet_link") {
|
|
|
return `<span class="tag-icon applet_link" style="background-image:url({{icon}})"></span>`;
|
|
|
} else if (data.type == "link_scene") {
|
|
|
- return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
|
|
|
- <div class="tag-body">sdfsdf</div>
|
|
|
- `;
|
|
|
+ return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>`;
|
|
|
} else if (data.type == "commodity") {
|
|
|
+ let arr = data.products.map(item=>item.price)
|
|
|
+ let range = `${data.products[0].symbol} ${Math.min.apply(null,arr)}-${Math.max.apply(null,arr)}`
|
|
|
return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
|
|
|
<div class="tag-body">
|
|
|
<div data-id="${data.sid}" class="tag-commodity">
|
|
|
- <div style="background-image:url({{icon}})" class='tag-avatar'>
|
|
|
+ <div style="background-image:url(${data.products[0].pic})" class='tag-avatar'>
|
|
|
</div>
|
|
|
- <p class="tag-title">這裏是商品標題</p>
|
|
|
- <p class="tag-info">¥ 198 | 查看 ></p>
|
|
|
+ <p class="tag-title">${data.title}</p>
|
|
|
+ <p class="tag-info">${range} | 查看 ></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
`;
|
|
@@ -223,9 +244,15 @@ onMounted(() => {
|
|
|
// 聚焦当前点击的热点
|
|
|
view.focus(tag.sid).then(() => {
|
|
|
if (tag.type == "coupon") {
|
|
|
- store.commit("tag/setTagClickType", "treasure");
|
|
|
+ store.commit("tag/setTagClickType", {
|
|
|
+ type: "treasure",
|
|
|
+ data: tag,
|
|
|
+ });
|
|
|
} else if (tag.type == "applet_link") {
|
|
|
// wx.miniProgram.navigateTo({url: `/pages/shared/shared?img_url=${encodeURIComponent(uploadRes.data.url)}&companyId=${this.serve.info.companyId}&shareImg=${encodeURIComponent(this.serve.info.shareWxQrCode)}&vrLink=${encodeURIComponent(`${window.location.origin}${location.pathname}?m=${this.$config.projectNum}`)}`})
|
|
|
+ } else if (tag.type == "link_scene") {
|
|
|
+ let sceneFirstView = tag.hotContent.sceneFirstView;
|
|
|
+ window.location.href = "".concat(window.location.pathname, "?").concat(`m=${sceneFirstView.num}&novideo=1&${sceneFirstView.sceneview}`);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -247,13 +274,16 @@ onMounted(() => {
|
|
|
});
|
|
|
|
|
|
app.use("TourPlayer");
|
|
|
- app.Scene.lock()
|
|
|
+ if (!hadVideo.value) {
|
|
|
+ app.Scene.lock();
|
|
|
+ }
|
|
|
app.Scene.on("ready", () => {
|
|
|
show.value = true;
|
|
|
});
|
|
|
app.Scene.on("loaded", (pano) => {
|
|
|
refMiniMap.value = "[xui_min_map]";
|
|
|
store.commit("setFloorId", pano.floorIndex);
|
|
|
+ app.resource.tags( `${process.env.VUE_APP_RESOURCE_URL}cdf/hot/${browser.getURLParam("m")}/hot.json`)
|
|
|
useMusicPlayer();
|
|
|
});
|
|
|
app.Scene.on("panorama.videorenderer.resumerender", () => {
|
|
@@ -273,7 +303,7 @@ onMounted(() => {
|
|
|
}
|
|
|
dataLoaded.value = true;
|
|
|
});
|
|
|
- app.store.on("tags", async (tags) => {
|
|
|
+ app.store.on("tags", (tags) => {
|
|
|
store.commit("tag/load", tags);
|
|
|
});
|
|
|
app.Camera.on("mode.beforeChange", ({ fromMode, toMode, floorIndex }) => {
|
|
@@ -397,7 +427,7 @@ onMounted(() => {
|
|
|
transition: all 0.3s cubic-bezier(0.35, 0.32, 0.65, 0.63);
|
|
|
// pointer-events: none;
|
|
|
.tag-commodity {
|
|
|
- width: 210px;
|
|
|
+ width: 230px;
|
|
|
height: 76px;
|
|
|
background: rgba(255, 255, 255, 0.8);
|
|
|
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
|
|
@@ -442,7 +472,7 @@ onMounted(() => {
|
|
|
}
|
|
|
.tag-info {
|
|
|
padding: 0 0 0 76px;
|
|
|
- font-size: 14px;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
}
|
|
|
&.show {
|