|
@@ -20,7 +20,7 @@ import { getFdkkInfo } from "@/apis";
|
|
|
import { isUpgradeAdapter } from "@/utils/fixVersion";
|
|
|
import browser from "@/utils/browser";
|
|
|
import config from "@/utils/config";
|
|
|
-import { useI18n } from "vue-i18n";
|
|
|
+import { useI18n, getLocale } from "@/i18n";
|
|
|
const { t } = useI18n({ useScope: "global" });
|
|
|
const store = useStore();
|
|
|
const isMobile = computed(() => browser.isMobile());
|
|
@@ -39,7 +39,7 @@ const hadGetInfo = ref(false);
|
|
|
const loadScene = async (currentScene) => {
|
|
|
let app = await getApp();
|
|
|
// await new Promise((r) => setTimeout(r, 10000));
|
|
|
- console.error("loadScene", unref(currentScene));
|
|
|
+ console.error("loadScene", unref(currentScene).id);
|
|
|
if (app.krpanoDom) {
|
|
|
let { sceneCode, initVisual, someData } = currentScene;
|
|
|
app.krpanoDom.call(
|
|
@@ -47,10 +47,22 @@ const loadScene = async (currentScene) => {
|
|
|
initVisual ? initVisual.vlookat : "0"
|
|
|
},${initVisual ? initVisual.hlookat : "0"})`
|
|
|
);
|
|
|
- console.log(sceneCode, someData);
|
|
|
+
|
|
|
if (someData && someData.hotspots && someData.hotspots.length > 0) {
|
|
|
app.Tags.initHotspot(someData.hotspots, false);
|
|
|
}
|
|
|
+
|
|
|
+ const { vlookat, hlookat, vlookatmax, vlookatmin } =
|
|
|
+ currentScene.initVisual;
|
|
|
+ app.krpanoDom.set(`view.limitview`, "lookat");
|
|
|
+ app.krpanoDom.set(`view.vlookat`, vlookat);
|
|
|
+ app.krpanoDom.set(`view.hlookat`, hlookat);
|
|
|
+ app.krpanoDom.set(`view.vlookatmin`, vlookatmin);
|
|
|
+ app.krpanoDom.set(`view.vlookatmax`, vlookatmax);
|
|
|
+
|
|
|
+ console.log("customMasks", currentScene.customMask);
|
|
|
+ const { earth, sky } = currentScene.customMask;
|
|
|
+ handleMasksUpdate(sky, earth, app);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -84,7 +96,7 @@ watch(
|
|
|
store.dispatch("audio/setLock", false);
|
|
|
nextTick(() => {
|
|
|
loadScene(newVal);
|
|
|
- console.log(newVal, "newVal");
|
|
|
+ // console.log(newVal, "newVal");
|
|
|
});
|
|
|
} else {
|
|
|
getFdkkInfo({ num: newVal.sceneCode }).then(async (data) => {
|
|
@@ -101,7 +113,7 @@ watch(
|
|
|
data.data.bgMusic != "0" &&
|
|
|
data.data.bgMusic != "Cheerful" &&
|
|
|
data.data.bgMusic != "noMusic";
|
|
|
-
|
|
|
+
|
|
|
console.error("是否有V3--BGM", flag);
|
|
|
store.commit("fdkk/setV3FdkkBGM", flag);
|
|
|
store.dispatch("audio/initV3BGM", flag);
|
|
@@ -193,6 +205,45 @@ onMounted(() => {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+const handleMasksUpdate = (skyMask, earthMask, app) => {
|
|
|
+ const lang = getLocale();
|
|
|
+ let defaultMask = `%SWFPATH%/skin/masking_${lang}.png`;
|
|
|
+ if (skyMask) {
|
|
|
+ if ("isShow" in skyMask) {
|
|
|
+ app.krpanoDom.set(`hotspot[peaklogo].visible`, Boolean(skyMask.isShow));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (skyMask.icon) {
|
|
|
+ app.krpanoDom.set(`hotspot[peaklogo].url`, skyMask.icon);
|
|
|
+ } else {
|
|
|
+ app.krpanoDom.set(`hotspot[peaklogo].url`, defaultMask);
|
|
|
+ }
|
|
|
+ if ("scale" in skyMask) {
|
|
|
+ app.krpanoDom.set(`hotspot[peaklogo].scale`, skyMask.scale);
|
|
|
+ }
|
|
|
+ if ("antidistorted" in skyMask) {
|
|
|
+ app.krpanoDom.set(`hotspot[peaklogo].distorted`, skyMask.antidistorted);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (earthMask) {
|
|
|
+ if ("isShow" in earthMask) {
|
|
|
+ app.krpanoDom.set(`hotspot[nadirlogo].visible`, Boolean(skyMask.isShow));
|
|
|
+ }
|
|
|
+ if (earthMask.icon) {
|
|
|
+ app.krpanoDom.set(`hotspot[nadirlogo].url`, earthMask.icon);
|
|
|
+ }
|
|
|
+ if ("scale" in earthMask) {
|
|
|
+ app.krpanoDom.set(`hotspot[nadirlogo].scale`, earthMask.scale);
|
|
|
+ }
|
|
|
+ if ("antidistorted" in earthMask) {
|
|
|
+ app.krpanoDom.set(
|
|
|
+ `hotspot[nadirlogo].distorted`,
|
|
|
+ earthMask.antidistorted
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|