tui-calendar.vue 22 KB

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