Commit f3f3f4442964c8da097ab563c37007c2bfab8fdd

Authored by vking
1 parent 1dd9aa8d

判断是否过了今天时段,并设置date

... ... @@ -16,7 +16,7 @@ Component({
this.setData({
showYearMonth:this.getshowmonth(this.data.date)
})
this.triggerEvent('selectdate',{date:this.data.date,action:'defalut'})
this.hasNowInToday();
this.getweeklist();
this.getdaylist();
this.getFullDate();
... ... @@ -25,6 +25,27 @@ Component({
},
methods:{
//判断是否过了今天时段,并设置date
hasNowInToday(){
let daily=this.data.seller.daily
let maxDur='';
Object.keys(daily).forEach(k=>{
let dur=daily[k].split('-')
if(dur[1]>maxDur){
maxDur=dur[1]
}
})
let nowDur=util.unixtoTime(new Date()/1000,'HH:II')
let nowDate=this.data.date
if(nowDur>maxDur){
nowDate=util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')
this.setData({
date:nowDate
})
}
//console.log('hasNowInToday',maxDur)
this.triggerEvent('selectdate',{date:nowDate,action:'defalut'})
},
//获取当前选中日期年月
getshowmonth(selecteddate){
let datearr=selecteddate.split('-');
... ...
... ... @@ -73,23 +73,23 @@
}
},
"condition": {
"plugin": {
"search": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"conversation": {
"current": -1,
"list": []
},
"gamePlugin": {
"plugin": {
"current": -1,
"list": []
},
"search": {
"current": -1,
"game": {
"currentL": -1,
"list": []
},
"conversation": {
"gamePlugin": {
"current": -1,
"list": []
},
... ... @@ -621,7 +621,7 @@
"id": 71,
"name": "pages/reserve/detail",
"pathName": "pages/reserve/detail",
"query": "id=1001&_activeTab=reserve&date=2020-02-16&pnum=6",
"query": "id=80&activeTab=reserve&_date=2020-02-16&_pnum=6",
"scene": null
},
{
... ...