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 @@ 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 @@ @@ -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; + } } }