|
@@ -12,7 +12,7 @@
|
|
|
<ui-icon type="show_map_collect"></ui-icon>
|
|
|
</span>
|
|
|
|
|
|
- <p class="change">
|
|
|
+ <p class="change" @click="changeMode('dollhouse', $event, 'focus3d')">
|
|
|
<ui-icon type="show_3d_normal"></ui-icon>
|
|
|
3D模型
|
|
|
</p>
|
|
@@ -55,7 +55,7 @@ import LoadingLogo from "@/components/shared/Loading.vue";
|
|
|
import OpenVideo from "@/components/openVideo/";
|
|
|
|
|
|
import { createApp } from "@/app";
|
|
|
-import { ref, onMounted, computed, watch } from "vue";
|
|
|
+import { ref, onMounted, computed, nextTick, watch } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import browser from "@/utils/browser";
|
|
|
import { useApp, getApp } from "@/app";
|
|
@@ -144,12 +144,24 @@ watch(
|
|
|
deep: true,
|
|
|
}
|
|
|
);
|
|
|
-const changeMode = (name, e) => {
|
|
|
+const changeMode = (name, e, focus3d = false) => {
|
|
|
if (!flying.value) {
|
|
|
- background.value.style.width = e.srcElement.getBoundingClientRect().width + "px";
|
|
|
- background.value.style.left = e.srcElement.offsetLeft + "px";
|
|
|
+ let width, left;
|
|
|
+ console.dir(e.srcElement);
|
|
|
store.commit("setMode", name);
|
|
|
+ nextTick(() => {
|
|
|
+ if (focus3d) {
|
|
|
+ let $active = document.querySelector(".tabs>span:last-of-type");
|
|
|
+ console.log($active.getBoundingClientRect().width);
|
|
|
+ background.value.style.width = $active.getBoundingClientRect().width + "px";
|
|
|
+ background.value.style.left = $active.offsetLeft + "px";
|
|
|
+ } else {
|
|
|
+ background.value.style.width = width || e.srcElement.getBoundingClientRect().width + "px";
|
|
|
+ background.value.style.left = left || e.srcElement.offsetLeft + "px";
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+ // console.dir(document.querySelector(".tabs>span:last-of-type"));
|
|
|
};
|
|
|
const toggleMap = () => {
|
|
|
isCollapse.value = !isCollapse.value;
|
|
@@ -244,20 +256,7 @@ onMounted(async () => {
|
|
|
data: tag,
|
|
|
});
|
|
|
} else if (tag.type == "applet_link") {
|
|
|
- if (browser.detectWeixin()) {
|
|
|
- //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
|
|
|
- wx.miniProgram.getEnv((res) => {
|
|
|
- if (res.miniprogram) {
|
|
|
- //在小程序里
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: tag.hotContent.liveLink,
|
|
|
- });
|
|
|
- } else {
|
|
|
- // 不在小程序里
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- }
|
|
|
+ browser.openLink(tag.hotContent.liveLink)
|
|
|
} 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}`);
|