Commit f3f3f4442964c8da097ab563c37007c2bfab8fdd

Authored by vking
1 parent 1dd9aa8d

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

@@ -16,7 +16,7 @@ Component({ @@ -16,7 +16,7 @@ Component({
16 this.setData({ 16 this.setData({
17 showYearMonth:this.getshowmonth(this.data.date) 17 showYearMonth:this.getshowmonth(this.data.date)
18 }) 18 })
19 - this.triggerEvent('selectdate',{date:this.data.date,action:'defalut'}) 19 + this.hasNowInToday();
20 this.getweeklist(); 20 this.getweeklist();
21 this.getdaylist(); 21 this.getdaylist();
22 this.getFullDate(); 22 this.getFullDate();
@@ -25,6 +25,27 @@ Component({ @@ -25,6 +25,27 @@ Component({
25 25
26 }, 26 },
27 methods:{ 27 methods:{
  28 + //判断是否过了今天时段,并设置date
  29 + hasNowInToday(){
  30 + let daily=this.data.seller.daily
  31 + let maxDur='';
  32 + Object.keys(daily).forEach(k=>{
  33 + let dur=daily[k].split('-')
  34 + if(dur[1]>maxDur){
  35 + maxDur=dur[1]
  36 + }
  37 + })
  38 + let nowDur=util.unixtoTime(new Date()/1000,'HH:II')
  39 + let nowDate=this.data.date
  40 + if(nowDur>maxDur){
  41 + nowDate=util.unixtoTime(new Date()/1000+86400,'YYYY-MM-DD')
  42 + this.setData({
  43 + date:nowDate
  44 + })
  45 + }
  46 + //console.log('hasNowInToday',maxDur)
  47 + this.triggerEvent('selectdate',{date:nowDate,action:'defalut'})
  48 + },
28 //获取当前选中日期年月 49 //获取当前选中日期年月
29 getshowmonth(selecteddate){ 50 getshowmonth(selecteddate){
30 let datearr=selecteddate.split('-'); 51 let datearr=selecteddate.split('-');
@@ -73,23 +73,23 @@ @@ -73,23 +73,23 @@
73 } 73 }
74 }, 74 },
75 "condition": { 75 "condition": {
76 - "plugin": { 76 + "search": {
77 "current": -1, 77 "current": -1,
78 "list": [] 78 "list": []
79 }, 79 },
80 - "game": {  
81 - "currentL": -1, 80 + "conversation": {
  81 + "current": -1,
82 "list": [] 82 "list": []
83 }, 83 },
84 - "gamePlugin": { 84 + "plugin": {
85 "current": -1, 85 "current": -1,
86 "list": [] 86 "list": []
87 }, 87 },
88 - "search": {  
89 - "current": -1, 88 + "game": {
  89 + "currentL": -1,
90 "list": [] 90 "list": []
91 }, 91 },
92 - "conversation": { 92 + "gamePlugin": {
93 "current": -1, 93 "current": -1,
94 "list": [] 94 "list": []
95 }, 95 },
@@ -621,7 +621,7 @@ @@ -621,7 +621,7 @@
621 "id": 71, 621 "id": 71,
622 "name": "pages/reserve/detail", 622 "name": "pages/reserve/detail",
623 "pathName": "pages/reserve/detail", 623 "pathName": "pages/reserve/detail",
624 - "query": "id=1001&_activeTab=reserve&date=2020-02-16&pnum=6", 624 + "query": "id=80&activeTab=reserve&_date=2020-02-16&_pnum=6",
625 "scene": null 625 "scene": null
626 }, 626 },
627 { 627 {