Sfoglia il codice sorgente

【国之重器】分享、录屏功能对接接口

任一存 2 anni fa
parent
commit
f0a72e6be3
2 ha cambiato i file con 16 aggiunte e 5 eliminazioni
  1. 14 4
      src/components/TreasureShare.vue
  2. 2 1
      src/views/TreasureDetail.vue

+ 14 - 4
src/components/TreasureShare.vue

@@ -6,7 +6,7 @@
         @click="$emit('close')"
       />
       <h2 title="万吨水压机">
-        {{ '万吨水压机' }}
+        {{ info.name }}
       </h2>
       <img
         class="splitter"
@@ -16,13 +16,13 @@
       >
       <img
         class="photo"
-        src="@/assets/mock/treasure-demo.png"
+        :src="`${prefix}${info.thumb}`"
         alt=""
         draggable="false"
       >
       <div
         class="txt"
-        v-html="'中国第一台万吨水压机,机身高23.65米,地面部分高16.7米。1959年,江南造船厂万吨水压机工作大队成立;1961年12月13日,万吨水压机开始总体安装;1962年6月22日,万吨水压机宣告正式投产;直到现在,万吨水压机仍在上海重型机器厂使用。'"
+        v-html="info.description"
       />
       <div class="QRCode">
         <img
@@ -62,7 +62,15 @@ import { ref, nextTick } from "vue"
 import html2canvas from "html2canvas"
 
 export default {
-  setup() {
+  props: {
+    info: {
+      type: Object,
+      required: true,
+    }
+  },
+  setup(props) {
+    const prefix = process.env.VUE_APP_API_ORIGIN
+
     const qrcodeDataUrl = ref(null)
     QRCode.toDataURL(location.href).then((url) => {
       qrcodeDataUrl.value = url
@@ -92,6 +100,8 @@ export default {
     })
 
     return {
+      prefix,
+
       qrcodeDataUrl,
 
       article,

+ 2 - 1
src/views/TreasureDetail.vue

@@ -3,6 +3,7 @@
     <Teleport to="body">
       <TreasureShare
         v-if="isShowShare"
+        :info="rawData.value?.entity"
         @close="isShowShare = false"
       />
     </Teleport>
@@ -133,7 +134,7 @@
       <button
         v-if="canRecord"
         @click="$router.push({name: 'RecordView', query: {
-          url: encodeURI(modelUrlList[activeSwiperItemIndex])
+          url: encodeURI(`${prefix}/web-model/index.html#/relic-detail?model-path=${encodeURIComponent(modelUrlList[activeSwiperItemIndex].filePath)}`)
         }})"
       >
         <img