|
@@ -59,6 +59,7 @@ import { ref, onMounted, computed, watch } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import browser from "@/utils/browser";
|
|
|
import { useApp, getApp } from "@/app";
|
|
|
+import common from "@/utils/common";
|
|
|
|
|
|
const musicPlayer = useMusicPlayer();
|
|
|
|
|
@@ -179,12 +180,11 @@ const onClickTagInfo = (el) => {
|
|
|
};
|
|
|
|
|
|
onMounted(async () => {
|
|
|
-
|
|
|
app = createApp({
|
|
|
num: browser.getURLParam("m"),
|
|
|
dom: scene$.value,
|
|
|
mobile: true,
|
|
|
- isLoadTags:false
|
|
|
+ isLoadTags: false,
|
|
|
});
|
|
|
app.use("MinMap", { theme: { camera_fillStyle: "#ED5D18" } });
|
|
|
app.use("Tag");
|
|
@@ -192,8 +192,8 @@ onMounted(async () => {
|
|
|
.use("TagView", {
|
|
|
render(data) {
|
|
|
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)}`
|
|
|
+ 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">
|
|
@@ -207,12 +207,17 @@ onMounted(async () => {
|
|
|
} else if (data.type == "coupon") {
|
|
|
return `<span class="tag-icon coupon animate" style="background-image:url({{icon}})"></span>`;
|
|
|
} else if (data.type == "applet_link") {
|
|
|
- return `<span class="tag-icon applet_link" style="background-image:url({{icon}})"></span>`;
|
|
|
+ try {
|
|
|
+ data.hotContent = JSON.parse(data.hotContent);
|
|
|
+ } catch (error) {}
|
|
|
+ return `<span class="tag-icon applet_link animate" style="background-image:url(${
|
|
|
+ data.hotContent.liveIcon.src ? common.changeUrl(data.hotContent.liveIcon.src) : "{{icon}}"
|
|
|
+ })"></span>`;
|
|
|
} else if (data.type == "link_scene") {
|
|
|
- return `<span class="tag-icon animate" style="background-image:url(${data.hotContent.liveIcon.src||'{{icon}}'})"></span>`;
|
|
|
+ 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)}`
|
|
|
+ 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">
|
|
@@ -239,7 +244,19 @@ onMounted(async () => {
|
|
|
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}`)}`})
|
|
|
+ if (browser.detectWeixin()) {
|
|
|
+ //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
|
|
|
+ wx.miniProgram.getEnv((res) => {
|
|
|
+ if (res.miniprogram) {
|
|
|
+ //在小程序里
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: tag.hotContent.liveLink,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 不在小程序里
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
} 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}`);
|
|
@@ -273,7 +290,7 @@ onMounted(async () => {
|
|
|
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?rnd=${Math.random()}`)
|
|
|
+ app.resource.tags(`${process.env.VUE_APP_RESOURCE_URL}cdf/hot/${browser.getURLParam("m")}/hot.json?rnd=${Math.random()}`);
|
|
|
useMusicPlayer();
|
|
|
});
|
|
|
app.Scene.on("panorama.videorenderer.resumerender", () => {
|