123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934 |
- <template>
- <view class="lunc-calendar">
-
- <view class="header">
-
- <text class="head-icon head-pre-month nocheck" v-if="showChangeBtn&&!isshowPrev"></text>
- <text class="head-icon head-pre-month" v-if="showChangeBtn&&isshowPrev" @click="changeMonthOrWeek('prev')"></text>
- <text class="head-month">{{selDate.year+'年'+(selDate.month<10?'0'+selDate.month:selDate.month)+'月'}}</text>
- <text class="head-icon head-next-month" v-if="showChangeBtn" @click="changeMonthOrWeek('next')"></text>
- <text class="go-to-today" v-if="showToday" @click="goToday">今天</text>
- </view>
-
- <view class="week-area" :class="firstDayOfWeek=='sunday'?'week-tit':''">
- <text class="week-font" v-for="(item, index) in weekArr" :key="index ">{{ getWeekType + '' + item }}</text>
- </view>
-
- <swiper class="calendar-data" :current="shrinkType?tranCurrent:tranIndex" circular :duration="tranDuration"
- @change="swiperChange" @animationfinish="swiperEndChange" :style="{height:shrinkType?'112rpx':'532rpx'}">
- <swiper-item class="swiper-item swiper-prev-item" v-for="(a, i) in getAllData" :key="i">
- <text class="month-bg" v-if="showMonthBg">{{ getMontBg }}</text>
- <view class="month-days" :class="[shrinkType?'item-week':'']">
- <view class="week-days" v-for="(b, j) in a" :key="j">
- <view class="day" v-for="(c, k) in b" :key="k" @click="clickDay(c)">
-
- <view class="day-info" :class="[c.dayClass, getIsSelDay(c)&&'is-sel', c.dayType!='normal'&&'un-month',c.isBefore?'day-infoa':''
- ]">
- <text class="day-solar">{{ c.day }}</text>
- </view>
-
-
- {{ c.day }}
- {{c.dayLunar}}
- {{ configWeek.indexOf(c.week)==-1?c.sign[0].title:'不可约' }}
- {{c.dayLunar}}
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
-
- <view class="shrink" v-if="showShrink" @click="changeShrink">
- <image :src="upimg" class="shrink-img" :class="[shrinkType?'shrink-open':'shrink-close']"></image>
-
- </view>
- </view>
- </template>
- <script>
- let { calendar } = require("./calendar.js");
-
- export default {
- name: 'LuncCalendar',
- props: {
-
- showLunar: {
- type: Boolean,
- default: false
- },
-
- showMonthBg: {
- type: Boolean,
- default: true
- },
-
- showChangeBtn: {
- type: Boolean,
- default: true
- },
-
- firstDayOfWeek: {
- type: String,
- default: 'monday'
- },
-
- weekType: {
- type: String,
- default: '周'
- },
-
- weekend: {
- type: Boolean,
- default: true
- },
-
- showShrink: {
- type: Boolean,
- default: false
- },
-
- shrinkState:{
- type: String,
- default: 'month'
- },
-
- signList: {
- type: Array,
- default () {
- return []
- }
- },
-
- configWeek:{
- type: Array,
- default () {
- return []
- }
- },
-
- configHoliday:{
- type: String,
- default () {
- return 'Y'
- }
- },
- },
- data() {
- return {
- upimg:require("@/static/images/order/come/up.png"),
- weekArr: ['一', '二', '三', '四', '五', '六', '日'],
- today: {},
- selDate: {},
- allMonthList: [],
- tranIndex: 1,
- allWeekList: [],
- tranCurrent: 1,
- tranDuration: 300,
- signArr: this.signList,
- showToday: false,
- isshowPrev:false,
- shrinkType: false,
- deterChange: true,
- }
- },
- created() {
- let nd = new Date();
- this.today = {
- year: nd.getFullYear(),
- month: nd.getMonth() + 1,
- day: nd.getDate()
- }
- if (this.firstDayOfWeek == "sunday") this.weekArr = ['日', '一', '二', '三', '四', '五', '六'];
- this.initDate();
- },
- watch: {
- signList(nList, oList){
- this.signArr = nList;
- this.setSignList();
- }
- },
- computed: {
- getAllData() {
- return this.shrinkType ? this.allWeekList : this.allMonthList;
- },
- getMontBg() {
- let monthBg = this.selDate.month;
- return !this.shrinkType ? (monthBg < 10 ? '0' + monthBg : monthBg) : '';
- },
- getIsSelDay(c) {
- return (d) => {
- let { year, month, day } = this.selDate;
- if(year == d.year && month == d.month && day == d.day){
- this.$emit('getIsSelDayFn',d)
- }
- return year == d.year && month == d.month && day == d.day
- }
- },
- getWeekType(){
- let weekType = this.weekType;
- if(weekType && weekType != "true" && weekType != "''" && weekType != '""'){
- return weekType
- }else{
- return ''
- }
- }
- },
- methods: {
- initDate() {
- this.selDate = JSON.parse(JSON.stringify(this.today));
- let monthList = this.getMonthData(this.selDate);
- let prevMonthList = this.getMonthData(this.getMonthDate(this.selDate, -1));
- let nextMonthList = this.getMonthData(this.getMonthDate(this.selDate));
- this.allMonthList = [prevMonthList, monthList, nextMonthList]
- this.tranIndex = 1;
- if(this.shrinkState == "week" && !this.shrinkType) this.changeShrink();
- },
-
- getMonthData(date) {
- const { year, month, day } = date;
- let maxDay = new Date(year, month, 0).getDate();
- let firstWeek = new Date(year + "/" + month + "/1").getDay();
- if (this.firstDayOfWeek == "monday") firstWeek = firstWeek - 1 < 0 ? 6 : firstWeek - 1;
- let list = [];
-
- for (var i = 0; i < 42; i++) {
- let dayInfo = {};
- if (i < firstWeek) {
- let { year, month } = this.getMonthDate(date, -1);
- let preMaxDay = new Date(year, month, 0).getDate();
- let day = preMaxDay - firstWeek + i + 1;
- dayInfo = this.getDayInfo({ year, month, day }, 'prev');
- } else if (i > maxDay + firstWeek - 1) {
- let { year, month } = this.getMonthDate(date);
- let day = i - maxDay - firstWeek + 1;
- dayInfo = this.getDayInfo({ year, month, day }, 'next');
- } else {
- let day = i - firstWeek + 1;
- dayInfo = this.getDayInfo({ year, month, day }, 'normal');
- }
- if (i % 7 == 0) list.push(new Array());
- list[list.length - 1].push(dayInfo);
- }
- return list;
- },
-
- getDayInfo(date, dayType) {
- const { year, month, day } = date;
- let isToday = false;
- let isBefore=false;
- if (year == this.today.year && month == this.today.month && day == this.today.day) isToday = true;
- if(year==this.today.year&&month == this.today.month && day < this.today.day) isBefore=true;
-
- let week = new Date(year + "/" + month + "/" + day).getDay();
- let lunar = calendar.solar2lunar(year, month, day);
- let dayLunar = lunar.IDayCn == '初一' ? lunar.IMonthCn + lunar.IDayCn : lunar.IDayCn;
- if (lunar.festival) dayLunar = lunar.festival;
- else if (lunar.lunarFestival) dayLunar = lunar.lunarFestival;
- else if (lunar.Term) dayLunar = lunar.Term;
- let holidayArr = ["元旦", "春节", "清明节", "劳动节", "端午节", "中秋节", "国庆节"];
- let isHoliday = false;
- if (holidayArr.indexOf(dayLunar) != -1) isHoliday = true;
- let dayInfo = {
- date: year + "-" + month + "-" + day,
- year, month, day, week,
- lunar,
- dayLunar,
- isToday,
- isBefore,
- isHoliday,
- dayType,
- sign: this.getSignByDate(date)
- }
- let dayClass = this.getDayClass(dayInfo);
- dayInfo["dayClass"] = dayClass;
- return dayInfo;
- },
-
- getDayClass(dayInfo) {
- let dClass = "";
- if (dayInfo.isToday) dClass += ' is-today';
- if (dayInfo.isHoliday) dClass += ' is-holiday';
- if (this.weekend && (dayInfo.week == 0 || dayInfo.week == 6)) dClass += ' week-end';
- return dClass;
- },
-
- getSignByDate(date) {
- const { year, month, day } = date;
- let dayDateS = new Date(year + "/" + month + "/" + day + " 00:00:00").getTime();
- let dayDateE = new Date(year + "/" + month + "/" + day + " 23:59:59").getTime();
- let daySign = [];
- this.signArr.map(sign => {
- let signDate = sign.date.replace(/-/g, '/');
- let signTimes = new Date(sign.date).getTime();
- if (signTimes >= dayDateS && signTimes <= dayDateE) daySign.push(sign)
- })
- return daySign;
- },
-
- getOtherData(type) {
- let nowMont = this.getMonthDate(this.selDate, type == 'prev' ? -1 : 1);
- this.selDate = nowMont;
- let monthData = this.getMonthData(this.getMonthDate(nowMont, type == 'prev' ? -1 : 1));
-
- let current = this.getTranIndex().prevNum;
- if (type == "next") current = this.getTranIndex().nextNum;
- this.allMonthList.splice(current, 1, monthData);
- this.judgeShowToday();
- this.returnMonthChange(type);
- },
-
- getOtherWeekData(type) {
- let oldSel = this.selDate;
- let newSel = this.getDateByDateAndDay(oldSel, type == 'prev' ? -7 : 7);
- if (oldSel.month != newSel.month) {
-
- let current = this.getTranIndex("month").prevNum;
- if (type == "next") current = this.getTranIndex("month").nextNum;
- this.tranIndex = current;
- this.getOtherData(type);
- }
- this.selDate = newSel;
- this.getWeekData(type);
- this.judgeShowToday();
- },
-
- getWeekData(type) {
- const { prevNum: prevIndex, nowNum: nowIndex, nextNum: nextIndex } = this.getTranIndex("month");
- const { prevNum: prevCurrent, nowNum: nowCurrent, nextNum: nextCurrent } = this.getTranIndex("week");
- const { year: selYear, month: selMonth, day: selDay } = this.selDate;
- let sDate = selYear + "-" + selMonth + "-" + selDay
- let prevMonthList = this.allMonthList[prevIndex];
- let nowMonthList = this.allMonthList[nowIndex];
- let nextMonthList = this.allMonthList[nextIndex];
- for (let i = 0; i < nowMonthList.length; i++) {
- for (let j = 0; j < nowMonthList[i].length; j++) {
- if (sDate == nowMonthList[i][j].date) {
- this.returnDayChange(nowMonthList[i][j]);
- if (type == "next") {
- this.allWeekList.splice(nextCurrent, 1, [nowMonthList[i + 1]]);
- if (i == 5) this.allWeekList.splice(nextCurrent, 1, [nextMonthList[1]]);
- } else {
- this.allWeekList.splice(prevCurrent, 1, [nowMonthList[i - 1]]);
- if (i == 0) {
- for (let k = prevMonthList.length - 1; k >= 0; k--) {
- if (prevMonthList[k][6].dayType == "normal") {
- this.allWeekList.splice(prevCurrent, 1, [prevMonthList[k]]);
- break;
- }
- }
- }
- }
- break;
- }
- }
- }
- },
-
- getAllWeekData() {
- const { prevNum, nowNum, nextNum } = this.getTranIndex("month");
- const { year: selYear, month: selMonth, day: selDay } = this.selDate;
- let sDate = selYear + "-" + selMonth + "-" + selDay;
- let allWeekList = [[],[],[]];
- let prevMonthList = this.allMonthList[prevNum];
- let nowMonthList = this.allMonthList[nowNum];
- let nextMonthList = this.allMonthList[nextNum];
- for (let i = 0; i < nowMonthList.length; i++) {
- for (let j = 0; j < nowMonthList[i].length; j++) {
- if (sDate == nowMonthList[i][j].date) {
- allWeekList[0][0] = nowMonthList[i - 1];
- allWeekList[1][0] = nowMonthList[i];
- allWeekList[2][0] = nowMonthList[i + 1];
- if (i == 5) {
- allWeekList[2][0] = nextMonthList[1];
- } else if (i == 0) {
- for (let k = prevMonthList.length - 1; k >= 0; k--) {
- if (prevMonthList[k][6].dayType == "normal") {
- allWeekList[0][0] = prevMonthList[k];
- break;
- }
- }
- }
- break;
- }
- }
- }
- this.allWeekList = allWeekList;
- },
-
- swiperEndChange() {
- this.tranDuration = 300;
- },
-
- swiperChange(e) {
- let current = e.detail.current;
- let oldIndex = this.shrinkType ? this.tranCurrent : this.tranIndex;
- let type = (oldIndex - current == -1 || oldIndex - current == 2) ? 'next' : 'prev';
- if (this.shrinkType) {
- this.tranCurrent = current;
- if (current != oldIndex) this.getOtherWeekData(type);
- } else {
- this.tranIndex = current;
- if (current != oldIndex) this.getOtherData(type);
- }
- },
-
- changeMonthOrWeek(type) {
- if (!this.deterChange) return;
- this.deterChange = false;
- setTimeout(_ => {
- this.deterChange = true;
- }, 400);
- this.tranDuration = 300;
- let tranType = this.shrinkType ? 'week' : 'month';
- let current = this.getTranIndex(tranType).prevNum;
- if (type == "next") current = this.getTranIndex(tranType).nextNum;
- if (tranType == "week") {
- this.tranCurrent = current;
- this.getOtherWeekData(type);
- } else {
- this.tranIndex = current;
- this.getOtherData(type);
- }
- },
-
- changeShrink() {
- this.shrinkType = !this.shrinkType;
- if (this.tranDuration != 0) this.tranDuration = 0;
- if (this.shrinkType) {
- this.tranCurrent = 1;
- this.getAllWeekData();
- }
- this.returnShrinkChange();
- this.judgeShowToday();
- },
-
- goToday() {
- if (this.tranDuration != 0) this.tranDuration = 0;
- let oldDate = JSON.parse(JSON.stringify(this.selDate));
- this.initDate();
- if (this.shrinkType) {
- this.tranCurrent = 1;
- this.getAllWeekData();
- let today = this.today;
-
- if(oldDate.year != today.year || oldDate.month != today.month){
- this.returnMonthChange("today");
- }else{
- this.returnDayChange(this.today);
- }
- } else {
- this.returnMonthChange("today");
- }
- this.judgeShowToday();
- },
-
- clickDay(dayInfo) {
-
-
-
-
- if(dayInfo.isBefore){
- return
- }
-
- let { year, month, day } = this.selDate;
- if (day == dayInfo.day && month == dayInfo.month && year == dayInfo.year) return;
- let oldSel = JSON.parse(JSON.stringify(this.selDate));
- this.selDate.day = dayInfo.day;
- if (oldSel.month != dayInfo.month) {
- if (!this.shrinkType) {
- this.changeMonthOrWeek(dayInfo.dayType);
- return;
- } else {
- this.selDate.year = dayInfo.year;
- this.selDate.month = dayInfo.month;
- let nowSel = JSON.parse(JSON.stringify(this.selDate));
- let type = "nowNum"
- if (nowSel.year > oldSel.year || (nowSel.year === oldSel.year && nowSel.month > oldSel.month)){
- type = "nextNum"
- } else if (nowSel.year < oldSel.year || (nowSel.year === oldSel.year && nowSel.month < oldSel.month)){
- type = "prevNum"
- }
- this.tranIndex = this.getTranIndex("month")[type];
- let monthData = this.getMonthData(this.getMonthDate(this.selDate, type == 'prevNum' ? -1 : 1));
- let current = this.getTranIndex("month")[type];
- this.allMonthList.splice(current, 1, monthData);
- }
- this.returnMonthChange(dayInfo.dayType);
- } else {
- this.returnDayChange(dayInfo);
- }
- },
-
- judgeShowToday() {
- const { year, month, day } = this.today;
- const { year: selYeat, month: selMonth, day: selDay } = this.selDate;
- if (this.shrinkType) {
- let selTimes = new Date(selYeat, selMonth - 1, selDay).getTime();
- let week = new Date(year, month - 1, day).getDay();
- let firstWD = this.getDateByDateAndDay(this.today, -week + (this.firstDayOfWeek == "monday" ? 1 : 0));
- let lastWD = this.getDateByDateAndDay(this.today, 6 - week + (this.firstDayOfWeek == "monday" ? 1 : 0));
- let firstTimes = new Date(firstWD.year, firstWD.month - 1, firstWD.day).getTime();
- let lastTimes = new Date(lastWD.year, lastWD.month - 1, lastWD.day).getTime();
- if (selTimes > lastTimes || selTimes < firstTimes) this.showToday = true;
- else this.showToday = false;
- if(selTimes > lastTimes) this.isshowPrev=true;
- else this.isshowPrev=false;
- } else {
- if (year != selYeat || month != selMonth) this.showToday = true;
- else this.showToday = false;
-
- if(Number(selYeat)>Number(year)||Number(selMonth)>Number(month)) this.isshowPrev=true;
- else this.isshowPrev=false;
- }
- },
-
- setSignList() {
- this.allMonthList.map(month => {
- month.map(week => {
- week.map(day => {
- day.sign = this.getSignByDate({ year: day.year, month: day.month, day: day.day })
- })
- })
- })
- },
-
- addSignList(list) {
- let signArr = this.signArr.concat(list);
- this.signArr = signArr;
- this.setSignList();
- },
-
- deleteSignList(list) {
- let signArr = this.signArr;
- signArr = signArr.filter(s => {
- if (list.find(l => l.date == s.date && l.title == s.title)) return false
- else return true;
- })
- this.signArr = signArr;
- this.setSignList();
- },
-
- returnDayChange(dayInfo) {
- let { year, month, day } = dayInfo;
- let dayDate = year + "-" + (month < 10 ? '0' + month : month) + "-" + (day < 10 ? '0' + day : day)
- let returnData = {
- date: dayDate,
- year: year,
- month: month,
- day: day,
- week: dayInfo.week,
- daySign: dayInfo.sign
- }
- if (this.showLunar) returnData["lunar"] = dayInfo.lunar;
- this.$emit("dayChange", returnData);
- },
-
- returnMonthChange(type) {
- let selDate = this.selDate.year + "-" + this.selDate.month + "-" + this.selDate.day;
- let monthList = this.allMonthList.flat().flat();
- let dayInfo = monthList.find(day => day.date == selDate);
- this.returnDayChange(dayInfo)
- this.$emit("monthChange", {
- year: dayInfo.year,
- month: dayInfo.month,
- type: type
- });
- },
-
- returnShrinkChange() {
- let type = this.shrinkType ? 'week' : 'month'
- this.$emit("shrinkClick", type);
- },
-
- getTranIndex(type = 'month') {
- let current = this.tranIndex;
- if (type == "week") current = this.tranCurrent;
- let prevNum = current - 1 < 0 ? 2 : current - 1;
- let nowNum = current;
- let nextNum = current + 1 > 2 ? 0 : current + 1;
- return { prevNum, nowNum, nextNum }
- },
-
- getDateByDateAndDay(date, num) {
- let dTime = new Date(date.year + "/" + date.month + "/" + date.day).getTime() + num * 24 * 60 * 60 * 1000;
- let nd = new Date(dTime);
- return {
- year: nd.getFullYear(),
- month: nd.getMonth() + 1,
- day: nd.getDate()
- }
- },
-
- getMonthDate(date, num = 1) {
- let nextMonth = date.month + num;
- let diffYear = parseInt(Math.abs(nextMonth) / 12);
- let year = date.year;
- let month = nextMonth;
- if (nextMonth > 12) {
- year = date.year + diffYear;
- month = nextMonth % 12;
- } else if (nextMonth < 1) {
- year = date.year - (diffYear + 1);
- month = nextMonth + 12 * (diffYear + 1);
- }
- let monthMaxDay = new Date(year, month, 0).getDate();
- let day = date.day > monthMaxDay ? monthMaxDay : date.day;
- return { year, month, day }
- },
- }
- }
- </script>
- <style lang="scss">
- .lunc-calendar {
- background-color: #FFF;
- // 头部
- .header {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- position: relative;
- height: 88rpx;
- line-height: 88rpx;
- border-bottom: 2rpx solid $com-cd3;
- .head-month {
- font-size: 30rpx;
- padding: 0 40rpx;
- font-weight: bold;
- }
- .day_tit{
- position: absolute;
- left: 0rpx;
- top: 26rpx;
- font-size: 30rpx;
- line-height: 36rpx;
- color: #161616;
- text-align: center;
- font-weight: bold;
- }
- .go-to-today {
- position: absolute;
- right: 16rpx;
- top: 26rpx;
- font-size: 24rpx;
- line-height: 36rpx;
- color: $com-cd3;
- text-align: center;
- width: 80rpx;
- height: 36rpx;
- border: 2rpx solid $com-cd3;
- border-radius: 18rpx;
- box-sizing: border-box;
- }
- .head-icon {
- content: '';
- display: flex;
- width: 22rpx;
- height: 22rpx;
- border-top: 2rpx solid $com-cd3;
- border-left: 2rpx solid $com-cd3;
- }
- .head-icon.head-pre-month {
- transform: rotate(-45deg);
- }
- .head-icon.head-next-month {
- transform: rotate(135deg);
- }
- .head-icon.nocheck {
- border-top: 2rpx solid #aaaaaa;
- border-left: 2rpx solid #aaaaaa;
- }
- }
- // 星期
- .week-area {
- display: flex;
- flex-direction: row;
- align-items: center;
- // border-bottom: 1px solid #EEE;
- padding: 16rpx 0;
- // margin: 0 10rpx;
- .week-font {
- flex: 1;
- text-align: center;
- color: #161616;
- font-size: 30rpx;
- font-weight: bold;
- }
- &.week-tit{
- .week-font:first-child{color: #aaaaaa;}
- .week-font:last-child{color: #aaaaaa;}
- }
- }
- // 日历
- .calendar-data {
- // transition: all 300ms;
- .swiper-item {
- position: relative;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: row;
- .month-bg {
- position: absolute;
- font-size: 460rpx;
- color: #EEE;
- font-weight: bold;
- opacity: 0.4;
- z-index: -1;
- }
- .month-days {
- flex: 1;
- // margin-top: 10rpx;
- position: relative;
- .week-days {
- display: flex;
- flex-direction: row;
- .day {
- flex: 1;
- width: 14.28%;
- text-align: center;
- // height: 84rpx;
- height: 76rpx;
- color: #000;
- /* #ifndef APP-NVUE */
- padding: 0 6rpx;
- /* #endif */
- // box-sizing: border-box;
- display: flex;
- .day-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: center;
- position: relative;
-
- .day-solar {
- display: flex;
- font-size: 30rpx;
- line-height: 76rpx;
- width: calc(100% - 4rpx);
- // height: 50rpx;
- // padding-top: 10rpx;
- border-radius: 16rpx 16rpx 0 0;
- color: #161616;
- box-sizing: border-box;
- // background:#ffffff;
- display: block;
- // font-weight: bold;
- }
- .day-lunar,
- .day-sign {
- color: #161616;
- font-size: 24rpx;
- line-height: 24rpx;
- transform: scale(0.8);
- white-space: nowrap;
- margin-top: 6rpx;
- }
- .day-sign {
- color: #161616 !important;
- }
- .day-tag {
- content: "";
- position: absolute;
- top: 8rpx;
- right: 8rpx;
- width: 10rpx;
- height: 10rpx;
- border-radius: 6rpx;
- background-color: #F75858;
- }
- }
- // 非当月日期
- .day-info.un-month {
- opacity: 0.25;
- transition: opacity 300ms;
- }
- // 今天日期
- .is-today .day-solar,
- .is-today .day-sign,
- .is-today .day-lunar {
- color: $com-cd3;
- }
- // 周末
- .week-end .day-solar {
- // color: #FF9595;
- }
- // 法定假日
- .is-holiday .day-solar,
- .is-holiday .day-sign,
- .is-holiday .day-lunar {
- color: #161616 !important;
- }
- //不能预约的日期
- .day-infoa,{
- .day-solar{color: #AAAAAA !important;}
- .day-sign{color: #AAAAAA !important;}
- .day-lunar{color: #AAAAAA !important;}
- }
- // .is-holiday{
- // .day-solar{color: #AAAAAA !important;}
- // .day-sign{color: #AAAAAA !important;}
- // }
- // 当前选中的日期
- .is-sel {
- background-color: $com-cd3;
- border-radius: 16rpx;
- .day-solar{color: #ffffff !important}
- .day-sign{color: #ffffff !important;}
- }
- }
- }
- // .week-days.week-hide {
- // display: none;
- // }
- }
- .item-week {
- .un-month {
- opacity: 1 !important;
- }
- }
- }
- }
- // 收缩按钮
- .shrink {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 60rpx;
- // border-top: 1px solid #DDD;
- .shrink-img{width: 32rpx;height: 18rpx;}
- /* #ifndef APP-NVUE */
- .shrink-btn {
- width: 32rpx;
- height: 32rpx;
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAMhJREFUOE/dky8LAkEQxd9w0WjV72KxWXfggmAyWWzXxHbNYjIJhoOZarvid9FqNB4jCyes3h9OLghu3fceb36zS+h5qKcf/xYgIisAayJKnHMa8lFVZ2YpgB0z7193FQYisgCwAXA3s8QLicgbhwC2zHwMgxshBkFeXzE2Nvh2rW8NsiybRFE0ZuZTXZCIzIuiuMZxfKltICJTAAciegDwIM9eqKozAKmZDQAsmTlvHSGY/1YKR00cWl9iGYRP8p220BXm7//CE8WyQBHBXZb9AAAAAElFTkSuQmCC);
- }
- .shrink-close {
- transform: rotate(180deg);
- }
- /* #endif */
- /* #ifdef APP-NVUE */
- .shrink-btn{
- content: '';
- display: flex;
- width: 18rpx;
- height: 18rpx;
- border-top: 2rpx solid #606266;
- border-left: 2rpx solid #606266;
- transform: rotate(-135deg);
- }
- .shrink-close {
- transform: rotate(45deg);
- }
- /* #endif */
- }
- }
- </style>
|