|
@@ -1,9 +1,6 @@
|
|
|
<template>
|
|
|
<popup v-if="show">
|
|
|
- <div
|
|
|
- class="ui-message ui-message-confirm message-material"
|
|
|
- style="width: 500px"
|
|
|
- >
|
|
|
+ <div class="ui-message ui-message-confirm message-material" style="width: 500px">
|
|
|
<div class="ui-message-header header-material">
|
|
|
<span>{{ share }}</span>
|
|
|
<span @click="$emit('close')">
|
|
@@ -14,14 +11,7 @@
|
|
|
<ul>
|
|
|
<li>
|
|
|
<span>{{ work_link }}</span>
|
|
|
- <input
|
|
|
- :title="item.share + `&vr=${defaultscenesCode}&lang=${$lang}`"
|
|
|
- class="ui-input"
|
|
|
- disabled
|
|
|
- type="text"
|
|
|
- maxlength="15"
|
|
|
- :value="item.share + `&vr=${defaultscenesCode}&lang=${$lang}`"
|
|
|
- />
|
|
|
+ <input :title="path + `?id=${item.id}&lang=${$lang}`" class="ui-input" disabled type="text" maxlength="15" :value="path + `?id=${item.id}&lang=${$lang}`" />
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>{{ work_qrCode }} </span>
|
|
@@ -29,9 +19,7 @@
|
|
|
<div
|
|
|
class="qrcode"
|
|
|
:style="{
|
|
|
- backgroundImage: `url(${
|
|
|
- currentQRcode || require('@/assets/svg/loading.svg')
|
|
|
- })`,
|
|
|
+ backgroundImage: `url(${currentQRcode || require('@/assets/svg/loading.svg')})`,
|
|
|
}"
|
|
|
/>
|
|
|
</li>
|
|
@@ -39,17 +27,10 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="ui-message-footer footer-material">
|
|
|
- <button
|
|
|
- @click="downloadImg(item)"
|
|
|
- class="ui-button"
|
|
|
- :class="currentQRcode.length === 0 ? 'disable' : ''"
|
|
|
- >
|
|
|
+ <button @click="downloadImg(item)" class="ui-button" :class="currentQRcode.length === 0 ? 'disable' : ''">
|
|
|
{{ download_qrCode }}
|
|
|
</button>
|
|
|
- <button
|
|
|
- @click="copy(item.share + `&vr=${defaultscenesCode}&lang=${$lang}`)"
|
|
|
- class="ui-button submit"
|
|
|
- >
|
|
|
+ <button @click="copy(path + `?id=${item.id}&lang=${$lang}`)" class="ui-button submit">
|
|
|
{{ copy_link }}
|
|
|
</button>
|
|
|
</div>
|
|
@@ -59,7 +40,7 @@
|
|
|
|
|
|
<script>
|
|
|
import Popup from "@/components/shared/popup";
|
|
|
-import { getQrCode } from "@/api";
|
|
|
+import { getQrCode, getWorkLogo } from "@/api";
|
|
|
import { i18n } from "@/lang";
|
|
|
|
|
|
export default {
|
|
@@ -76,28 +57,38 @@ export default {
|
|
|
copy_link: i18n.t("material.works.copy_link"),
|
|
|
key: "",
|
|
|
currentQRcode: "",
|
|
|
+ path: process.env.VUE_APP_PROXY_URL_ROOT + "/panorama/showMobile.html",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- defaultscenesCode: function () {
|
|
|
- if (this.item.firstScene) {
|
|
|
- return this.item.firstScene.sceneCode || "";
|
|
|
- } else {
|
|
|
- return Array.from(this.item.scenes).length > 0
|
|
|
- ? Array.from(this.item.scenes)[0].sceneCode
|
|
|
- : "";
|
|
|
- }
|
|
|
- },
|
|
|
+ // defaultscenesCode: function () {
|
|
|
+ // if (this.item.firstScene) {
|
|
|
+ // return this.item.firstScene.sceneCode || "";
|
|
|
+ // } else {
|
|
|
+ // return Array.from(this.item.scenes).length > 0
|
|
|
+ // ? Array.from(this.item.scenes)[0].sceneCode
|
|
|
+ // : "";
|
|
|
+ // }
|
|
|
+ // },
|
|
|
},
|
|
|
watch: {
|
|
|
item: {
|
|
|
- handler: function (val) {
|
|
|
+ handler: async function (val) {
|
|
|
this.currentQRcode = "";
|
|
|
- if (val.share) {
|
|
|
+ // if (val.share) {
|
|
|
+ if (val.id) {
|
|
|
const shareLink =
|
|
|
- val.share + `&vr=${this.defaultscenesCode}&lang=${this.$lang}`;
|
|
|
+ // val.share + `&vr=${this.defaultscenesCode}&lang=${this.$lang}`;
|
|
|
+ this.path + `?id=${val.id}&lang=${this.$lang}`;
|
|
|
console.log("当前分享", shareLink);
|
|
|
- const llogo = val.logo || "";
|
|
|
+ let llogo = "";
|
|
|
+ await getWorkLogo({ workId: val.id }).then((res) => {
|
|
|
+ if (res.data && res.data.logo) {
|
|
|
+ llogo = res.data.logo;
|
|
|
+ } else {
|
|
|
+ llogo = "";
|
|
|
+ }
|
|
|
+ });
|
|
|
getQrCode({ logo: llogo, text: shareLink }).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
this.currentQRcode = res.data.img;
|
|
@@ -138,9 +129,7 @@ export default {
|
|
|
textArea.select();
|
|
|
|
|
|
try {
|
|
|
- document.execCommand("copy")
|
|
|
- ? this.$msg.success(this.$i18n.t("gather.scene_link_copy_tips"))
|
|
|
- : this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
|
|
|
+ document.execCommand("copy") ? this.$msg.success(this.$i18n.t("gather.scene_link_copy_tips")) : this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
|
|
|
} catch (err) {
|
|
|
this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
|
|
|
}
|