diff --git a/package.json b/package.json index 0d0ea22..228543a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "script-ext-html-webpack-plugin": "^2.1.5", "vue": "^2.6.11", "vue-i18n": "^8.26.7", + "vue-meta": "^2.4.0", "vue-router": "^3.2.0" }, "devDependencies": { diff --git a/public/index.html b/public/index.html index 73928cd..8bbac95 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - 艺鹏瓷砖|广东祥睿陶瓷有限公司 + 蒙彼利瓷砖 | 广东蒙彼利陶瓷有限公司 diff --git a/src/views/news/detail.vue b/src/views/news/detail.vue index 0e61916..996688c 100644 --- a/src/views/news/detail.vue +++ b/src/views/news/detail.vue @@ -15,15 +15,20 @@
分享到: - + - +
-
+
+
+ {{ detail_title }} +
+
+
@@ -35,24 +40,31 @@ import {getArticleInfo} from "@/api"; export default { name: "detail", + metaInfo() { + return { + title: this.detail_title + " | " + localStorage.getItem("corporate_name") + }; + }, props: { newsId: Number, classIndex: Number }, data() { return { - tabs_title: '公司新闻', - htmlStr: '', - } + tabs_title: "公司新闻", + htmlStr: "", + detail_title: "" + }; }, mounted() { - if(this.classIndex==1){ - this.tabs_title='行业动态' - }else if(this.classIndex==2){ - this.tabs_title='瓷砖百科' + if (this.classIndex == 1) { + this.tabs_title = "行业动态"; + } else if (this.classIndex == 2) { + this.tabs_title = "瓷砖百科"; } getArticleInfo(this.newsId).then(res => { - this.htmlStr=res.data.articleinfo.content + this.detail_title = res.data.articleinfo.title; + this.htmlStr = res.data.articleinfo.content; }); }, methods: { @@ -81,26 +93,29 @@ export default { // "&summary=" + // this.sysInfo ); - }, + } } -} +}; diff --git a/src/views/news/index.vue b/src/views/news/index.vue index bf340d0..7cfad63 100644 --- a/src/views/news/index.vue +++ b/src/views/news/index.vue @@ -29,6 +29,11 @@ import {getArticleList} from "@/api"; export default { name: "index", + metaInfo() { + return { + title:'新闻资讯 | '+localStorage.getItem('corporate_name') + }; + }, components: {Detail, PicturesBox, Pagination, ProductsTabsItem}, data() { return { @@ -71,6 +76,11 @@ export default { this.$refs.ProductsTabsItem.activeName = i + ""; } } + if(this.$route.query.newsId!==undefined){ + this.newsId = this.$route.query.newsId; + this.showDetail = true; + this.showImage = false; + } }, mounted() { if(this.$route.query.menuDetail){ @@ -110,11 +120,30 @@ export default { this.classIndex = parseInt(tab.index); if (tab.index == 0) { this.getArticleList(5, this.page, this.limit); + this.$router.push({ + path: "/news", + query: { + menu: 5 + } + }); } else if (tab.index == 1) { this.getArticleList(6, this.page, this.limit); + this.$router.push({ + path: "/news", + query: { + menu: 6 + } + }); } else if (tab.index == 2) { this.getArticleList(7, this.page, this.limit); + this.$router.push({ + path: "/news", + query: { + menu: 7 + } + }); } + }, //新闻分页 handleChangePage(value) { diff --git a/src/views/productsCenter/detail.vue b/src/views/productsCenter/detail.vue index 2a14476..3d96c03 100644 --- a/src/views/productsCenter/detail.vue +++ b/src/views/productsCenter/detail.vue @@ -10,12 +10,12 @@
- 产品名称:{{detailList.name}} + 产品名称:{{ detailList.name }}
-

产品分类:{{classifyName}}

-

适用空间:{{detailList.space}}

-

所属风格:{{detailList.style}}

+

产品分类:{{ classifyName }}

+

适用空间:{{ detailList.space }}

+

所属风格:{{ detailList.style }}

@@ -44,10 +44,10 @@
同类产品推荐
@@ -63,79 +63,107 @@