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,