|
|
|
Component({
|
|
|
|
properties:{
|
|
|
|
timedur:Object
|
|
|
|
timedur:Object,
|
|
|
|
time:{
|
|
|
|
type:String,
|
|
|
|
value:''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
attached(){
|
|
|
|
this.getdurlist();
|
|
|
|
},
|
|
|
|
ready(){
|
|
|
|
|
|
|
|
if(this.data.time==''){
|
|
|
|
this.setData({
|
|
|
|
time:this.data.durlist[0].showdur
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.triggerEvent('selecttime',{time:this.data.time,action:'defalut'})
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
selecttime(e){
|
|
|
|
const target=e.currentTarget.dataset;
|
|
|
|
|
|
|
|
this.triggerEvent('selecttime',{time:target.time,action:'click'})
|
|
|
|
},
|
|
|
|
//获得可订时间段
|
|
|
|
getdurlist(){
|
|
...
|
...
|
@@ -30,9 +39,7 @@ Component({ |
|
|
|
starttime=Math.round(currenttimemark)
|
|
|
|
}
|
|
|
|
for(let i=starttime;i<=endtime;i+=0.5){
|
|
|
|
let obj={
|
|
|
|
timemark:i
|
|
|
|
}
|
|
|
|
let obj={};
|
|
|
|
if(i%1==0){
|
|
|
|
obj.showdur=i<10 ? '0'+i+':00' : i+':00'
|
|
|
|
}else{
|
...
|
...
|
|