|
...
|
...
|
@@ -35,6 +35,9 @@ Component({ |
|
|
|
methods:{
|
|
|
|
selecttime(e){
|
|
|
|
const target=e.currentTarget.dataset;
|
|
|
|
this.setData({
|
|
|
|
time:target.time
|
|
|
|
})
|
|
|
|
this.triggerEvent('selecttime',{time:target.time,action:'click'})
|
|
|
|
},
|
|
|
|
//获得默认所有可订时间段
|
|
...
|
...
|
@@ -70,14 +73,24 @@ Component({ |
|
|
|
list:[]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
let time='',current=0;
|
|
|
|
durlist.forEach((v,i)=>{
|
|
|
|
let thiscurrent=Math.floor(i/5);
|
|
|
|
duritem[thiscurrent].list.push(v)
|
|
|
|
duritem[thiscurrent].list.push(v);
|
|
|
|
if(this.data.time==''){
|
|
|
|
time=duritem[0].list[0].showdur
|
|
|
|
}else{
|
|
|
|
if(this.data.time==v.showdur){
|
|
|
|
time=v.showdur;
|
|
|
|
current=thiscurrent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
console.log(this.data.time);
|
|
|
|
this.setData({
|
|
|
|
durlist:duritem,
|
|
|
|
time:durlist.length>0 ? duritem[0].list[0].showdur : '',
|
|
|
|
current:0
|
|
|
|
time:time,
|
|
|
|
current:current
|
|
|
|
})
|
|
|
|
this.triggerEvent('selecttime',{time:this.data.time,action:'defalut'})
|
|
|
|
},
|
...
|
...
|
|