|
@@ -3,7 +3,12 @@
|
|
|
<article ref="article">
|
|
|
<button
|
|
|
class="close"
|
|
|
- @click="$emit('close')"
|
|
|
+ @click="$router.replace({
|
|
|
+ name: 'TreasureDetail',
|
|
|
+ query: {
|
|
|
+ id: $route.query.id,
|
|
|
+ },
|
|
|
+ })"
|
|
|
/>
|
|
|
<h2 title="万吨水压机">
|
|
|
{{ info.name }}
|
|
@@ -58,17 +63,14 @@
|
|
|
|
|
|
<script>
|
|
|
import QRCode from 'qrcode'
|
|
|
-import { ref, nextTick } from "vue"
|
|
|
+import { ref, nextTick, reactive, } from "vue"
|
|
|
import html2canvas from "html2canvas"
|
|
|
+import { useRoute, useRouter } from "vue-router"
|
|
|
|
|
|
export default {
|
|
|
- props: {
|
|
|
- info: {
|
|
|
- type: Object,
|
|
|
- required: true,
|
|
|
- }
|
|
|
- },
|
|
|
setup(props) {
|
|
|
+ const route = useRoute()
|
|
|
+
|
|
|
const prefix = process.env.VUE_APP_API_ORIGIN
|
|
|
|
|
|
const qrcodeDataUrl = ref(null)
|
|
@@ -99,6 +101,14 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+ const info = reactive({})
|
|
|
+ api.getTreasureDetail(route.query.id).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ info.name = res.entity.name
|
|
|
+ info.thumb = res.entity.thumb
|
|
|
+ info.description = res.entity.description
|
|
|
+ })
|
|
|
+
|
|
|
return {
|
|
|
prefix,
|
|
|
|
|
@@ -109,6 +119,8 @@ export default {
|
|
|
aDownloadHref,
|
|
|
isSaving,
|
|
|
onClickDownload,
|
|
|
+
|
|
|
+ info,
|
|
|
}
|
|
|
},
|
|
|
}
|