tui-calendar.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  1. <template>
  2. <view>
  3. <view :class="{ 'tui-bottom-popup': isFixed, 'tui-popup-show': isShow && isFixed }">
  4. <view class="tui-calendar-header" :class="{ 'tui-calendar-radius': radius }" @touchmove.stop.prevent="stop" v-if="isFixed">
  5. <view>日期选择</view>
  6. <view class="tui-iconfont tui-font-close" hover-class="tui-opacity" :hover-stay-time="150" @tap="hide"></view>
  7. </view>
  8. <view class="tui-date-box">
  9. <view
  10. class="tui-iconfont tui-font-arrowleft"
  11. :style="{ color: yearArrowColor }"
  12. hover-class="tui-opacity"
  13. :hover-stay-time="150"
  14. v-if="arrowType == 1"
  15. @tap="changeYear(0)"
  16. ></view>
  17. <view class="tui-iconfont tui-font-arrowleft" :style="{ color: monthArrowColor }" hover-class="tui-opacity" :hover-stay-time="150" @tap="changeMonth(0)"></view>
  18. <view class="tui-date_time">{{ showTitle }}</view>
  19. <view class="tui-iconfont tui-font-arrowright" :style="{ color: monthArrowColor }" hover-class="tui-opacity" :hover-stay-time="150" @tap="changeMonth(1)"></view>
  20. <view
  21. class="tui-iconfont tui-font-arrowright"
  22. :style="{ color: yearArrowColor }"
  23. hover-class="tui-opacity"
  24. :hover-stay-time="150"
  25. v-if="arrowType == 1"
  26. @tap="changeYear(1)"
  27. ></view>
  28. </view>
  29. <view class="tui-date-header">
  30. <view class="tui-date">日</view>
  31. <view class="tui-date">一</view>
  32. <view class="tui-date">二</view>
  33. <view class="tui-date">三</view>
  34. <view class="tui-date">四</view>
  35. <view class="tui-date">五</view>
  36. <view class="tui-date">六</view>
  37. </view>
  38. <view class="tui-date-content" :class="{ 'tui-flex-start': isFixed && fixedHeight }" :style="{ height: isFixed && fixedHeight ? dateHeight * 6 + 'px' : 'auto' }">
  39. <block v-for="(item, index) in weekdayArr" :key="index"><view class="tui-date"></view></block>
  40. <view
  41. class="tui-date"
  42. :class="{
  43. 'tui-date-pd_0': isFixed && fixedHeight,
  44. 'tui-opacity': openDisAbled(year, month, index + 1),
  45. 'tui-start-date': (type == 2 && startDate == `${year}-${month}-${index + 1}`) || type == 1,
  46. 'tui-end-date': (type == 2 && endDate == `${year}-${month}-${index + 1}`) || type == 1
  47. }"
  48. :style="{ backgroundColor: isFixed ? getColor(index, 1) : 'transparent', height: isFixed && fixedHeight ? dateHeight + 'px' : 'auto' }"
  49. v-for="(item, index) in daysArr"
  50. :key="index"
  51. @tap="dateClick(index)"
  52. >
  53. <view class="tui-date-text" :style="{ color: isFixed ? getColor(index, 2) : getStatusData(3, index), backgroundColor: getStatusData(2, index) }">
  54. <view v-if="isFixed || !getStatusData(4, index)">{{ index + 1 }}</view>
  55. <view v-if="!getStatusData(4, index)" class="tui-custom-desc" :class="{ 'tui-lunar-unshow': !lunar && isFixed }">
  56. {{ getDescText(index, startDate, endDate) }}
  57. </view>
  58. <text class="tui-iconfont tui-font-check" v-if="getStatusData(4, index)"></text>
  59. </view>
  60. <view class="tui-date-desc" :style="{ color: activeColor }" v-if="!lunar && type == 2 && startDate == `${year}-${month}-${index + 1}` && startDate != endDate">
  61. {{ startText }}
  62. </view>
  63. <view class="tui-date-desc" :style="{ color: activeColor }" v-if="!lunar && type == 2 && endDate == `${year}-${month}-${index + 1}`">{{ endText }}</view>
  64. </view>
  65. <view class="tui-bg-month">{{ month }}</view>
  66. </view>
  67. <view class="tui-calendar-op" v-if="isFixed" @touchmove.stop.prevent="stop">
  68. <view class="tui-calendar-result">
  69. <text>{{ type == 1 ? activeDate : startDate }}</text>
  70. <text v-if="endDate">至{{ endDate }}</text>
  71. </view>
  72. <view class="tui-calendar-btn_box"><tui-button :type="btnType" height="72rpx" shape="circle" :size="28" @click="btnFix(false)">确定</tui-button></view>
  73. </view>
  74. </view>
  75. <view class="tui-popup-mask" :class="[isShow ? 'tui-mask-show' : '']" @touchmove.stop.prevent="stop" v-if="isFixed" @tap="hide"></view>
  76. </view>
  77. </template>
  78. <script>
  79. //easycom组件模式 无需手动引入
  80. // import tuiButton from "../tui-button/tui-button"
  81. const calendar = require('./tui-calendar.js');
  82. export default {
  83. name: 'tuiCalendar',
  84. // components:{
  85. // tuiButton
  86. // },
  87. props: {
  88. //1-切换月份和年份 2-切换月份
  89. arrowType: {
  90. type: [Number, String],
  91. default: 1
  92. },
  93. //1-单个日期选择 2-开始日期+结束日期选择
  94. type: {
  95. type: Number,
  96. default: 1
  97. },
  98. //可切换最大年份
  99. maxYear: {
  100. type: Number,
  101. default: 2030
  102. },
  103. //可切换最小年份
  104. minYear: {
  105. type: Number,
  106. default: 1920
  107. },
  108. //最小可选日期(不在范围内日期禁用不可选)
  109. minDate: {
  110. type: String,
  111. default: '1920-01-01'
  112. },
  113. /**
  114. * 最大可选日期
  115. * 默认最大值为今天,之后的日期不可选
  116. * 2030-12-31
  117. * */
  118. maxDate: {
  119. type: String,
  120. default: ''
  121. },
  122. //显示圆角
  123. radius: {
  124. type: Boolean,
  125. default: true
  126. },
  127. //状态 数据顺序与当月天数一致,index=>day
  128. /**
  129. * [{
  130. * text:"", 描述:2字以内
  131. * value:"",状态值
  132. * bgColor:"",背景色
  133. * color:"" 文字颜色,
  134. * check:false //是否显示对勾
  135. *
  136. }]
  137. *
  138. * **/
  139. status: {
  140. type: Array,
  141. default() {
  142. return [];
  143. }
  144. },
  145. //月份切换箭头颜色
  146. monthArrowColor: {
  147. type: String,
  148. default: '#999'
  149. },
  150. //年份切换箭头颜色
  151. yearArrowColor: {
  152. type: String,
  153. default: '#bcbcbc'
  154. },
  155. //默认日期字体颜色
  156. color: {
  157. type: String,
  158. default: '#333'
  159. },
  160. //选中|起始结束日期背景色
  161. activeBgColor: {
  162. type: String,
  163. default: '#5677fc'
  164. },
  165. //选中|起始结束日期字体颜色
  166. activeColor: {
  167. type: String,
  168. default: '#fff'
  169. },
  170. //范围内日期背景色
  171. rangeBgColor: {
  172. type: String,
  173. default: 'rgba(86,119,252,0.1)'
  174. },
  175. //范围内日期字体颜色
  176. rangeColor: {
  177. type: String,
  178. default: '#5677fc'
  179. },
  180. //type=2时生效,起始日期自定义文案
  181. startText: {
  182. type: String,
  183. default: '开始'
  184. },
  185. //type=2时生效,结束日期自定义文案
  186. endText: {
  187. type: String,
  188. default: '结束'
  189. },
  190. //按钮样式类型
  191. btnType: {
  192. type: String,
  193. default: 'primary'
  194. },
  195. //固定在底部
  196. isFixed: {
  197. type: Boolean,
  198. default: false
  199. },
  200. //固定日历容器高度,isFixed=true时生效
  201. fixedHeight: {
  202. type: Boolean,
  203. default: true
  204. },
  205. //当前选中日期带选中效果
  206. isActiveCurrent: {
  207. type: Boolean,
  208. default: true
  209. },
  210. //切换年月是否触发事件 type=1时生效
  211. isChange: {
  212. type: Boolean,
  213. default: false
  214. },
  215. //是否显示农历
  216. lunar: {
  217. type: Boolean,
  218. default: false
  219. },
  220. //初始化起始选中日期 格式: 2020-06-06 或 2020/06/06 【type=1 or 2】
  221. initStartDate: {
  222. type: String,
  223. default: ''
  224. },
  225. //初始化结束日期 格式: 2020-06-06 或 2020/06/06【type=2】
  226. initEndDate: {
  227. type: String,
  228. default: ''
  229. }
  230. },
  231. data() {
  232. return {
  233. isShow: false,
  234. weekday: 1, // 星期几,值为1-7
  235. weekdayArr: [],
  236. days: 0, //当前月有多少天
  237. daysArr: [],
  238. showTitle: '',
  239. year: 2020,
  240. month: 0,
  241. day: 0,
  242. startYear: 0,
  243. startMonth: 0,
  244. startDay: 0,
  245. endYear: 0,
  246. endMonth: 0,
  247. endDay: 0,
  248. today: '',
  249. activeDate: '',
  250. startDate: '',
  251. endDate: '',
  252. isStart: true,
  253. min: null,
  254. max: null,
  255. dateHeight: 20
  256. };
  257. },
  258. computed: {
  259. dataChange() {
  260. return `${this.type}-${this.minDate}-${this.maxDate}-${this.initStartDate}-${this.initEndDate}`;
  261. }
  262. },
  263. watch: {
  264. dataChange(val) {
  265. this.init();
  266. },
  267. fixedHeight(val) {
  268. if (val) {
  269. this.initDateHeight();
  270. }
  271. }
  272. },
  273. created() {
  274. this.init();
  275. },
  276. methods: {
  277. getColor(index, type) {
  278. let color = type == 1 ? '' : this.color;
  279. let day = index + 1;
  280. let date = `${this.year}-${this.month}-${day}`;
  281. let timestamp = new Date(date.replace(/\-/g, '/')).getTime();
  282. let start = this.startDate.replace(/\-/g, '/');
  283. let end = this.endDate.replace(/\-/g, '/');
  284. if ((this.isActiveCurrent && this.activeDate == date) || this.startDate == date || this.endDate == date) {
  285. color = type == 1 ? this.activeBgColor : this.activeColor;
  286. } else if (this.endDate && timestamp > new Date(start).getTime() && timestamp < new Date(end).getTime()) {
  287. color = type == 1 ? this.rangeBgColor : this.rangeColor;
  288. }
  289. return color;
  290. },
  291. //获取状态数据
  292. getStatusData(type, index) {
  293. //1-描述text,2-bgColor背景色,3-color文字颜色 4-check 是否显示对勾
  294. let val = ['', 'transparent', '#333', ''][type - 1];
  295. if (!this.isFixed && this.status && this.status.length > 0) {
  296. let item = this.status[index];
  297. if (item) {
  298. switch (type) {
  299. case 1:
  300. val = item.text;
  301. break;
  302. case 2:
  303. val = item.bgColor;
  304. break;
  305. case 3:
  306. val = item.color;
  307. break;
  308. case 4:
  309. val = item.check;
  310. break;
  311. default:
  312. break;
  313. }
  314. }
  315. }
  316. return val;
  317. },
  318. getDescText(index, startDate, endDate) {
  319. let text = this.lunar ? this.getLunar(this.year, this.month, index + 1) : '';
  320. if (this.isFixed && this.type == 2) {
  321. //此判断不能与上面条件一起判断
  322. if (this.lunar) {
  323. let date = `${this.year}-${this.month}-${index + 1}`;
  324. if (startDate == date && startDate != endDate) {
  325. text = this.startText;
  326. } else if (endDate == date) {
  327. text = this.endText;
  328. }
  329. }
  330. } else {
  331. let status = this.getStatusData(1, index);
  332. if (status) text = status;
  333. }
  334. return text;
  335. },
  336. getLunar(year, month, day) {
  337. let obj = calendar.solar2lunar(year, month, day);
  338. return obj.IDayCn;
  339. },
  340. initDateHeight() {
  341. if (this.fixedHeight && this.isFixed) {
  342. this.dateHeight = uni.getSystemInfoSync().windowWidth / 7;
  343. }
  344. },
  345. init() {
  346. this.initDateHeight();
  347. let now = new Date();
  348. this.year = now.getFullYear();
  349. this.month = now.getMonth() + 1;
  350. this.day = now.getDate();
  351. this.today = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
  352. this.activeDate = this.today;
  353. this.min = this.initDate(this.minDate);
  354. this.max = this.initDate(this.maxDate || this.today);
  355. this.startDate = '';
  356. this.startYear = 0;
  357. this.startMonth = 0;
  358. this.startDay = 0;
  359. if (this.initStartDate) {
  360. let start = new Date(this.initStartDate.replace(/\-/g, '/'));
  361. if (this.type == 1) {
  362. this.year = start.getFullYear();
  363. this.month = start.getMonth() + 1;
  364. this.day = start.getDate();
  365. this.activeDate = `${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`;
  366. } else {
  367. this.startDate = `${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`;
  368. this.startYear = start.getFullYear();
  369. this.startMonth = start.getMonth() + 1;
  370. this.startDay = start.getDate();
  371. this.activeDate = '';
  372. }
  373. }
  374. this.endYear = 0;
  375. this.endMonth = 0;
  376. this.endDay = 0;
  377. this.endDate = '';
  378. if (this.initEndDate && this.type == 2) {
  379. let end = new Date(this.initEndDate.replace(/\-/g, '/'));
  380. this.endDate = `${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate()}`;
  381. this.endYear = end.getFullYear();
  382. this.endMonth = end.getMonth() + 1;
  383. this.endDay = end.getDate();
  384. this.activeDate = '';
  385. this.year = end.getFullYear();
  386. this.month = end.getMonth() + 1;
  387. this.day = end.getDate();
  388. }
  389. this.isStart = true;
  390. this.changeData();
  391. },
  392. //日期处理
  393. initDate(date) {
  394. let fdate = date.split('-');
  395. return {
  396. year: Number(fdate[0] || 1920),
  397. month: Number(fdate[1] || 1),
  398. day: Number(fdate[2] || 1)
  399. };
  400. },
  401. openDisAbled: function(year, month, day) {
  402. let bool = true;
  403. let date = `${year}/${month}/${day}`;
  404. // let today = this.today.replace(/\-/g, '/');
  405. let min = `${this.min.year}/${this.min.month}/${this.min.day}`;
  406. let max = `${this.max.year}/${this.max.month}/${this.max.day}`;
  407. let timestamp = new Date(date).getTime();
  408. if (timestamp >= new Date(min).getTime() && timestamp <= new Date(max).getTime()) {
  409. bool = false;
  410. }
  411. return bool;
  412. },
  413. generateArray: function(start, end) {
  414. return Array.from(new Array(end + 1).keys()).slice(start);
  415. },
  416. formatNum: function(num) {
  417. return num < 10 ? '0' + num : num + '';
  418. },
  419. stop() {
  420. return !this.isFixed;
  421. },
  422. //一个月有多少天
  423. getMonthDay(year, month) {
  424. let days = new Date(year, month, 0).getDate();
  425. return days;
  426. },
  427. getWeekday(year, month) {
  428. let date = new Date(`${year}/${month}/01 00:00:00`);
  429. return date.getDay();
  430. },
  431. checkRange(year) {
  432. let overstep = false;
  433. if (year < this.minYear || year > this.maxYear) {
  434. uni.showToast({
  435. title: '日期超出范围啦~',
  436. icon: 'none'
  437. });
  438. overstep = true;
  439. }
  440. return overstep;
  441. },
  442. changeMonth(isAdd) {
  443. if (isAdd) {
  444. let month = this.month + 1;
  445. let year = month > 12 ? this.year + 1 : this.year;
  446. if (!this.checkRange(year)) {
  447. this.month = month > 12 ? 1 : month;
  448. this.year = year;
  449. this.changeData();
  450. }
  451. } else {
  452. let month = this.month - 1;
  453. let year = month < 1 ? this.year - 1 : this.year;
  454. if (!this.checkRange(year)) {
  455. this.month = month < 1 ? 12 : month;
  456. this.year = year;
  457. this.changeData();
  458. }
  459. }
  460. },
  461. changeYear(isAdd) {
  462. let year = isAdd ? this.year + 1 : this.year - 1;
  463. if (!this.checkRange(year)) {
  464. this.year = year;
  465. this.changeData();
  466. }
  467. },
  468. changeData() {
  469. this.days = this.getMonthDay(this.year, this.month);
  470. this.daysArr = this.generateArray(1, this.days);
  471. this.weekday = this.getWeekday(this.year, this.month);
  472. this.weekdayArr = this.generateArray(1, this.weekday);
  473. this.showTitle = `${this.year}年${this.month}月`;
  474. if (this.isChange && this.type == 1) {
  475. this.btnFix(true);
  476. }
  477. },
  478. dateClick: function(day) {
  479. day += 1;
  480. if (!this.openDisAbled(this.year, this.month, day)) {
  481. this.day = day;
  482. let date = `${this.year}-${this.month}-${day}`;
  483. if (this.type == 1) {
  484. this.activeDate = date;
  485. } else {
  486. let compare = new Date(date.replace(/\-/g, '/')).getTime() < new Date(this.startDate.replace(/\-/g, '/')).getTime();
  487. if (this.isStart || compare) {
  488. this.startDate = date;
  489. this.startYear = this.year;
  490. this.startMonth = this.month;
  491. this.startDay = this.day;
  492. this.endYear = 0;
  493. this.endMonth = 0;
  494. this.endDay = 0;
  495. this.endDate = '';
  496. this.activeDate = '';
  497. this.isStart = false;
  498. } else {
  499. this.endDate = date;
  500. this.endYear = this.year;
  501. this.endMonth = this.month;
  502. this.endDay = this.day;
  503. this.isStart = true;
  504. }
  505. }
  506. if (!this.isFixed) {
  507. this.btnFix();
  508. }
  509. }
  510. },
  511. show() {
  512. this.isShow = true;
  513. },
  514. hide() {
  515. this.isShow = false;
  516. this.$emit('hide', {})
  517. },
  518. getWeekText(date) {
  519. date = new Date(`${date.replace(/\-/g, '/')} 00:00:00`);
  520. let week = date.getDay();
  521. return '星期' + ['日', '一', '二', '三', '四', '五', '六'][week];
  522. },
  523. btnFix(show) {
  524. if (!show) {
  525. this.hide();
  526. }
  527. if (this.type == 1) {
  528. let arr = this.activeDate.split('-');
  529. let year = this.isChange ? this.year : Number(arr[0]);
  530. let month = this.isChange ? this.month : Number(arr[1]);
  531. let day = this.isChange ? this.day : Number(arr[2]);
  532. //当前月有多少天
  533. let days = this.getMonthDay(year, month);
  534. let result = `${year}-${this.formatNum(month)}-${this.formatNum(day)}`;
  535. let weekText = this.getWeekText(result);
  536. let isToday = false;
  537. if (`${year}-${month}-${day}` == this.today) {
  538. //今天
  539. isToday = true;
  540. }
  541. let lunar = calendar.solar2lunar(year, month, day);
  542. this.$emit('change', {
  543. year: year,
  544. month: month,
  545. day: day,
  546. days: days,
  547. result: result,
  548. week: weekText,
  549. isToday: isToday,
  550. switch: show, //是否是切换年月操作
  551. lunar: lunar
  552. });
  553. } else {
  554. if (!this.startDate || !this.endDate) return;
  555. let startMonth = this.formatNum(this.startMonth);
  556. let startDay = this.formatNum(this.startDay);
  557. let startDate = `${this.startYear}-${startMonth}-${startDay}`;
  558. let startWeek = this.getWeekText(startDate);
  559. let startLunar = calendar.solar2lunar(this.startYear, startMonth, startDay);
  560. let endMonth = this.formatNum(this.endMonth);
  561. let endDay = this.formatNum(this.endDay);
  562. let endDate = `${this.endYear}-${endMonth}-${endDay}`;
  563. let endWeek = this.getWeekText(endDate);
  564. let endLunar = calendar.solar2lunar(this.endYear, endMonth, endDay);
  565. this.$emit('change', {
  566. startYear: this.startYear,
  567. startMonth: this.startMonth,
  568. startDay: this.startDay,
  569. startDate: startDate,
  570. startWeek: startWeek,
  571. startLunar: startLunar,
  572. endYear: this.endYear,
  573. endMonth: this.endMonth,
  574. endDay: this.endDay,
  575. endDate: endDate,
  576. endWeek: endWeek,
  577. endLunar: endLunar
  578. });
  579. }
  580. }
  581. }
  582. };
  583. </script>
  584. <style scoped>
  585. @font-face {
  586. font-family: 'tuiDateFont';
  587. src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAVgAA0AAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAFRAAAABoAAAAci0/w50dERUYAAAUkAAAAHgAAAB4AKQANT1MvMgAAAaAAAABDAAAAVjxuSNNjbWFwAAAB+AAAAEoAAAFS5iPQt2dhc3AAAAUcAAAACAAAAAj//wADZ2x5ZgAAAlQAAAFHAAABvPf29TBoZWFkAAABMAAAADAAAAA2GMsN3WhoZWEAAAFgAAAAHQAAACQHjAOFaG10eAAAAeQAAAATAAAAFgzQAPJsb2NhAAACRAAAABAAAAAQAOoBSG1heHAAAAGAAAAAHgAAACABEwA3bmFtZQAAA5wAAAFJAAACiCnmEVVwb3N0AAAE6AAAADQAAABLUwjqHHjaY2BkYGAAYp5Gj5/x/DZfGbhZGEDg1tUn7+F00P/LzOuY9YFcDgYmkCgAa0gNlHjaY2BkYGBu+N/AEMPCAALM6xgYGVABCwBT4AMaAAAAeNpjYGRgYGBn0GZgYgABEMkFhAwM/8F8BgANaAFLAAB42mNgZGFgnMDAysDA1Ml0hoGBoR9CM75mMGLkAIoysDIzYAUBaa4pDA7PGJ49ZG7438AQw9zA0AAUZgTJAQDrcAy8AHjaY2GAABYIDgLCBQx1AAcEAc8AeNpjYGBgZoBgGQZGBhDwAfIYwXwWBgMgzQGETAwMzxifcTx7+P8/kMUAYUkxS/6VVIXqAgNGNgY4lxGoB6QPBTAyDHsAADDkDYkAAAAAAAAAAAAAADQAagC2AN542m2QsU7DMBCG/Tt1bNPUiUnkSgiVtqKpxJAgVLVbeAa6MaK+B4JXgJWBjY21UtW5gpkdMTFX7dzApaJLhXU6n8+n//ttxtn458N79XJWZ8eMxS00C4wy9A1EP8PQncAlIQzS4WgsVtPpSmwzV3OFRqLetH5TSQMK939X61ptPZ2p2EAttNMLBRMrtschQblDeS34aY50cIkCzg/B2Y5C+VpyQxhFkRgu515O8jvU5mmPM2O0wJ5Z27vhX+yMsV437WvCdTM+GI40MgwKfuGammC0uURqeqFMfe9cxaJclkt5GMaB1hIR1VobOgpEiKq+sLZcIrJWhO3/Jw7qWlYj1Jf21FaCtmd5bevrlk28O/7A4spXTl4KTh9MTlqQ8PESBRstReic+sRj0Dni9fIqmNS/pXNWCvWOeYBmx5S9Bsn9Ah+5WtAAeNp9kD1OAzEQhZ/zByQSQiCoXVEA2vyUKRMp9Ailo0g23pBo1155nUg5AS0VB6DlGByAGyDRcgpelkmTImvt6PObmeexAZzjGwr/3yXuhBWO8ShcwREy4Sr1F+Ea+V24jhY+hRvUf4SbuFUD4RYu1BsdVO2Eu5vSbcsKZxgIV3CKJ+Eq9ZVwjfwqXMcVPoQb1L+EmxjjV7iFa2WpDOFhMEFgnEFjig3jAjEcLJIyBtahOfRmEsxMTzd6ETubOBso71dilwMeaDnngCntPbdmvkon/mDLgdSYbh4FS7YpjS4idCgbXyyc1d2oc7D9nu22tNi/a4E1x+xRDWzU/D3bM9JIbAyvkJI18jK3pBJTj2hrrPG7ZynW814IiU68y/SIx5o0dTr3bmniwOLn8owcfbS5kj33qBw+Y1kIeb/dTsQgil2GP5PYcRkAAAB42mNgYoAALjDJyIAO2MGiTIxMjMyMLIys7GmJeRmlmWZQ2pQ5OSORLaU0Mz2/FACDfwlbAAAAAf//AAIAAQAAAAwAAAAWAAAAAgABAAMABgABAAQAAAACAAAAAHjaY2BgYGQAgqtL1DlA9K2rT97DaABNlwiuAAA=)
  588. format('woff');
  589. font-weight: normal;
  590. font-style: normal;
  591. }
  592. .tui-iconfont {
  593. font-family: 'tuiDateFont' !important;
  594. font-size: 36rpx;
  595. font-style: normal;
  596. -webkit-font-smoothing: antialiased;
  597. -moz-osx-font-smoothing: grayscale;
  598. }
  599. .tui-font-close:before {
  600. content: '\e608';
  601. }
  602. .tui-font-check:before {
  603. content: '\e6e1';
  604. }
  605. .tui-font-arrowright:before {
  606. content: '\e600';
  607. }
  608. .tui-font-arrowleft:before {
  609. content: '\e601';
  610. }
  611. .tui-date-box {
  612. width: 100%;
  613. display: flex;
  614. align-items: center;
  615. justify-content: center;
  616. padding: 20rpx 0 30rpx;
  617. background-color: #fff;
  618. }
  619. .tui-calendar-radius {
  620. border-top-left-radius: 20rpx;
  621. border-top-right-radius: 20rpx;
  622. overflow: hidden;
  623. }
  624. .tui-date_time {
  625. padding: 0 16rpx;
  626. color: #333;
  627. font-size: 32rpx;
  628. line-height: 32rpx;
  629. font-weight: bold;
  630. }
  631. .tui-font-arrowleft {
  632. margin-right: 32rpx;
  633. }
  634. .tui-font-arrowright {
  635. margin-left: 32rpx;
  636. }
  637. .tui-date-header {
  638. width: 100%;
  639. display: flex;
  640. align-items: center;
  641. background-color: #fff;
  642. font-size: 24rpx;
  643. line-height: 24rpx;
  644. color: #555;
  645. box-shadow: 0 15rpx 20rpx -15rpx #efefef;
  646. position: relative;
  647. z-index: 2;
  648. }
  649. .tui-date-content {
  650. width: 100%;
  651. display: flex;
  652. flex-wrap: wrap;
  653. padding: 12rpx 0;
  654. box-sizing: border-box;
  655. background-color: #fff;
  656. position: relative;
  657. }
  658. .tui-flex-start {
  659. align-content: flex-start;
  660. }
  661. .tui-bg-month {
  662. position: absolute;
  663. font-size: 260rpx;
  664. line-height: 260rpx;
  665. left: 50%;
  666. top: 50%;
  667. transform: translate(-50%, -50%);
  668. color: #f5f5f7;
  669. z-index: 1;
  670. }
  671. .tui-date {
  672. width: 14.2857%;
  673. display: flex;
  674. align-items: center;
  675. justify-content: center;
  676. padding: 12rpx 0;
  677. overflow: hidden;
  678. position: relative;
  679. z-index: 2;
  680. }
  681. .tui-date-pd_0 {
  682. padding: 0 !important;
  683. }
  684. .tui-start-date {
  685. border-top-left-radius: 8rpx;
  686. border-bottom-left-radius: 8rpx;
  687. }
  688. .tui-end-date {
  689. border-top-right-radius: 8rpx;
  690. border-bottom-right-radius: 8rpx;
  691. }
  692. .tui-date-text {
  693. width: 80rpx;
  694. height: 80rpx;
  695. display: flex;
  696. align-items: center;
  697. justify-content: center;
  698. flex-direction: column;
  699. font-size: 32rpx;
  700. line-height: 32rpx;
  701. position: relative;
  702. border-radius: 50%;
  703. }
  704. .tui-btn-calendar {
  705. padding: 16rpx;
  706. box-sizing: border-box;
  707. text-align: center;
  708. text-decoration: none;
  709. }
  710. .tui-opacity {
  711. opacity: 0.5;
  712. }
  713. .tui-bottom-popup {
  714. width: 100%;
  715. position: fixed;
  716. left: 0;
  717. right: 0;
  718. bottom: 0;
  719. z-index: 9999;
  720. visibility: hidden;
  721. transform: translate3d(0, 100%, 0);
  722. transform-origin: center;
  723. transition: all 0.3s ease-in-out;
  724. min-height: 20rpx;
  725. }
  726. .tui-popup-show {
  727. transform: translate3d(0, 0, 0);
  728. visibility: visible;
  729. }
  730. .tui-popup-mask {
  731. position: fixed;
  732. top: 0;
  733. left: 0;
  734. right: 0;
  735. bottom: 0;
  736. background: rgba(0, 0, 0, 0.6);
  737. z-index: 9996;
  738. transition: all 0.3s ease-in-out;
  739. opacity: 0;
  740. visibility: hidden;
  741. }
  742. .tui-mask-show {
  743. opacity: 1;
  744. visibility: visible;
  745. }
  746. .tui-calendar-header {
  747. width: 100%;
  748. height: 80rpx;
  749. padding: 0 40rpx;
  750. display: flex;
  751. justify-content: center;
  752. align-items: center;
  753. box-sizing: border-box;
  754. font-size: 30rpx;
  755. background-color: #fff;
  756. color: #555;
  757. position: relative;
  758. }
  759. .tui-font-close {
  760. position: absolute;
  761. right: 30rpx;
  762. top: 50%;
  763. transform: translateY(-50%);
  764. color: #999;
  765. }
  766. .tui-btn-calendar {
  767. padding: 16rpx;
  768. box-sizing: border-box;
  769. text-align: center;
  770. text-decoration: none;
  771. }
  772. .tui-font-check {
  773. color: #fff;
  774. font-size: 54rpx;
  775. line-height: 54rpx;
  776. }
  777. .tui-custom-desc {
  778. width: 100%;
  779. font-size: 24rpx;
  780. line-height: 24rpx;
  781. transform: scale(0.8);
  782. transform-origin: center center;
  783. text-align: center;
  784. }
  785. .tui-lunar-unshow {
  786. position: absolute;
  787. left: 0;
  788. bottom: 8rpx;
  789. z-index: 2;
  790. }
  791. .tui-date-desc {
  792. width: 100%;
  793. font-size: 24rpx;
  794. line-height: 24rpx;
  795. position: absolute;
  796. left: 0;
  797. transform: scale(0.8);
  798. transform-origin: center center;
  799. text-align: center;
  800. bottom: 8rpx;
  801. z-index: 2;
  802. }
  803. .tui-calendar-op {
  804. width: 100%;
  805. display: flex;
  806. align-items: center;
  807. justify-content: center;
  808. flex-direction: column;
  809. background-color: #fff;
  810. padding: 0 42rpx 30rpx;
  811. box-sizing: border-box;
  812. font-size: 24rpx;
  813. color: #666;
  814. }
  815. .tui-calendar-result {
  816. height: 48rpx;
  817. transform: scale(0.9);
  818. transform-origin: center 100%;
  819. }
  820. .tui-calendar-btn_box {
  821. width: 100%;
  822. }
  823. </style>