Commit 2812ffcc06d4171a2ad3d763437a3837f0fb0391

Authored by wangfan
1 parent 298cb520

日历插件

... ... @@ -64,6 +64,10 @@
"calendar": {
"version": "1.1.3",
"provider": "wx92c68dae5a8bb046"
},
"bmCalendar": {
"version": "1.2.0",
"provider": "wx23a9cef3522e4f7c"
}
},
"debug": true
... ...
... ... @@ -59,6 +59,14 @@ Page({
timePickerMask:false,
pnumInputFocus:false,
pageMarginBottom:0,
speciallist:[
{ date: '2018-11-21', background: '', text:'今 天' },
{ date: '2018-11-22', background: '', text: '明 天' },
{ date: '2018-11-23', background: '', text: '后 天' },
],
calendar:{
nextNum:0,
},
},
/**
* 生命周期函数--监听页面加载
... ... @@ -390,13 +398,14 @@ Page({
},
dateChange(event){
console.log(event);
let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day)
//let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day)
let cktime=util.timetouUnix(event.detail.date)
let day0=parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);
if(cktime<day0){
util.toast('请选择有效日期','none');
return;
}
let clickDay = event.detail.day;
let clickDay = event.detail.date.substr(8,2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
... ... @@ -542,5 +551,20 @@ Page({
scrollTop: rect.bottom
})
}).exec()
}
},
gotoday(e){
this.setData({
[`calendar.nextNum`]:0
})
},
nextMonth(e){
this.setData({
[`calendar.nextNum`]:this.data.calendar.nextNum+1
})
},
prevMonth(e){
this.setData({
[`calendar.nextNum`]:this.data.calendar.nextNum-1
})
},
})
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"searchList":"/components/searchlist/searchlist",
"calendar": "plugin://calendar/calendar",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"formids":"/components/formids/formids"
}
... ...
... ... @@ -203,14 +203,30 @@
<view class="calendar-mask" bindtap="calendarClose"
style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">
<view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">
<calendar weeks-type="cn" catchtap="catchtap"
start-date="2018-09"
days-color="{{dayStyle}}"
binddayClick="dateChange"
active-type="rounded"
<calendar catchtap="catchtap"
isTodaybtn="{{false}}" todaybtn_txt="回到今天"
custom switchover="{{['◀上一月','下一月▶']}}"
active-coloro="active-coloro"
active-colort="active-colort"
speciallist="{{speciallist}}"
txt_style="txt-style"
calendar-style="calendar"
header-style="calendar-header"
board-style="calendar-board"></calendar>
weektitle-style="weektitle-style"
restcolor-style="restcolor-style"
appear
txt_type="cn-d"
datefont-style="datefont-style"
todaybtn-style="todaybtn-style"
bindnextMonth="nextMonth"
bindprevMonth="prevMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
prev="{{calendar.nextNum>0}}"
></calendar>
</view>
</view>
<view class="calendar-mask" bindtap="calendarClose"
... ...
... ... @@ -236,20 +236,49 @@
background-color: rgba(0,0,0,.5);
}
.calendar {
background-color: #eeedff;
padding-top: 10px;
background-color: #fefefe;
position: absolute;
bottom: 0;
width: 100%;
}
.calendar-header{
font-size: large; /*修改了标题文字和按钮的大小*/
color: #605eac; /*修改了标题文字和按钮的颜色*/
background: #199095 ;
color: #fff;
}
.calendar-board {
background-color: #dddcff;
color: white;
.weektitle-style {
background-color: #199095;
color: #4fcfcf;
}
.restcolor-style{
color:orange !important;
}
.active-coloro {
color: #fff!important;
background: #199095;
}
.active-colort {
color: #fff!important;
background: #b8d5eb;
}
.txt-style{
margin-top: -24rpx;
color: #199095;
}
.datefont-style{
color: #199095;
}
.todaybtn-style{
line-height: 30rpx!important;
width: 60rpx!important;
height: 60rpx!important;
padding: 20rpx;
color: #fff!important;
background-color: #199095!important;
}
.placeholder-class-pnum{
color:#199095;
font-size: 34rpx;
... ...