diff --git a/components/calendar/calendar.js b/components/calendar/calendar.js index 25b3b83a7f51fc2e19729c4a19847a3fcf7a49a2..7d78e08f65ac24f2d7ff8d5b2f8387b609c516f0 100644 --- a/components/calendar/calendar.js +++ b/components/calendar/calendar.js @@ -11,6 +11,7 @@ Component({ * 组件的初始数据 */ data: { + now_selectedDate:'', //当前是几月几号 selectedDate:'', //选中的几月几号 selectedWeek:'', //选中的是星期几 curYear:2017, //当前年份 @@ -33,6 +34,7 @@ Component({ curYear, curMonth, selectedDate, + now_selectedDate:selectedDate, selectedWeek }) this.getDateList(curYear,curMonth-1); diff --git a/components/calendar/calendar.wxml b/components/calendar/calendar.wxml index b5c712930be5a92d664bc28d23abfd95aa7cade6..b1f0887f2279c7af00a36bc319ee1842f8804bb8 100644 --- a/components/calendar/calendar.wxml +++ b/components/calendar/calendar.wxml @@ -20,7 +20,7 @@ - + {{item.date}} diff --git a/components/calendar/calendar.wxss b/components/calendar/calendar.wxss index 33b79af3cddf2e479ffb5e30a5a612f6f3a1ecc1..a2e8831853f1b18952e8e378e08620751cc6bb46 100644 --- a/components/calendar/calendar.wxss +++ b/components/calendar/calendar.wxss @@ -29,14 +29,14 @@ overflow: hidden; display: flex; height: calc(100% / 6); - border-radius: 50%; + align-items: center; } .weekday_label{ width: calc(100% / 7); /* float: left; */ /* text-align: center; */ font-size: 27rpx; - /* padding: 10rpx 0; */ + padding: 12rpx 0; display: flex; justify-content: center; align-items: center; @@ -53,11 +53,27 @@ } .active_date{ background: rgba(0,0,0,.12); - color: #fff; + color: rgba(0,0,0,.6); /* border-radius: 50%; */ - padding: 12rpx; - box-sizing: border-box; + /* padding: 12rpx; + box-sizing: border-box; */ + overflow: hidden; + position: relative; +} +.active_dates{ + background: rgba(0,0,0,.12); + color: rgba(0,0,0,.6); overflow: hidden; + position: relative; +} +.active_dates::before{ + content: "今天"; + position: absolute; + top: -2rpx; + left: 50%; + transform: translateX(-50%); + color: blue; + font-size: 20rpx; } .show_box{ padding: 20rpx; diff --git a/pages/calendar/calendar.wxml b/pages/calendar/calendar.wxml index 7c8465aa96fe5e3abd71ed55f1080fc628eabf68..4a5ebe1d7d23c137a61167b38081a11e707cc287 100644 --- a/pages/calendar/calendar.wxml +++ b/pages/calendar/calendar.wxml @@ -1,3 +1,3 @@ - + \ No newline at end of file