Browse Source

活动日期

master
jiazhipeng 2 months ago
parent
commit
41e18e1402
  1. 24
      pages/index/index.vue

24
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,

Loading…
Cancel
Save