Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-12-04 18:19:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a79bf66372cf1ed54a0443ad7e92237ab4ec16f1
a79bf663
1 parent
5731cd75
✨ feat: 新增相关详情页的key,description字段,seo显示
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
src/views/news/detail.vue
src/views/product/detail.vue
src/views/solution/case.vue
src/views/news/detail.vue
View file @
a79bf66
<!--
* @Date: 2024-10-18 12:06:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-1
1-05 10:15:58
* @LastEditTime: 2024-1
2-04 18:16:02
* @FilePath: /hager/src/views/news/detail.vue
* @Description: 文件描述
-->
...
...
@@ -32,12 +32,23 @@ import hagerBox from '@/components/common/hagerBox';
import { getNewsDetailAPI } from "@/api/hager.js";
export default {
// TAG:配置页面meta和标题信息
metaInfo () {
return {
meta: [
{ name: 'keyword', content: this.keyword },
{ name: 'description', content: this.description
}]
}
},
components: { hagerBox },
mixins: [mixin.init],
data () {
return {
title: '获奖+1!海格电气荣获2023酒店文旅优秀国际标杆品牌',
content: '',
keyword: '',
description: '',
}
},
async mounted () {
...
...
@@ -45,6 +56,8 @@ export default {
if (code) {
this.title = data.post_title;
this.content = data.product_advantages;
this.keyword = data.post_keyword;
this.description = data.post_description;
}
},
methods: {
...
...
src/views/product/detail.vue
View file @
a79bf66
...
...
@@ -148,6 +148,15 @@ import { MessageBox, Message, Loading } from 'element-ui';
import { getProductInfoAPI, getUserInfoAPI, downEmailAPI, downZipAPI } from "@/api/hager.js";
export default {
// TAG:配置页面meta和标题信息
metaInfo () {
return {
meta: [
{ name: 'keyword', content: this.keyword },
{ name: 'description', content: this.description
}]
}
},
components: { hagerBox, hagerCarousel, hagerH1 },
mixins: [mixin.init],
data () {
...
...
@@ -160,6 +169,8 @@ export default {
is_login: false,
is_enable: true, // 产品是否有效
is_file: false, // 是否有产品资料
keyword: '',
description: '',
}
},
computed: {
...
...
@@ -245,6 +256,8 @@ export default {
const { code, data } = await getProductInfoAPI( { id: this.$route.query.id });
if (code) {
this.info = data;
this.keyword = data.post_keyword;
this.description = data.post_description;
// 产品是否可用
this.is_enable = data.product_status === 'publish' ? true : false;
if (this.info.file?.img) {
...
...
src/views/solution/case.vue
View file @
a79bf66
<!--
* @Date: 2024-10-18 12:06:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-04 11:
18:56
* @LastEditTime: 2024-12-04 11:
42:11
* @FilePath: /hager/src/views/solution/case.vue
* @Description: 文件描述
-->
...
...
@@ -101,6 +101,15 @@ import hagerH1 from '@/components/common/hagerH1.vue';
import { getSolutionDetailAPI } from "@/api/hager.js";
export default {
// TAG:配置页面meta和标题信息
metaInfo () {
return {
meta: [
{ name: 'keyword', content: this.keyword },
{ name: 'description', content: this.description
}]
}
},
components: { hagerBox },
mixins: [mixin.init],
data () {
...
...
@@ -142,6 +151,8 @@ export default {
top_banner: '',
text_img: '',
case_img: [],
keyword: '',
description: '',
}
},
computed: {
...
...
@@ -161,6 +172,8 @@ export default {
this.top_banner = this.success_info.file?.top_img ? this.success_info.file?.top_img[0]['value'] : '';
this.text_img = data.file?.left_img ? data.file?.left_img[0]['value'] : '';
this.case_img = data.file?.img_list ? data.file?.img_list : [];
this.keyword = data.post_keyword;
this.description = data.post_description;
}
this.$nextTick(() => {
...
...
Please
register
or
login
to post a comment