From fa8e1af40470596d4b1d5716b98356175d9f8950 Mon Sep 17 00:00:00 2001 From: chutingting Date: Sat, 13 Jan 2024 17:16:53 +0800 Subject: [PATCH] fixbug --- src/api/article.js | 13 ++- src/components/hotNews/index.vue | 9 +- src/views/aigc/index.vue | 1 + src/views/article/details.vue | 170 +++++++------------------------ src/views/article/list.vue | 110 ++------------------ src/views/article/right.vue | 133 ++++++++++++++++++++++++ src/views/information/index.vue | 7 +- src/views/metadaily/index.vue | 9 +- 8 files changed, 200 insertions(+), 252 deletions(-) create mode 100644 src/views/article/right.vue diff --git a/src/api/article.js b/src/api/article.js index 989c3d6..ec67bcc 100644 --- a/src/api/article.js +++ b/src/api/article.js @@ -22,4 +22,15 @@ export const videoListApi = (data) => { url: `/car/videoList`, params: data }) - } +} + +/** + * 详情 + * @returns request + */ +export const detailApi = (id) => { + return request({ + method: 'GET', + url: `/news/detail?id=${id}` + }) +} \ No newline at end of file diff --git a/src/components/hotNews/index.vue b/src/components/hotNews/index.vue index 5c37a21..e630301 100644 --- a/src/components/hotNews/index.vue +++ b/src/components/hotNews/index.vue @@ -1,6 +1,6 @@ + + \ No newline at end of file diff --git a/src/views/information/index.vue b/src/views/information/index.vue index 42fc623..35fe111 100644 --- a/src/views/information/index.vue +++ b/src/views/information/index.vue @@ -34,7 +34,7 @@ MORE+
-
+
{{ item.title }} @@ -89,9 +89,8 @@ export default { handleChange(newIndex) { this.currentIndex = newIndex; }, - routerToarticleDetails (value) { - localStorage.setItem('article', value) - this.$router.push({ path: '/articleDetails' }) + detail (item) { + this.$router.push({ path: '/articleDetails', query: {id : item.id } }) }, routerTo () { this.$router.push({ path: '/articleList', query: {type : 2 } }) diff --git a/src/views/metadaily/index.vue b/src/views/metadaily/index.vue index a3fc689..8f55697 100644 --- a/src/views/metadaily/index.vue +++ b/src/views/metadaily/index.vue @@ -18,7 +18,7 @@ MORE+
-
+
{{ item.title }} @@ -43,7 +43,7 @@ MORE+
-
+
{{ item.title }} @@ -89,9 +89,8 @@ export default { this.getzixun() }, methods: { - routerToarticleDetails (value) { - localStorage.setItem('article', value) - this.$router.push({ path: '/articleDetails' }) + detail (item) { + this.$router.push({ path: '/articleDetails', query: {id : item.id } }) }, routerTo (type) { this.$router.push({ path: '/articleList', query: { type: 3, subType: type }}) // eslint-disable-line