uni-calendar.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. <template>
  2. <view>
  3. <view class="uni-calendar__box">
  4. <view class="uni-calendar__wrapper">
  5. <view class="uni-calenda__content">
  6. <view class="uni-calendar__panel">
  7. <view class="uni-calendar__date-befor" @tap="dataBefor('0', 'month')">
  8. <text class="iconfont icon-jiantou" />
  9. </view>
  10. <view class="uni-calendar__panel-box">
  11. <view>{{ canlender.year }}</view>
  12. <view>{{ canlender.month }}</view>
  13. </view>
  14. <view class="uni-calendar__date-after uni-calendar__rollback" @tap="dataBefor('1', 'month')">
  15. <text class="iconfont icon-jiantou " />
  16. </view>
  17. <view class="uni-calendar__backtoday" @tap="backtoday">回到今天</view>
  18. </view>
  19. <view v-if="lunar" class="uni-calendar__day-detail">
  20. <view>
  21. {{
  22. canlender.year +
  23. '年' +
  24. canlender.month +
  25. '月' +
  26. canlender.date +
  27. '日 (' +
  28. canlender.lunar.astro +
  29. ')'
  30. }}
  31. </view>
  32. <view>
  33. {{
  34. canlender.lunar.gzYear +
  35. '年' +
  36. canlender.lunar.gzMonth +
  37. '月' +
  38. canlender.lunar.gzDay +
  39. '日 (' +
  40. canlender.lunar.Animal +
  41. '年)'
  42. }}
  43. {{ canlender.lunar.IMonthCn + canlender.lunar.IDayCn }}
  44. {{ canlender.lunar.isTerm ? canlender.lunar.Term : '' }}
  45. </view>
  46. </view>
  47. <view class="uni-calendar__header">
  48. <view class="uni-calendar__week"></view>
  49. <view class="uni-calendar__week"></view>
  50. <view class="uni-calendar__week"></view>
  51. <view class="uni-calendar__week"></view>
  52. <view class="uni-calendar__week"></view>
  53. <view class="uni-calendar__week"></view>
  54. <view class="uni-calendar__week"></view>
  55. </view>
  56. <uni-calendar-item v-if="slide === 'none'" :canlender="canlender" :lunar="lunar" @selectDays="selectDays" />
  57. <swiper v-else :style="{ height: domHeihgt + 'px' }" :current="currentIndex" :vertical="slide === 'vertical' ? true : false" :duration="duration" class="uni-calendar__body" circular skip-hidden-item-layout @animationfinish="animationfinish" @change="change">
  58. <swiper-item v-for="(item, itemindx) in swiperData" :key="itemindx">
  59. <view :class="elClass">
  60. <uni-calendar-item :canlender="item" :lunar="lunar" @selectDays="selectDays" />
  61. </view>
  62. </swiper-item>
  63. </swiper>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import CALENDAR from './calendar.js'
  71. import uniCalendarItem from './uni-calendar-item'
  72. export default {
  73. name: 'UniCalendar',
  74. components: {
  75. uniCalendarItem
  76. },
  77. props: {
  78. /**
  79. * 当前日期
  80. */
  81. date: {
  82. type: String,
  83. default: ''
  84. },
  85. /**
  86. * 打点日期
  87. */
  88. selected: {
  89. type: Array,
  90. default () {
  91. return []
  92. }
  93. },
  94. /**
  95. * 是否开启阴历日期
  96. */
  97. lunar: {
  98. type: Boolean,
  99. default: false
  100. },
  101. /**
  102. * 是否禁用今天之前的日期
  103. */
  104. disableBefore: {
  105. type: Boolean,
  106. default: false
  107. },
  108. /**
  109. * 开始时间
  110. */
  111. startDate: {
  112. type: String,
  113. default: ''
  114. },
  115. /**
  116. * 结束时间
  117. */
  118. endDate: {
  119. type: String,
  120. default: ''
  121. },
  122. /**
  123. * 滑动方向,none 为禁止滑动 可选值 horizontal vertical
  124. */
  125. slide: {
  126. type: String,
  127. default: 'horizontal'
  128. },
  129. fixedHeihgt: {
  130. type: Boolean,
  131. default: true
  132. }
  133. },
  134. data() {
  135. /**
  136. * TODO 兼容新旧编译器
  137. * 新编译器(自定义组件模式)下必须使用固定数值,否则部分平台下会获取不到节点。
  138. * 随机数值是在旧编译器下使用的,旧编译器模式已经不推荐使用,后续直接废掉随机数值的写法。
  139. */
  140. const elClass = this.__call_hook ? 'uni_canlender' : `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
  141. return {
  142. dateShow: false, // 日期是否选择
  143. selectDay: '', // 当前选择日期
  144. canlender: {
  145. weeks: []
  146. },
  147. domHeihgt: 254,
  148. swiperData: [],
  149. currentIndex: 0,
  150. currentSelDate: '',
  151. duration: 200,
  152. hold: false,
  153. isSilde: false,
  154. isClick: false,
  155. elClass: elClass
  156. }
  157. },
  158. watch: {
  159. selected(newVal) {
  160. let canlender = this.canlender
  161. // 打卡之后更新信息
  162. this.isSilde = true
  163. this.getMonthAll(
  164. this.currentIndex,
  165. canlender.year + '-' + canlender.month + '-' + canlender.date
  166. )
  167. }
  168. },
  169. created() {
  170. // 可以执行函数,返回给用户值
  171. this.isSilde = true
  172. if (this.slide === 'none') {
  173. this.getMonthAll(0, this.date, true)
  174. } else {
  175. this.getMonthAll(1, this.date, true)
  176. this.getQueryDom(1)
  177. }
  178. },
  179. methods: {
  180. /**
  181. * 滑动切换月份
  182. */
  183. animationfinish(e) {
  184. let index = e.detail.current
  185. let date =
  186. this.swiperData[index].year +
  187. '-' +
  188. this.swiperData[index].month +
  189. '-' +
  190. this.swiperData[index].date
  191. this.currentIndex = index
  192. this.getMonthAll(index, date)
  193. clearTimeout(this.timer)
  194. this.duration = 200
  195. },
  196. change(e) {
  197. let index = e.detail.current
  198. // 可以执行函数,返回给用户值
  199. this.isSilde = true
  200. this.getQueryDom(index)
  201. },
  202. /**
  203. * 获取全部月份
  204. */
  205. getMonthAll(index, date, first) {
  206. if (date === '') {
  207. date = new Date()
  208. }
  209. let canlender = this.getWeek(date)
  210. this.currentSelDate = canlender.date
  211. let tempyear = canlender.year + '-' + canlender.month + '-1'
  212. let tempbefore = this.getWeek(this.getDate(tempyear, -1, 'month'))
  213. let tempafter = this.getWeek(this.getDate(tempyear, +1, 'month'))
  214. let beforeyear =
  215. canlender.year +
  216. '-' +
  217. canlender.month +
  218. '-' +
  219. (canlender.date > tempbefore.lastDate ? tempbefore.lastDate : canlender.date)
  220. let afteryear =
  221. canlender.year +
  222. '-' +
  223. canlender.month +
  224. '-' +
  225. (canlender.date > tempafter.lastDate ? tempafter.lastDate : canlender.date)
  226. let before = this.getWeek(this.getDate(beforeyear, -1, 'month'))
  227. let after = this.getWeek(this.getDate(afteryear, +1, 'month'))
  228. this.selectDay = canlender.month + '月' + canlender.date + '日'
  229. this.canlender = canlender
  230. if (this.slide === 'none') {
  231. // console.log(before);
  232. this.duration = 0
  233. this.currentIndex = 0
  234. if (first && index === 0) {
  235. // console.log('第一次进入');
  236. this.canlender = canlender
  237. } else {
  238. if (index === 0) {
  239. this.canlender = canlender
  240. }
  241. if (index === -1) {
  242. this.canlender = before
  243. }
  244. if (index === 1) {
  245. this.canlender = after
  246. }
  247. }
  248. this.selectDay = canlender.month + '月' + canlender.date + '日'
  249. this.hold = false
  250. // console.log(this.canlender)
  251. this.setEmit(this.canlender)
  252. return
  253. }
  254. this.setEmit(canlender)
  255. this.currentIndex = index
  256. if (first && index === 1) {
  257. this.swiperData.push(before)
  258. this.swiperData.push(canlender)
  259. this.swiperData.push(after)
  260. return
  261. }
  262. if (index === 0) {
  263. this.swiperData[0] = canlender
  264. this.swiperData[1] = after
  265. this.swiperData[2] = before
  266. return
  267. }
  268. if (index === 1) {
  269. this.swiperData[0] = before
  270. this.swiperData[1] = canlender
  271. this.swiperData[2] = after
  272. return
  273. }
  274. if (index === 2) {
  275. this.swiperData[0] = after
  276. this.swiperData[1] = before
  277. this.swiperData[2] = canlender
  278. }
  279. },
  280. setEmit(canlender) {
  281. if (this.isSilde) {
  282. let isClick = ''
  283. if (this.isClick) {
  284. isClick = 'to-click'
  285. this.isClick = false
  286. } else {
  287. isClick = 'change'
  288. }
  289. this.$emit(isClick, {
  290. year: canlender.year,
  291. month: canlender.month,
  292. date: canlender.date,
  293. lunar: canlender.lunar,
  294. clockinfo: canlender.clockinfo || {},
  295. fulldate: canlender.year + '-' + canlender.month + '-' + canlender.date
  296. })
  297. this.isSilde = false
  298. }
  299. },
  300. /**
  301. * 计算阴历日期显示
  302. */
  303. getlunar(year, month, date) {
  304. return CALENDAR.solar2lunar(year, month, date).IDayCn
  305. },
  306. /**
  307. * 今天之前的日期是否可选
  308. */
  309. isDisableBefore(year, month, date) {
  310. let nowDate = this.date ? this.date : new Date()
  311. let time = year + '-' + month + '-' + date
  312. let startDate = false
  313. let endDate = false
  314. if (this.startDate) {
  315. startDate = this.dateCompare(this.startDate, time)
  316. }
  317. if (this.endDate) {
  318. endDate = this.dateCompare(this.getDate(this.endDate, 1), time)
  319. }
  320. if (this.disableBefore) {
  321. if (!this.startDate) {
  322. if (!this.endDate) {
  323. return !this.dateCompare(this.getDate(nowDate, 0), time)
  324. } else {
  325. return !this.dateCompare(this.getDate(nowDate, 0), time) || endDate
  326. }
  327. } else {
  328. return (
  329. !this.dateCompare(this.getDate(nowDate, 0), time) || !startDate || endDate
  330. )
  331. }
  332. } else {
  333. if (!this.startDate) {
  334. if (!this.endDate) {
  335. return false
  336. } else {
  337. return endDate
  338. }
  339. } else {
  340. return !startDate || endDate
  341. }
  342. // return false ;
  343. }
  344. },
  345. /**
  346. * 返回今天
  347. */
  348. backtoday() {
  349. if (this.hold) {
  350. return
  351. }
  352. this.hold = true
  353. this.duration = 0
  354. clearTimeout(this.indexTimer)
  355. this.indexTimer = setTimeout(() => {
  356. // 可以执行函数,返回给用户值
  357. this.isSilde = true
  358. if (this.slide === 'none') {
  359. this.getMonthAll(0, this.date)
  360. } else {
  361. this.getMonthAll(1, this.date)
  362. }
  363. this.hold = false
  364. }, 200)
  365. },
  366. /**
  367. * 前一月|| 后一月
  368. */
  369. dataBefor(id, types) {
  370. // 避免重复输入
  371. if (this.hold) {
  372. return
  373. }
  374. this.hold = true
  375. // 可以执行函数,返回给用户值
  376. this.isSilde = true
  377. if (this.slide === 'none') {
  378. let num = 0
  379. if (id === '0') {
  380. num = -1
  381. } else {
  382. num = 1
  383. }
  384. let year =
  385. this.canlender.year + '-' + this.canlender.month + '-' + this.canlender.date
  386. this.getMonthAll(num, year)
  387. return
  388. }
  389. let index = this.currentIndex
  390. this.duration = 0
  391. if (id === '0') {
  392. index--
  393. if (index < 0) index = 2
  394. } else {
  395. index++
  396. if (index > 2) index = 0
  397. }
  398. clearTimeout(this.indexTimer)
  399. this.indexTimer = setTimeout(() => {
  400. this.currentIndex = index
  401. this.hold = false
  402. }, 200)
  403. },
  404. /**
  405. * 选择当前的日期
  406. * week 当前的周
  407. * index 点击的下标索引
  408. * ischeck 是否选中
  409. */
  410. selectDays(params) {
  411. let {
  412. week,
  413. index,
  414. ischeck,
  415. isDay
  416. } = params
  417. let canlender = null
  418. if (this.slide === 'none') {
  419. canlender = this.canlender
  420. } else {
  421. canlender = this.swiperData[this.currentIndex]
  422. }
  423. if (!ischeck) return false
  424. if (isDay) return false
  425. // console.log(isDay);
  426. let month =
  427. canlender.weeks[week][index].month < 10 ? '0' + canlender.weeks[week][index].month : canlender.weeks[week][index].month
  428. let date = canlender.weeks[week][index].date < 10 ? '0' +
  429. canlender.weeks[week][index].date :
  430. canlender.weeks[week][index].date
  431. // this.getWeek(canlender.year + '-' + month + '-' + date);
  432. let indexNum = 0
  433. if (this.slide !== 'none') {
  434. indexNum = this.currentIndex
  435. }
  436. // 可以执行函数,返回给用户值
  437. this.isSilde = true
  438. this.isClick = true
  439. this.getMonthAll(indexNum, canlender.year + '-' + month + '-' + date)
  440. },
  441. // 获取日历内容
  442. getWeek(dateData) {
  443. let selected = this.selected
  444. let nowDate = this.getDate(this.date)
  445. // 判断当前是 安卓还是ios ,传入不容的日期格式
  446. if (typeof dateData !== 'object') {
  447. dateData = dateData.replace(/-/g, '/')
  448. }
  449. let _date = new Date(dateData)
  450. let year = _date.getFullYear() // 年
  451. let month = _date.getMonth() + 1 // 月
  452. let date = _date.getDate() // 日
  453. let day = _date.getDay() // 天
  454. let canlender = []
  455. // console.log(selected)
  456. let dates = {
  457. firstDay: new Date(year, month - 1, 1).getDay(),
  458. lastMonthDays: [], // 上个月末尾几天
  459. currentMonthDys: [], // 本月天数
  460. nextMonthDays: [], // 下个月开始几天
  461. endDay: new Date(year, month, 0).getDay(),
  462. weeks: []
  463. }
  464. // 循环上个月末尾几天添加到数组
  465. for (let i = dates.firstDay; i > 0; i--) {
  466. let beforeDate = new Date(year, month - 1, -i + 1).getDate() + ''
  467. dates.lastMonthDays.push({
  468. date: beforeDate,
  469. month: month - 1,
  470. disable: this.isDisableBefore(year, month - 1, beforeDate),
  471. lunar: this.getlunar(year, month - 1, beforeDate),
  472. isDay: false
  473. })
  474. }
  475. let clockinfo = {
  476. have: false
  477. }
  478. // 循环本月天数添加到数组
  479. for (let i = 1; i <= new Date(year, month, 0).getDate(); i++) {
  480. let have = false
  481. let clockinfoTemp = {}
  482. // 处理打卡信息
  483. for (let j = 0; j < selected.length; j++) {
  484. let selDate = selected[j].date.split('-')
  485. if (
  486. Number(year) === Number(selDate[0]) &&
  487. Number(month) === Number(selDate[1]) &&
  488. Number(i) === Number(selDate[2])
  489. ) {
  490. have = true
  491. clockinfoTemp.have = true
  492. clockinfoTemp.date = selected[j].date
  493. if (selected[j].info) {
  494. clockinfoTemp.info = selected[j].info
  495. }
  496. if (
  497. JSON.stringify(selected[j].data) === '{}' ||
  498. selected[j].data !== undefined
  499. ) {
  500. clockinfoTemp.data = selected[j].data
  501. }
  502. if (
  503. Number(year) === Number(selDate[0]) &&
  504. Number(month) === Number(selDate[1]) &&
  505. Number(date) === Number(selDate[2])
  506. ) {
  507. clockinfo = clockinfoTemp
  508. }
  509. }
  510. }
  511. dates.currentMonthDys.push({
  512. date: i + '',
  513. month: month,
  514. have,
  515. clockinfo: clockinfoTemp,
  516. disable: this.isDisableBefore(year, month, i + ''),
  517. lunar: this.getlunar(year, month, i + ''),
  518. isDay: nowDate ===
  519. year +
  520. '-' +
  521. (month < 10 ? '0' + month : month) +
  522. '-' +
  523. (i < 10 ? '0' + i : i)
  524. })
  525. }
  526. let surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length)
  527. if (!this.fixedHeihgt) {
  528. surplus = 6 - dates.endDay
  529. }
  530. // 循环下个月开始几天 添加到数组
  531. for (let i = 1; i < surplus + 1; i++) {
  532. dates.nextMonthDays.push({
  533. date: i + '',
  534. month: month + 1,
  535. disable: this.isDisableBefore(year, month + 1, i + ''),
  536. lunar: this.getlunar(year, month + 1, i + ''),
  537. isDay: false
  538. })
  539. }
  540. canlender = canlender.concat(
  541. dates.lastMonthDays,
  542. dates.currentMonthDys,
  543. dates.nextMonthDays
  544. )
  545. // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
  546. for (let i = 0; i < canlender.length; i++) {
  547. if (i % 7 === 0) {
  548. dates.weeks[parseInt(i / 7)] = new Array(7)
  549. }
  550. dates.weeks[parseInt(i / 7)][i % 7] = canlender[i]
  551. }
  552. return {
  553. weeks: dates.weeks,
  554. month: month,
  555. date: date,
  556. day: day,
  557. year: year,
  558. clockinfo,
  559. lunar: CALENDAR.solar2lunar(year, month, date),
  560. lastDate: dates.currentMonthDys[dates.currentMonthDys.length - 1].date
  561. }
  562. },
  563. /**
  564. * 时间计算
  565. */
  566. getDate(date, AddDayCount = 0, str = 'day') {
  567. if (typeof date !== 'object') {
  568. date = date.replace(/-/g, '/')
  569. }
  570. let dd = new Date(date)
  571. switch (str) {
  572. case 'day':
  573. dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
  574. break
  575. case 'month':
  576. dd.setMonth(dd.getMonth() + AddDayCount) // 获取AddDayCount天后的日期
  577. break
  578. case 'year':
  579. dd.setFullYear(dd.getFullYear() + AddDayCount) // 获取AddDayCount天后的日期
  580. break
  581. }
  582. let y = dd.getFullYear()
  583. let m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
  584. let d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
  585. return y + '-' + m + '-' + d
  586. },
  587. /**
  588. * 计算时间大小
  589. */
  590. dateCompare(startDate, endDate) {
  591. // 计算截止时间
  592. startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
  593. // 计算详细项的截止时间
  594. endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
  595. if (startDate <= endDate) {
  596. return true
  597. } else {
  598. return false
  599. }
  600. },
  601. getQueryDom(index) {
  602. let dom = uni.createSelectorQuery().in(this).selectAll(`.${this.elClass}`)
  603. dom.boundingClientRect(rect => {}).exec(e => {
  604. if (!e[0][index]) {
  605. setTimeout(() => this.getQueryDom(1), 50)
  606. return
  607. }
  608. // console.log(e[0][index])
  609. if (e[0][index]) {
  610. this.domHeihgt = e[0][index].height
  611. }
  612. })
  613. }
  614. }
  615. }
  616. </script>
  617. <style>
  618. @charset "UTF-8";
  619. @font-face {
  620. font-family: iconfont;
  621. src: url(//at.alicdn.com/t/font_989023_qdgy7euvg4.eot?t=1545961121132);
  622. src: url(//at.alicdn.com/t/font_989023_qdgy7euvg4.eot?t=1545961121132#iefix) format("embedded-opentype"), url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAPcAAsAAAAABiAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8fEf5Y21hcAAAAYAAAABLAAABcOcutbxnbHlmAAABzAAAACgAAAAoOZ2GtGhlYWQAAAH0AAAALwAAADYTtoNAaGhlYQAAAiQAAAAcAAAAJAfeA4NobXR4AAACQAAAAAgAAAAICAAAAGxvY2EAAAJIAAAABgAAAAYAFAAAbWF4cAAAAlAAAAAeAAAAIAENABJuYW1lAAACcAAAAUUAAAJtPlT+fXBvc3QAAAO4AAAAIQAAADLf6deseJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByesT1jY27438AQw9zI0AAUZgTJAQDeIAvweJxjYGBgZWBgYAZiHSBmYWBgDGFgZAABP6AoI1icmYELLM7CoARWwwISf8b2/z+MBPJZwCQDIxvDKOABkzJQHjisIJiBEQA3lgmBAAABAAD/gAMAA4EABQAACQE1CQE1AQACAP6IAXgBgP4AiAF4AXiIAAB4nGNgZGBgAOLdZzma4vltvjJwszCAwA3v+QsR9P8GFgbmRiCXg4EJJAoAMzgKmgB4nGNgZGBgbvjfwBDDwgACQJKRARUwAQBHCAJrBAAAAAQAAAAAAAAAABQAAHicY2BkYGBgYmBjANEgFgMDFxAyMPwH8xkACS0BIAAAeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicY2BigAAuBuyAiZGJkZmBIyszMa8kv9SEgQEAGD0DTAAAAA==") format("woff"), url(//at.alicdn.com/t/font_989023_qdgy7euvg4.ttf?t=1545961121132) format("truetype"), url(//at.alicdn.com/t/font_989023_qdgy7euvg4.svg?t=1545961121132#iconfont) format("svg")
  623. }
  624. .iconfont {
  625. font-family: iconfont !important;
  626. font-size: 32upx;
  627. font-style: normal;
  628. -webkit-font-smoothing: antialiased;
  629. -moz-osx-font-smoothing: grayscale
  630. }
  631. .icon-jiantou:before {
  632. content: '\e606'
  633. }
  634. .header {
  635. display: flex;
  636. justify-content: center;
  637. align-items: center;
  638. position: relative;
  639. height: 100upx;
  640. background: #fff;
  641. z-index: 10000;
  642. font-size: 32upx
  643. }
  644. .uni-calendar__box {
  645. width: 100%;
  646. box-sizing: border-box;
  647. transition: all .3s
  648. }
  649. .uni-calendar__wrapper {
  650. width: 100%;
  651. box-sizing: border-box;
  652. font-size: 26rpx;
  653. background: #fff;
  654. transition: all .3s
  655. }
  656. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel {
  657. position: relative;
  658. display: flex;
  659. align-items: center;
  660. justify-content: center;
  661. font-size: 28rpx;
  662. height: 80rpx
  663. }
  664. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel .uni-calendar__date-after,
  665. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel .uni-calendar__date-befor {
  666. display: flex;
  667. justify-content: center;
  668. align-items: center;
  669. height: 80rpx;
  670. width: 80rpx;
  671. text-align: center;
  672. line-height: 80rpx
  673. }
  674. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel .uni-calendar__date-after.uni-calendar__rollback,
  675. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel .uni-calendar__date-befor.uni-calendar__rollback {
  676. transform: rotate(180deg)
  677. }
  678. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel .uni-calendar__panel-box {
  679. display: flex;
  680. justify-content: center;
  681. align-items: center;
  682. width: 200upx
  683. }
  684. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__panel .uni-calendar__backtoday {
  685. position: absolute;
  686. right: 0;
  687. top: 15rpx;
  688. padding: 0 10rpx;
  689. padding-left: 20rpx;
  690. height: 50rpx;
  691. line-height: 50rpx;
  692. border: 1px rgba(253, 46, 50, .5) solid;
  693. border-right: none;
  694. font-size: 24rpx;
  695. border-top-left-radius: 50rpx;
  696. border-bottom-left-radius: 50rpx;
  697. color: rgba(253, 46, 50, .7);
  698. background: rgba(241, 233, 233, .4)
  699. }
  700. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__day-detail {
  701. padding: 20upx;
  702. padding-left: 30upx;
  703. border-top: 1px #f5f5f5 solid
  704. }
  705. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__header {
  706. display: flex;
  707. font-size: 28upx;
  708. border-top: 1px #f5f5f5 solid
  709. }
  710. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__header .uni-calendar__week {
  711. width: 100%;
  712. text-align: center;
  713. line-height: 80rpx;
  714. color: #333;
  715. font-weight: 700
  716. }
  717. .uni-calendar__wrapper .uni-calenda__content .uni-calendar__body {
  718. display: flex;
  719. flex-wrap: wrap;
  720. font-size: 28upx
  721. }
  722. </style>