|
@@ -2,9 +2,9 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="date">
|
|
<view class="date">
|
|
|
<view class="head">
|
|
<view class="head">
|
|
|
- <view class="icon" @click="switch_month_week('prev',true)"><text class="iconfont icon-fanhui" /></view>
|
|
|
|
|
|
|
+ <view class="icon" @click="switch_month_week('prev',true)"><text class="iconfont icon-fanhui" :class="[currentMonth == nowMonth ? 'disabled' : '']" /></view>
|
|
|
<view class="title">{{nowYear+'年'+nowMonth+'月'}}</view>
|
|
<view class="title">{{nowYear+'年'+nowMonth+'月'}}</view>
|
|
|
- <view class="icon" @click="switch_month_week('next',true)"><text class="iconfont next icon-fanhui" /></view>
|
|
|
|
|
|
|
+ <view class="icon" @click="switch_month_week('next',true)"><text class="iconfont next icon-fanhui" :class="[currentMonth + 1 == nowMonth ? 'disabled' : '']" /></view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="date_dl" >
|
|
<view class="date_dl" >
|
|
|
<view class="dd" v-for="(item,index) in week" :key="index">{{item}}</view>
|
|
<view class="dd" v-for="(item,index) in week" :key="index">{{item}}</view>
|
|
@@ -77,6 +77,7 @@ export default {
|
|
|
next_date:'',
|
|
next_date:'',
|
|
|
nowYear:'',
|
|
nowYear:'',
|
|
|
nowMonth:'',
|
|
nowMonth:'',
|
|
|
|
|
+ currentMonth:'',
|
|
|
nowDay:'',
|
|
nowDay:'',
|
|
|
retract:true,
|
|
retract:true,
|
|
|
to_week_index:0,
|
|
to_week_index:0,
|
|
@@ -131,6 +132,9 @@ export default {
|
|
|
this.get_date();
|
|
this.get_date();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ let date = new Date();
|
|
|
|
|
+ this.currentMonth = date.getMonth() + 1;
|
|
|
|
|
+
|
|
|
this.doc_list_update();
|
|
this.doc_list_update();
|
|
|
this.update_month();
|
|
this.update_month();
|
|
|
this.open();
|
|
this.open();
|
|
@@ -366,6 +370,7 @@ export default {
|
|
|
this.nowDay = now_arr[2];
|
|
this.nowDay = now_arr[2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
this.set_to_day_all(item_index);
|
|
this.set_to_day_all(item_index);
|
|
|
|
|
|
|
|
this.nowTime = this.date_parse(`${item.date}`);
|
|
this.nowTime = this.date_parse(`${item.date}`);
|
|
@@ -415,6 +420,12 @@ export default {
|
|
|
return Date.parse(str.replace(/-(\d)(?!\d)/g, '-0$1'));
|
|
return Date.parse(str.replace(/-(\d)(?!\d)/g, '-0$1'));
|
|
|
},
|
|
},
|
|
|
switch_month_week(type = 'next',update_week = false){
|
|
switch_month_week(type = 'next',update_week = false){
|
|
|
|
|
+ if (this.currentMonth == this.nowMonth && type=="prev"){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.currentMonth + 1 == this.nowMonth && type=="next"){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if(this.retract){
|
|
if(this.retract){
|
|
|
if(type == 'prev'){
|
|
if(type == 'prev'){
|
|
|
this.get_date(this.nowTime - 86400 * 7 * 1000);
|
|
this.get_date(this.nowTime - 86400 * 7 * 1000);
|
|
@@ -592,6 +603,10 @@ export default {
|
|
|
transform: rotate(180deg); display: block;
|
|
transform: rotate(180deg); display: block;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+.disabled{
|
|
|
|
|
+ color: @color_disabled;
|
|
|
}
|
|
}
|
|
|
.retract{
|
|
.retract{
|
|
|
display: flex; justify-content: center; align-items: center; height: 80rpx;;
|
|
display: flex; justify-content: center; align-items: center; height: 80rpx;;
|