Vue.component('appoint-time', {
template: '
',
props: ["visittime", "visitindex"],
data: function() {
return {
judge: false,
timeIndex: null
}
},
mounted: function() {
},
methods: {
changeTime: function(index) {
this.timeIndex = index
this.judge = true
this.$emit("changetime", this.visittime[index])
},
handteTime: function(data) {
var dateTime = data.date+"";
var date= dateTime.split(" ")[0];
var week = getWeek(date);
var riqi = date.split("/");
riqi = this.add0(riqi[1]) + "月" + this.add0(riqi[2]) + "日";
var isMo = data.time;
if(isMo =="a"){
isMo ="上午";
}else{
isMo ="下午";
}
return " " + riqi + " " + week + isMo + " "
},
add0: function(num) {
if(num < 10) {
return '0' + num
} else {
return num
}
}
}
})