diff --git a/components/recommend/index.vue b/components/recommend/index.vue
index 7a518e4..68efb0f 100644
--- a/components/recommend/index.vue
+++ b/components/recommend/index.vue
@@ -1,11 +1,11 @@
-
+
-
+
@@ -34,6 +34,22 @@
+
+
+
+ 更多资讯
+
+
+
+
+
+
+
+ {{item.title}}
+ {{item.synopsis}}
+
+
+
@@ -65,6 +81,9 @@
import {
toLogin
} from '@/libs/login.js';
+ import {
+ getArticleList
+ } from "@/api/api.js";
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
HTTP_REQUEST_URL
@@ -119,11 +138,12 @@
desc: '特色农副',
val: 4
}],
- currTabs: 1
+ currTabs: 1,
+ list: []
};
},
mounted() {
-
+ this.getArticleList();
},
methods: {
changeTab(e) {
@@ -137,6 +157,14 @@
Toast('暂未开放')
}
})
+ },
+ getArticleList(){
+ getArticleList(20,{
+ page: 1,
+ limit: 3
+ }).then(res=>{
+ this.list = res.data.list;
+ })
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
@@ -189,17 +217,14 @@
// 里海云仓 供销云市场 名优特产
.nav {
display: flex;
- margin-bottom: 40rpx;
+ justify-content: space-between;
+ margin-bottom: 20rpx;
.nav-item {
- width: 33.3%;
+ width: 227rpx;
overflow: hidden;
border-radius: 20rpx;
- &:not(:nth-last-child(1)) {
- margin-right: 12rpx;
- }
-
.nav-item-up {
width: 100%;
height: 198rpx;
@@ -237,6 +262,7 @@
justify-content: space-between;
align-items: center;
margin: 0 -20rpx 30rpx;
+ padding-top: 20rpx;
.tabs-item {
width: 23%;
@@ -284,4 +310,54 @@
/deep/.looming-gray {
border-radius: 16rpx 16rpx 0 0;
}
+
+ .information{
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 20rpx;
+
+ .nav-item {
+ width: 227rpx;
+ overflow: hidden;
+ border-radius: 20rpx;
+ position: relative;
+
+
+ .nav-item-up {
+ width: 100%;
+ height: 227rpx;
+
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+
+ .nav-item-down {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 227rpx;
+ padding: 8rpx 2rpx 8rpx 14rpx;
+ background: rgba(0, 0, 0, 0.4);
+
+ .nav-item-down-title {
+ font-weight: 500;
+ font-size: 26rpx;
+ color: #FFFFFF;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+
+ .nav-item-down-desc {
+ font-size: 20rpx;
+ color: #FFFFFF;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 62fe083..b6aa7ec 100644
--- a/pages.json
+++ b/pages.json
@@ -115,13 +115,15 @@
{
"path": "pages/news_list/index",
"style": {
- "navigationBarTitleText": "资讯"
+ "navigationBarTitleText": "资讯消息"
}
},
{
"path": "pages/news_details/index",
"style": {
- "navigationBarTitleText": "资讯详情"
+ "navigationBarTitleText": ""
+
+ // "navigationBarTitleText": "资讯详情"
}
},
{
diff --git a/pages/news_details/index.vue b/pages/news_details/index.vue
index b42b335..1e4bddb 100644
--- a/pages/news_details/index.vue
+++ b/pages/news_details/index.vue
@@ -30,7 +30,8 @@
-
+
+
diff --git a/pages/news_list/index.vue b/pages/news_list/index.vue
index c960cf3..58f6433 100644
--- a/pages/news_list/index.vue
+++ b/pages/news_list/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -13,7 +13,7 @@
-
+
@@ -25,14 +25,24 @@
-
-
- {{item.title}}
- {{item.create_time}}
-
-
-
-
+
+
+
+
+ {{item.title}}
+ {{URLdate(item.create_time)}}
+
+
+
+
+ {{item.title}}
+ {{URLdate(item.create_time)}}
+
+
+
+
+
@@ -43,7 +53,7 @@
暂无新闻信息~
-
+
@@ -80,7 +90,7 @@
navList: [],
active: 0,
page: 1,
- limit: 8,
+ limit: 20,
status: false,
scrollLeft: 0
};
@@ -92,11 +102,15 @@
/**
* 生命周期函数--监听页面显示
*/
- onLoad: function() {
- this.getArticleCate();
- this.status = false;
- this.page = 1;
- this.articleList = [];
+ onLoad: function(options) {
+ this.status = false;
+ this.page = 1;
+ this.articleList = [];
+ if(options.type) {
+ this.active=options.type;
+ this.getCidArticle();
+ }
+ else this.getArticleCate();
},
/**
* 页面上拉触底事件的处理函数
@@ -154,14 +168,27 @@
this.status = false;
this.getCidArticle();
}
- }
+ },
+ URLdate(date){
+ // 创建一个 Date 对象来获取当前时间
+ const currentDate = new Date(date);
+
+ // 获取年、月、日
+ const year = currentDate.getFullYear();
+ const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1并补零
+ const day = String(currentDate.getDate()).padStart(2, '0');
+
+ // 格式化成 xxxx年xx月xx日 的格式
+ const formattedDate = `${year}年${month}月${day}日`;
+ return formattedDate;
+ }
}
}