From 2f8199108c5a1fbcbe6733064b0b393461d038df Mon Sep 17 00:00:00 2001
From: Hokin <568050969@qq.com>
Date: Sat, 27 Jul 2024 17:51:14 +0800
Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/index.js | 10 ++++---
src/views/HomeView.vue | 46 ++++++++++++++++++-----------
src/views/news.vue | 67 +++++++++++++++++++++++-------------------
src/views/project.vue | 3 +-
4 files changed, 74 insertions(+), 52 deletions(-)
diff --git a/src/api/index.js b/src/api/index.js
index 7ee89e6..cb85ca8 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -133,15 +133,17 @@ export function componyhonor(){
})
}
//首页企业新闻
-export function indexNews(){
+export function indexNews(params){
return request({
- url:'/article/enterpriseNews'
+ url:'/article/enterpriseNews',
+ params
})
}
//首页企业新闻
-export function indexInformation(){
+export function indexInformation(params){
return request({
- url:'/article/newsInformation'
+ url:'/article/newsInformation',
+ params
})
}
//首页新闻分类
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 9e2e4b3..ff3e10e 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -25,7 +25,7 @@
{{newscatagary[0]?.name}}
{{newscatagary[0]?.enName}}
-
+
{{newscatagary[0]?.describe}}
@@ -81,7 +81,7 @@
-
+
@@ -309,7 +309,10 @@ export default {
componyhonor().then((res)=>{
this.componydata=res.data
})
- indexInformation().then((res)=>{
+ NewCategary().then((res)=>{
+ this.newscatagary=res.data
+
+ indexInformation({articleType:res.data[1]?.name}).then((res)=>{
this.indexinfo=res.data
this.$nextTick(() => {
new Swiper('.swiper6', {
@@ -330,12 +333,13 @@ export default {
})
})
})
- indexNews().then((res)=>{
+ indexNews({articleType:res.data[0]?.name}).then((res)=>{
+ console.log(1111)
this.indexNew=res.data
})
- NewCategary().then((res)=>{
- this.newscatagary=res.data
})
+
+
// 创建交叉观察器实例
// this.observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
@@ -364,22 +368,30 @@ export default {
next(){
- if(this.textindex
=this.indexinfo.length-1){
+ this.textindex = 0
}else{
- this.textindex=0
+ this.textindex=this.textindex+1
}
-
-
},
back(){
-
- if(this.textindex>0){
- this.textindex=this.textindex-1
- }else{
- this.textindex=this.hydata.length-1
- }
+
+ // if(this.textindex>0){
+ // this.textindex=this.textindex-1
+ // }else{
+ // this.textindex=this.hydata.length-1
+ // }
+ this.textindex=this.textindex-1
+ if(this.textindex<0){
+ this.textindex= this.indexinfo.length-1
+ }
+
},
switchto() {
this.$router.push({
diff --git a/src/views/news.vue b/src/views/news.vue
index f3ab8ed..0135735 100644
--- a/src/views/news.vue
+++ b/src/views/news.vue
@@ -9,8 +9,8 @@
-
-
+
+
@@ -74,7 +74,7 @@