From 41e18e140262fe64150331083f5c3083ccd98de1 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Fri, 5 Sep 2025 12:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index c80d21a..67a54de 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -500,6 +500,28 @@ this.calendarItem = res.data[0] }) }, + getNowTime(time, type) { + var date = time, + year = date.getFullYear(), + month = date.getMonth() + 1, + day = date.getDate(), + hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(), + minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(), + second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); + month >= 1 && month <= 9 ? (month = "0" + month) : ""; + day >= 0 && day <= 9 ? (day = "0" + day) : ""; + if (type == 1) { + if(uni.getSystemInfoSync().platform == 'ios'){ + var timer = year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second; + }else{ + var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; + } + } else { + var timer = year + '/' + month + '/' + day; + } + + return timer; + }, // 更改热门推荐类型 changeType(index) { this.typeIndex = index @@ -511,7 +533,7 @@ getHotList() { if(this.typeIndex == 1) { this.Post({ - date: '', + date: this.getNowTime(new Date()), offset: this.hotList.length, limit:this.limit, type_id: 7,