|
@@ -1,10 +1,12 @@
|
|
<script lang='ts' setup>
|
|
<script lang='ts' setup>
|
|
-import { getBlogsDetailApi, getReleaseBlogApi } from '~/api/model/blogs'
|
|
|
|
import { ConstKeys } from '~/enums/const-enums'
|
|
import { ConstKeys } from '~/enums/const-enums'
|
|
|
|
+import { Api } from '@/api/model/url'
|
|
|
|
+import { useCommonStore } from '@/stores/modules/common'
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const detail = ref<any>({})
|
|
const detail = ref<any>({})
|
|
const tabValue = ref('blog')
|
|
const tabValue = ref('blog')
|
|
|
|
+const isHasCatalogue = ref(true)
|
|
|
|
|
|
const options = ref([
|
|
const options = ref([
|
|
{
|
|
{
|
|
@@ -15,68 +17,144 @@ const options = ref([
|
|
label: 'Preview Catalog',
|
|
label: 'Preview Catalog',
|
|
value: 'catalog',
|
|
value: 'catalog',
|
|
},
|
|
},
|
|
|
|
+
|
|
])
|
|
])
|
|
-const relatedCatalog = ref<any>({
|
|
|
|
- thumbnailUrl: 'https://picsum.photos/300/200',
|
|
|
|
- contentTitle: 'EJET Spark Catalog Title',
|
|
|
|
- contentSubhead: 'EJET Spark catalog description, spark the trend, ignate sales.',
|
|
|
|
-})
|
|
|
|
const slug = route.params.slug
|
|
const slug = route.params.slug
|
|
-// const { data, pending, error, refresh } = await useAsyncData(
|
|
|
|
-// 'blog-detail',
|
|
|
|
-// () =>
|
|
|
|
-// $fetch(`${ConstKeys.DOMAINPRO}/client/content/detail`, { params: { slug } }),
|
|
|
|
-// )
|
|
|
|
-// const seoData = data.value?.result
|
|
|
|
-// detail.value = seoData
|
|
|
|
|
|
+const { data, pending, error, refresh } = await useAsyncData(
|
|
|
|
+ 'blog-detail',
|
|
|
|
+ () =>
|
|
|
|
+ $fetch(`${ConstKeys.DOMAINDEV}${Api.BlogDetail}`, { params: { slug } }),
|
|
|
|
+)
|
|
|
|
+const seoData = data.value?.result
|
|
|
|
+// 把createTime和updateTime转换为ISO格式
|
|
|
|
+if (seoData?.createTime)
|
|
|
|
+ seoData.createTime = new Date(seoData.createTime).toISOString()
|
|
|
|
+
|
|
|
|
+if (seoData?.updateTime)
|
|
|
|
+ seoData.updateTime = new Date(seoData.updateTime).toISOString()
|
|
|
|
+if (!seoData?.relatedCatalogue)
|
|
|
|
+ isHasCatalogue.value = false
|
|
|
|
+detail.value = seoData
|
|
|
|
+useHead({
|
|
|
|
+ title: detail.value?.metaTitle,
|
|
|
|
+ meta: [
|
|
|
|
+ {
|
|
|
|
+ name: 'description',
|
|
|
|
+ content: detail.value?.metaDescribe,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'og:title',
|
|
|
|
+ content: detail.value?.metaTitle,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'og:description',
|
|
|
|
+ content: detail.value?.metaDescribe,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'og:image',
|
|
|
|
+ content: detail.value?.thumbnailUrl,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'og:url',
|
|
|
|
+ content: `${ConstKeys.DOMAINPRO}/blog/${slug}`,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'og:type',
|
|
|
|
+ content: 'website',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'twitter:title',
|
|
|
|
+ content: detail.value?.metaTitle,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'twitter:description',
|
|
|
|
+ content: detail.value?.metaDescribe,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'twitter:site',
|
|
|
|
+ content: `${ConstKeys.DOMAINPRO}/blog/${slug}`,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'twitter:image',
|
|
|
|
+ content: detail.value?.thumbnailUrl,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ property: 'twitter:card',
|
|
|
|
+ content: 'summary_large_image',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ script: [
|
|
|
|
+ // JSON-LD
|
|
|
|
+ {
|
|
|
|
+ type: 'application/ld+json',
|
|
|
|
+ children: JSON.stringify({
|
|
|
|
+ datePublished: detail.value?.createTime,
|
|
|
|
+ dateModified: detail.value?.updateTime,
|
|
|
|
+ }),
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ link: [
|
|
|
|
+ {
|
|
|
|
+ rel: 'canonical',
|
|
|
|
+ href: `${ConstKeys.DOMAINPRO}/blog/${slug}`,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+})
|
|
|
|
|
|
-async function getVideoOrBlogsDetail() {
|
|
|
|
- const res = await getBlogsDetailApi({
|
|
|
|
- slug,
|
|
|
|
- })
|
|
|
|
- detail.value = res
|
|
|
|
|
|
+const { openLoginAndDownloadModal } = useLoginAndDownLoadModal()
|
|
|
|
+
|
|
|
|
+async function clickLoginAndDownload(item: any) {
|
|
|
|
+ try {
|
|
|
|
+ const commonStore = useCommonStore()
|
|
|
|
+ commonStore.setDownloadCatalog(item)
|
|
|
|
+ const { status } = await openLoginAndDownloadModal()
|
|
|
|
+ if (status)
|
|
|
|
+ location.reload()
|
|
|
|
+ }
|
|
|
|
+ catch (error) {
|
|
|
|
+ console.log(error)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-getVideoOrBlogsDetail()
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="blog-detail">
|
|
<div class="blog-detail">
|
|
<div class="bg-#F3F4FB ">
|
|
<div class="bg-#F3F4FB ">
|
|
<div class="pt-175px pb-110px w-1200-auto flex px-60px">
|
|
<div class="pt-175px pb-110px w-1200-auto flex px-60px">
|
|
- <img :src="detail.thumbnailUrl" alt="" srcset="" class="w-410px h-256px b-rd-10px object-cover mr-40px">
|
|
|
|
|
|
+ <img :src="detail?.thumbnailUrl" :alt="detail?.thumbnailAlt" srcset="" class="w-410px h-256px b-rd-10px object-cover mr-40px">
|
|
<div class="flex-1 text-left">
|
|
<div class="flex-1 text-left">
|
|
- <div class="b-rd-400px left-10px text-center w-138px h-32px lh-32px bg-#f9fafd text-#9B6CFF text-14px mb-20px">
|
|
|
|
|
|
+ <div class="b-rd-400px left-10px text-center w-138px h-32px lh-32px bg-#fff/50 backdrop-blur-20px b-1px b-solid b-#fff/60 text-#9B6CFF text-14px mb-20px">
|
|
{{ detail.category_dictText }}
|
|
{{ detail.category_dictText }}
|
|
</div>
|
|
</div>
|
|
<h1
|
|
<h1
|
|
class="!mb-20px fw-800 text-40px ls-2 text-#333 line-clamp-2 lh-50px custom-title-font"
|
|
class="!mb-20px fw-800 text-40px ls-2 text-#333 line-clamp-2 lh-50px custom-title-font"
|
|
>
|
|
>
|
|
- <!-- {{ detail.contentTitle }} -->
|
|
|
|
- EJET Spark Blog Title Trend Report about Catalog
|
|
|
|
|
|
+ {{ detail.contentTitle }}
|
|
</h1>
|
|
</h1>
|
|
<div class="text-16px text-#999 lh-24px">
|
|
<div class="text-16px text-#999 lh-24px">
|
|
- <!-- {{ detail.contentSubhead }} -->
|
|
|
|
- EJET Spark description, spark the trend, ignate sales. EJET Spark catalog description, spark the trend, ignate sales. EJET Spark description, spark the trend, ignate sales. EJET Spark catalog description, spark the trend, ignate sales.
|
|
|
|
|
|
+ {{ detail.contentSubhead }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="w-1200-auto flex pt-30px">
|
|
<div class="w-1200-auto flex pt-30px">
|
|
<div class="w-840px mr-60px">
|
|
<div class="w-840px mr-60px">
|
|
- <el-segmented v-model="tabValue" :options="options">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <div>
|
|
|
|
- <div>{{ scope.item.label }}</div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-segmented>
|
|
|
|
|
|
+ <div v-if="isHasCatalogue">
|
|
|
|
+ <el-segmented v-model="tabValue" :options="options">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <div>
|
|
|
|
+ <div>{{ scope.item.label }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-segmented>
|
|
|
|
+ </div>
|
|
<div v-show="tabValue === 'blog'" class="mt-30px content-detail custom-html" v-html="detail.content" />
|
|
<div v-show="tabValue === 'blog'" class="mt-30px content-detail custom-html" v-html="detail.content" />
|
|
<div v-show="tabValue === 'catalog'" class="mt-30px">
|
|
<div v-show="tabValue === 'catalog'" class="mt-30px">
|
|
<iframe
|
|
<iframe
|
|
- src="http://47.99.151.233:9006/js/baozhen.pdf#view=FitH&toolbar=0&scrollbar=0&navpanes=0"
|
|
|
|
|
|
+ :src="`${detail?.relatedCatalogue?.viewPdf}#view=FitH&toolbar=0&scrollbar=0&navpanes=0`"
|
|
allowfullscreen
|
|
allowfullscreen
|
|
width="100%"
|
|
width="100%"
|
|
- height="1000px"
|
|
|
|
|
|
+ height="1200px"
|
|
style="border: none"
|
|
style="border: none"
|
|
>
|
|
>
|
|
您的浏览器不支持iframe,请使用现代浏览器查看PDF。
|
|
您的浏览器不支持iframe,请使用现代浏览器查看PDF。
|
|
@@ -84,17 +162,17 @@ getVideoOrBlogsDetail()
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex-1">
|
|
<div class="flex-1">
|
|
- <div class="pos-relative mb-40px">
|
|
|
|
- <img :src="relatedCatalog.thumbnailUrl" alt="" srcset="" class="w-375px h-240px b-rd-10px object-cover">
|
|
|
|
|
|
+ <div v-if="isHasCatalogue" class="pos-relative mb-40px">
|
|
|
|
+ <img :src="detail?.relatedCatalogue?.coverImg" :alt="detail?.relatedCatalogue?.coverAlt" srcset="" class="w-375px h-240px b-rd-10px object-cover">
|
|
<h4
|
|
<h4
|
|
class="!mb-15px !mt-30px fw-800 text-24px text-#333 line-clamp-2"
|
|
class="!mb-15px !mt-30px fw-800 text-24px text-#333 line-clamp-2"
|
|
>
|
|
>
|
|
- {{ relatedCatalog.contentTitle }}
|
|
|
|
|
|
+ {{ detail?.relatedCatalogue?.title }}
|
|
</h4>
|
|
</h4>
|
|
<div class="text-14px text-#999 lh-22px line-clamp-2 mb-20px">
|
|
<div class="text-14px text-#999 lh-22px line-clamp-2 mb-20px">
|
|
- {{ relatedCatalog.contentSubhead }}
|
|
|
|
|
|
+ {{ detail?.relatedCatalogue?.subhead }}
|
|
</div>
|
|
</div>
|
|
- <el-button class="!bg-#9B6CFF !text-#fff !b-#9B6CFF !b-rd-380px text-14px fw-bold !h-32px px-20px">
|
|
|
|
|
|
+ <el-button class="!bg-#9B6CFF !text-#fff !b-#9B6CFF !b-rd-380px text-14px fw-bold !h-32px px-20px" @click="clickLoginAndDownload(detail?.relatedCatalogue)">
|
|
Download Catalog
|
|
Download Catalog
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|