+
+
{{
item.year
}}
-
- -
-
-
{{ item.title }}{{ item.title }}
-
[{{ $moment(item.publishTime).format('YYYY - HH - DD') }}]
+
+
+ -
+
+
{{ item.title }}
+
[{{ $moment(item.publishTime).format('YYYY - HH - DD') }}]
+
+
+
+
+
+
+
+
+
![]()
+
+
发表时间: {{ $moment(item.publishTime).format('YYYY-HH-DD') }}
+
作者: {{ item.author }}
+
-
-
+
+
-
@@ -38,29 +58,28 @@ export default {
data() {
return {
yearList: [
- {
- year: 2020,
- },
- {
- year: 2021,
- },
{
year: 2022,
},
],
- year: '2020',
+ year: '2022',
};
},
watch: {
code(val) {
- this.getYear();
+ if (val !== 'search') {
+ this.getYear();
+ }
},
},
created() {
- this.getYear();
+ if (this.code !== 'search') {
+ this.getYear();
+ }
},
methods: {
onChange(pageNumber) {
+ console.log('pageNumber: ', pageNumber);
this.$emit('getData', pageNumber);
},
openPage(id) {
@@ -74,10 +93,14 @@ export default {
try {
const params = { showPage: this.code };
const res = await getCondition(params);
- console.log('res: ', res);
const { code, msg, data } = res.data;
if (code === 200) {
- this.yearList = data;
+ if (data && data[0]) {
+ this.yearList = data;
+ this.year = data[0].year;
+ } else {
+ this.year = '2022';
+ }
} else {
console.error(msg);
}
diff --git a/src/components/Location/Location.vue b/src/components/Location/Location.vue
index 7222207..00f64cf 100644
--- a/src/components/Location/Location.vue
+++ b/src/components/Location/Location.vue
@@ -7,8 +7,13 @@

您当前位置:
首页
-
> {{ titleName }}
-
> {{ titleTwo }}
+
+ > {{ titleName }}
+ > {{ titleTwo }}
+
+
+ > {{ title }}
+
@@ -350,6 +355,20 @@ export default {
},
],
},
+ {
+ title: '首页专题',
+ url: '/pile',
+ children: [
+ {
+ title: '光荣榜',
+ code: '9902',
+ },
+ {
+ title: '今天我出镜',
+ code: '9903',
+ },
+ ],
+ },
],
titleName: '',
titleTwo: '',
@@ -380,7 +399,26 @@ export default {
}
},
backFirst() {
- // this.$router.push('/');
+ this.$router.push('/');
+ },
+ backTitle() {
+ for (let i = 0; i < this.tabList.length; i++) {
+ const item = this.tabList[i];
+ if (item.children && item.children.length) {
+ for (let k = 0; k < item.children.length; k++) {
+ const itemC = item.children[k];
+ if (this.title === itemC.title && k !== 0) {
+ this.$router.push({
+ path: this.tabList[i].url,
+ query: {
+ code: item.children[0].code,
+ },
+ });
+ return;
+ }
+ }
+ }
+ }
},
},
};
diff --git a/src/components/RichText/Relevant.vue b/src/components/RichText/Relevant.vue
new file mode 100644
index 0000000..13ab6ab
--- /dev/null
+++ b/src/components/RichText/Relevant.vue
@@ -0,0 +1,38 @@
+
+
+
+ 相关新闻
+
+
+
>>{{ item.title }}
+
[{{ $moment(item.publishTime - 0).format('YYYY - MM - DD') }}]
+
+
+
+
+
diff --git a/src/components/RichText/RichText.vue b/src/components/RichText/RichText.vue
index 3dc95f7..da0330e 100644
--- a/src/components/RichText/RichText.vue
+++ b/src/components/RichText/RichText.vue
@@ -3,9 +3,9 @@
{{ richObj.title }}
-
{{ richObj.source }}
-
{{ richObj.author }}
-
{{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}
+
来源: {{ richObj.source }}
+
作者: {{ richObj.author }}
+
发表日期: {{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}
diff --git a/src/config/api.js b/src/config/api.js
index adba23a..ad87fa0 100644
--- a/src/config/api.js
+++ b/src/config/api.js
@@ -15,9 +15,13 @@ export const carouselQuery = params => axios.post(`${carousel}/query`, params);
// 官网首页列表查询
export const getContent = params =>
axios.get(
- `${content}/list?showPage=${params.showPage}&
- year=${params.year}&showType=${params.showType}&
- pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
+ `${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
+ );
+
+// 查询图片新闻列表
+export const getContentImg = params =>
+ axios.get(
+ `${content}/list?showPage=0201&showPage=0202&showPage=0203&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
);
// 官网内容详情查询
diff --git a/src/router/index.js b/src/router/index.js
index 338a784..4b83fc7 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -60,6 +60,18 @@ const routes = [
name: 'Department',
component: () => import('@/views/OtherPages/Department.vue'),
},
+ // 首页其它
+ {
+ path: '/pile',
+ name: 'PilePages',
+ component: () => import('@/views/OtherPages/PilePages.vue'),
+ },
+ // 搜索界面
+ {
+ path: '/search',
+ name: 'Search',
+ component: () => import('@/views/OtherPages/Search.vue'),
+ },
// // 关于我们界面
// {
// path: '/About/Introduce',
diff --git a/src/store/modules/home/actions.js b/src/store/modules/home/actions.js
index fd987f9..b663196 100644
--- a/src/store/modules/home/actions.js
+++ b/src/store/modules/home/actions.js
@@ -1,6 +1,6 @@
import axios from 'axios';
import { message } from 'ant-design-vue';
-import { getContent, getDetail } from 'config/api';
+import { getContent, getDetail, getContentImg } from 'config/api';
const actions = {
/**
@@ -22,6 +22,19 @@ const actions = {
message.error('提交失败');
}
},
+ async getContentImg({ commit, rootState }, param) {
+ try {
+ const res = await getContentImg(param);
+ const { data, code, msg } = res.data;
+ if (code === 200) {
+ return data;
+ } else {
+ message.error(msg);
+ }
+ } catch (error) {
+ message.error('提交失败');
+ }
+ },
/**
* 官网内容详情查询
* @param {any} commit
diff --git a/src/views/FirstPages/FirstPage.vue b/src/views/FirstPages/FirstPage.vue
index d5a2671..e33e1b4 100644
--- a/src/views/FirstPages/FirstPage.vue
+++ b/src/views/FirstPages/FirstPage.vue
@@ -62,6 +62,7 @@