ソースを参照

calendar today

zizhong.wang 3 年 前
コミット
551c671387
共有1 個のファイルを変更した11 個の追加4 個の削除を含む
  1. 11 4
      components/lx-calendar/lx-calendar.vue

+ 11 - 4
components/lx-calendar/lx-calendar.vue

@@ -15,7 +15,7 @@
 				<view class="date_dl" v-show="!retract || index == to_prev_week_index" v-for="(item,index) in   week_list_prev_co" :key="index">
 					<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
 						<!-- <view class="num" :class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">{{vo.day}}</view> -->
-						<view class="num" :class="[vo.today && currentMonth == nowMonth ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
+						<view class="num" :class="[vo.today ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
 						<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
 					</view>
 				</view>
@@ -26,7 +26,7 @@
 				<view class="date_dl" v-show="!retract || index == to_week_index" v-for="(item,index) in week_list" :key="index">
 					<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
 						<!-- <view class="num" :class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">{{vo.day}}</view> -->
-						<view class="num" :class="[vo.today && currentMonth == nowMonth ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
+						<view class="num" :class="[vo.today ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
 						<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
 					</view>
 				</view>
@@ -37,7 +37,7 @@
 				<view class="date_dl" v-show="!retract || index == to_next_week_index" v-for="(item,index) in  week_list_next_co" :key="index">
 					<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
 						<!-- <view class="num" :class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">{{vo.day}}</view> -->
-						<view class="num" :class="[vo.today && currentMonth == nowMonth ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
+						<view class="num" :class="[vo.today  ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
 						<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
 					</view>
 				</view>
@@ -327,6 +327,8 @@ export default {
 					}else{
 						vo.dot = false;
 					}
+					
+					
 					return {...vo}
 				}))
 			})
@@ -426,6 +428,10 @@ export default {
 			if (this.currentMonth + 1 == this.nowMonth && type=="next"){
 				return;
 			}
+			
+			this.nowDay = '';
+			this.date = '';
+			
 			if(this.retract){
 				if(type == 'prev'){
 					this.get_date(this.nowTime - 86400 * 7 * 1000);
@@ -440,6 +446,7 @@ export default {
 				this.get_date(this.get_month(type))
 				this.update_swiper_item('month');
 			}
+			
 			this.set_doc_lists_update();
 			
 			this.set_to_day_all();
@@ -510,7 +517,7 @@ export default {
 				})
 				
 				if(i == nowDay && type == 'same'){
-					this.date = `${nowYear}-${nowMonth}-${i}`;
+				//	this.date = `${nowYear}-${nowMonth}-${i}`;
 				}
 				
 			}