
1.wxml
<van-calendar
poppable="{{ false }}"
show-confirm="{{ false }}"
formatter="{{ formatter }}"
class="calendar"
show-title="{{ false }}"
show-subtitle="{{ false }}"
>
</van-calendar>
2.js:
onLoad(options){
this.CalendarShow();
}
CalendarShow() {
let _this=this;
var data = {};
data.formatter = this.dayFormatter;
// 渲染日历
this.setData({formatter: function (day) {
let month = day.date.getMonth() + 1;
let date = day.date.getDate();
for(let i of list){
if(month ===i.month){
if (date === i.day) {
day.bottomInfo = '余票'+i.stock+'张';
}
}
};
return day;
} })
},
网友评论