This commit is contained in:
@jyuhsin
2025-03-21 18:19:24 +08:00
parent ef30224867
commit d7faabdcc8
3 changed files with 18 additions and 8 deletions
@@ -438,8 +438,7 @@ layout("/mobile/platform.html"){
},
//获取最新的一个工作日设为当前时间
getLatestWorkDay() {
//1.首先判断今天是不是工作日
const weekNum = moment().day()
/*const weekNum = moment().day()
let selectDate = null
if (weekNum === 0) {
//周日
@@ -449,15 +448,23 @@ layout("/mobile/platform.html"){
selectDate = moment().add(2, 'd')
} else {
selectDate = moment()
}
return selectDate
}*/
let today = moment().format('YYYY-MM-DD')
let d
do {
d = moment(today).day()
if(!this.site.openWeekTime.includes(d)) {
today = moment(today).add(1, 'd')
}
} while (!this.site.openWeekTime.includes(d))
return today
}
},
async created() {
this.site_id = getQueryString('id')
this.selectDate = this.getLatestWorkDay()
await this.getReserve()
await this.onLoad()
this.selectDate = this.getLatestWorkDay()
this.setWeekList(this.selectDate)
await this.getMyReservation()