Commit 10b4ef9b15fda21af1ee921f65a9ba3269b3f45f

Authored by wangfan
1 parent f2a37b5f

日历插件

... ... @@ -61,10 +61,6 @@
]
},
"plugins": {
"calendar": {
"version": "1.1.3",
"provider": "wx92c68dae5a8bb046"
},
"bmCalendar": {
"version": "1.2.0",
"provider": "wx23a9cef3522e4f7c"
... ...
... ... @@ -224,60 +224,8 @@
opacity:1;
}
/**
*/
.calendar-mask{
position: fixed;
z-index: 99;
width: 100%;
height: 100%;
left:0;
top:0;
background-color: rgba(0,0,0,.5);
}
.calendar {
background-color: #fefefe;
position: absolute;
bottom: 0;
width: 100%;
height: 720rpx;
}
.calendar-header{
background: #199095 ;
color: #fff;
}
.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;
position: absolute;
bottom: 10rpx; right: 60rpx;
}
@import "common/calendar.wxss";
... ...
... ... @@ -45,11 +45,10 @@ Page({
}
//this.sellerid=opt.seller_id ? opt.seller_id : util.cache('sellerid');
let timePickerArray= await bookOrder.getDayTimeSpace();
let nt=new Date()/1000;
let speciallist=[
{ date: util.unixtoTime(nt,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(nt+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(nt+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
{ date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
];
this.setData({
sellerid:this.sellerid,
... ...
... ... @@ -104,17 +104,6 @@ page{
background-color:#199095;
color: #FEFEFE;
}
.calendar-mask{
position: fixed;
z-index: 99;
width: 100%;
height: 100%;
left:0;
top:0;
background-color: rgba(0,0,0,.5);
}
.exportFile{
font-size: 26rpx;
color:#353535;
... ... @@ -125,46 +114,5 @@ page{
margin: 0 auto 8rpx;
}
.calendar {
background-color: #fefefe;
position: absolute;
bottom: 0;
width: 100%;
height: 720rpx;
}
.calendar-header{
background: #199095 ;
color: #fff;
}
.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;
position: absolute;
bottom: 10rpx; right: 60rpx;
}
\ No newline at end of file
@import "common/calendar.wxss";
\ No newline at end of file
... ...
... ... @@ -20,6 +20,10 @@ Page({
regions:[],
regions_active:'',
time:-1,
speciallist:[],
calendar:{
nextNum:0,
},
},
regions:[],
sellerid:0,
... ... @@ -35,9 +39,15 @@ Page({
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
let timePickerArray= await bookOrder.getDayTimeSpace();
let speciallist=[
{ date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
];
this.setData({
dateStr:dateStr,
timePickerArray:timePickerArray,
speciallist:speciallist,
})
},
... ... @@ -91,13 +101,13 @@ Page({
console.log(this.data.calendarMask)
},
dateChange(event){
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({
... ... @@ -208,5 +218,20 @@ Page({
this.regions=res.data[0];
this.getbooklist();
})
}
},
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
... ...
... ... @@ -5,7 +5,7 @@
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"calendar": "plugin://calendar/calendar",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"formids":"/components/formids/formids"
}
... ...
... ... @@ -54,13 +54,29 @@
<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="{{false}}"
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"
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>
... ...
... ... @@ -38,31 +38,9 @@
}
.calendar-mask{
position: fixed;
z-index: 99;
width: 100%;
height: 100%;
left:0;
top:0;
background-color: rgba(0,0,0,.5);
}
.calendar {
background-color: #eeedff;
padding-top: 10px;
position: absolute;
bottom: 0;
width: 100%;
z-index: 999;
}
.calendar-header{
font-size: large; /*修改了标题文字和按钮的大小*/
color: #605eac; /*修改了标题文字和按钮的颜色*/
}
.calendar-board {
background-color: #dddcff;
color: white;
}
@import "common/calendar.wxss";
.disks{
width: 100%;
... ...
... ... @@ -8,7 +8,7 @@
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.3.2",
"libVersion": "2.4.0",
"appid": "wxd3dc4206c76f14fc",
"projectname": "xcx-book",
"isGameTourist": false,
... ...