BGCalendar
微信小程序,選擇酒店入住離店時(shí)間的控件
效果圖
image
使用方法
-
//事件處理函數(shù)
-
bindViewTap: function() {
-
var that = this;
-
//傳遞入住離店時(shí)間
-
var startDate = that.data.date;
-
var endDate = that.data.tomorrow;
-
console.log(startDate);
-
console.log(endDate);
-
wx.navigateTo({
-
url: '../calender/index?startDate=' + startDate + "&endDate=" + endDate
-
})
-
},
-
onShow:function() {
-
//接收入住離店時(shí)間
-
var startDate = this.data.startDate;
-
var endDate = this.data.endDate;
-
console.log(startDate);
-
console.log(endDate);
-
var date = Data.formatDate(new Date(), "yyyy-MM-dd");
-
var tomorrow1 = new Date();
-
tomorrow1.setDate((new Date()).getDate() + 1);
-
var tomorrow = Data.formatDate(new Date(tomorrow1), "yyyy-MM-dd");
-
if (startDate == null) {
-
startDate = date;
-
endDate = tomorrow;
-
}
-
this.setData({
-
date: startDate,
-
tomorrow: endDate
-
});
|