calendar.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. <template>
  2. <view class="uni-calendar" @mouseleave="leaveCale">
  3. <view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
  4. @click="clean"></view>
  5. <view v-if="insert || show" class="uni-calendar__content"
  6. :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}">
  7. <view class="uni-calendar__header">
  8. <view v-if="left" class="uni-calendar__header-btn-box" @click.stop="pre">
  9. <view class="uni-calendar__header-btn uni-calendar--left"></view>
  10. </view>
  11. <picker mode="date" :value="date" fields="month" @change="bindDateChange">
  12. <text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text>
  13. </picker>
  14. <view v-if="right" class="uni-calendar__header-btn-box" @click.stop="next">
  15. <view class="uni-calendar__header-btn uni-calendar--right"></view>
  16. </view>
  17. <!-- <text class="uni-calendar__backtoday" @click="backtoday">回到今天</text> -->
  18. </view>
  19. <view class="uni-calendar__box">
  20. <view v-if="showMonth" class="uni-calendar__box-bg">
  21. <text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
  22. </view>
  23. <view class="uni-calendar__weeks">
  24. <view class="uni-calendar__weeks-day">
  25. <text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
  26. </view>
  27. <view class="uni-calendar__weeks-day">
  28. <text class="uni-calendar__weeks-day-text">{{monText}}</text>
  29. </view>
  30. <view class="uni-calendar__weeks-day">
  31. <text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
  32. </view>
  33. <view class="uni-calendar__weeks-day">
  34. <text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
  35. </view>
  36. <view class="uni-calendar__weeks-day">
  37. <text class="uni-calendar__weeks-day-text">{{THUText}}</text>
  38. </view>
  39. <view class="uni-calendar__weeks-day">
  40. <text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
  41. </view>
  42. <view class="uni-calendar__weeks-day">
  43. <text class="uni-calendar__weeks-day-text">{{SATText}}</text>
  44. </view>
  45. </view>
  46. <view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
  47. <view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
  48. <calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar"
  49. :selected="selected" :lunar="lunar" :checkHover="range" @change="choiceDate"
  50. @handleMouse="handleMouse">
  51. </calendar-item>
  52. </view>
  53. </view>
  54. </view>
  55. <view v-if="!insert && !range && typeHasTime" class="uni-date-changed uni-calendar--fixed-top"
  56. style="padding: 0 80px;">
  57. <view class="uni-date-changed--time-date">{{tempSingleDate ? tempSingleDate : selectDateText}}</view>
  58. <time-picker type="time" :start="reactStartTime" :end="reactEndTime" v-model="time"
  59. :disabled="!tempSingleDate" :border="false" :hide-second="hideSecond" class="time-picker-style">
  60. </time-picker>
  61. </view>
  62. <view v-if="!insert && range && typeHasTime" class="uni-date-changed uni-calendar--fixed-top">
  63. <view class="uni-date-changed--time-start">
  64. <view class="uni-date-changed--time-date">{{tempRange.before ? tempRange.before : startDateText}}
  65. </view>
  66. <time-picker type="time" :start="reactStartTime" v-model="timeRange.startTime" :border="false" :hide-second="hideSecond"
  67. :disabled="!tempRange.before" class="time-picker-style">
  68. </time-picker>
  69. </view>
  70. <uni-icons type="arrowthinright" color="#999" style="line-height: 50px;"></uni-icons>
  71. <view class="uni-date-changed--time-end">
  72. <view class="uni-date-changed--time-date">{{tempRange.after ? tempRange.after : endDateText}}</view>
  73. <time-picker type="time" :end="reactEndTime" v-model="timeRange.endTime" :border="false" :hide-second="hideSecond"
  74. :disabled="!tempRange.after" class="time-picker-style">
  75. </time-picker>
  76. </view>
  77. </view>
  78. <view v-if="!insert" class="uni-date-changed uni-calendar__header" @click="confirm">
  79. <view class="uni-calendar__header-btn-box">
  80. <text class="uni-calendar__button-text uni-calendar--fixed-width">{{okText}}</text>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import Calendar from './util.js';
  88. import calendarItem from './calendar-item.vue'
  89. import timePicker from './time-picker.vue'
  90. import {
  91. initVueI18n
  92. } from '@dcloudio/uni-i18n'
  93. import messages from './i18n/index.js'
  94. const {
  95. t
  96. } = initVueI18n(messages)
  97. /**
  98. * Calendar 日历
  99. * @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
  100. * @tutorial https://ext.dcloud.net.cn/plugin?id=56
  101. * @property {String} date 自定义当前时间,默认为今天
  102. * @property {Boolean} lunar 显示农历
  103. * @property {String} startDate 日期选择范围-开始日期
  104. * @property {String} endDate 日期选择范围-结束日期
  105. * @property {Boolean} range 范围选择
  106. * @property {Boolean} insert = [true|false] 插入模式,默认为false
  107. * @value true 弹窗模式
  108. * @value false 插入模式
  109. * @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
  110. * @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
  111. * @property {Boolean} showMonth 是否选择月份为背景
  112. * @event {Function} change 日期改变,`insert :ture` 时生效
  113. * @event {Function} confirm 确认选择`insert :false` 时生效
  114. * @event {Function} monthSwitch 切换月份时触发
  115. * @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
  116. */
  117. export default {
  118. components: {
  119. calendarItem,
  120. timePicker
  121. },
  122. props: {
  123. date: {
  124. type: String,
  125. default: ''
  126. },
  127. defTime: {
  128. type: [String, Object],
  129. default: ''
  130. },
  131. selectableTimes: {
  132. type: [Object],
  133. default () {
  134. return {}
  135. }
  136. },
  137. selected: {
  138. type: Array,
  139. default () {
  140. return []
  141. }
  142. },
  143. lunar: {
  144. type: Boolean,
  145. default: false
  146. },
  147. startDate: {
  148. type: String,
  149. default: ''
  150. },
  151. endDate: {
  152. type: String,
  153. default: ''
  154. },
  155. range: {
  156. type: Boolean,
  157. default: false
  158. },
  159. typeHasTime: {
  160. type: Boolean,
  161. default: false
  162. },
  163. insert: {
  164. type: Boolean,
  165. default: true
  166. },
  167. showMonth: {
  168. type: Boolean,
  169. default: true
  170. },
  171. clearDate: {
  172. type: Boolean,
  173. default: true
  174. },
  175. left: {
  176. type: Boolean,
  177. default: true
  178. },
  179. right: {
  180. type: Boolean,
  181. default: true
  182. },
  183. checkHover: {
  184. type: Boolean,
  185. default: true
  186. },
  187. hideSecond: {
  188. type: [Boolean],
  189. default: false
  190. },
  191. pleStatus: {
  192. type: Object,
  193. default () {
  194. return {
  195. before: '',
  196. after: '',
  197. data: [],
  198. fulldate: ''
  199. }
  200. }
  201. }
  202. },
  203. data() {
  204. return {
  205. show: false,
  206. weeks: [],
  207. calendar: {},
  208. nowDate: '',
  209. aniMaskShow: false,
  210. firstEnter: true,
  211. time: '',
  212. timeRange: {
  213. startTime: '',
  214. endTime: ''
  215. },
  216. tempSingleDate: '',
  217. tempRange: {
  218. before: '',
  219. after: ''
  220. }
  221. }
  222. },
  223. watch: {
  224. date: {
  225. immediate: true,
  226. handler(newVal, oldVal) {
  227. if (!this.range) {
  228. this.tempSingleDate = newVal
  229. setTimeout(() => {
  230. this.init(newVal)
  231. }, 100)
  232. }
  233. }
  234. },
  235. defTime: {
  236. immediate: true,
  237. handler(newVal, oldVal) {
  238. if (!this.range) {
  239. this.time = newVal
  240. } else {
  241. // console.log('-----', newVal);
  242. this.timeRange.startTime = newVal.start
  243. this.timeRange.endTime = newVal.end
  244. }
  245. }
  246. },
  247. startDate(val) {
  248. this.cale.resetSatrtDate(val)
  249. this.cale.setDate(this.nowDate.fullDate)
  250. this.weeks = this.cale.weeks
  251. },
  252. endDate(val) {
  253. this.cale.resetEndDate(val)
  254. this.cale.setDate(this.nowDate.fullDate)
  255. this.weeks = this.cale.weeks
  256. },
  257. selected(newVal) {
  258. this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
  259. this.weeks = this.cale.weeks
  260. },
  261. pleStatus: {
  262. immediate: true,
  263. handler(newVal, oldVal) {
  264. const {
  265. before,
  266. after,
  267. fulldate,
  268. which
  269. } = newVal
  270. this.tempRange.before = before
  271. this.tempRange.after = after
  272. setTimeout(() => {
  273. if (fulldate) {
  274. this.cale.setHoverMultiple(fulldate)
  275. if (before && after) {
  276. this.cale.lastHover = true
  277. if (this.rangeWithinMonth(after, before)) return
  278. this.setDate(before)
  279. } else {
  280. this.cale.setMultiple(fulldate)
  281. this.setDate(this.nowDate.fullDate)
  282. this.calendar.fullDate = ''
  283. this.cale.lastHover = false
  284. }
  285. } else {
  286. this.cale.setDefaultMultiple(before, after)
  287. if (which === 'left') {
  288. this.setDate(before)
  289. this.weeks = this.cale.weeks
  290. } else {
  291. this.setDate(after)
  292. this.weeks = this.cale.weeks
  293. }
  294. this.cale.lastHover = true
  295. }
  296. }, 16)
  297. }
  298. }
  299. },
  300. computed: {
  301. reactStartTime() {
  302. const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate
  303. const res = activeDate === this.startDate ? this.selectableTimes.start : ''
  304. return res
  305. },
  306. reactEndTime() {
  307. const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate
  308. const res = activeDate === this.endDate ? this.selectableTimes.end : ''
  309. return res
  310. },
  311. /**
  312. * for i18n
  313. */
  314. selectDateText() {
  315. return t("uni-datetime-picker.selectDate")
  316. },
  317. startDateText() {
  318. return this.startPlaceholder || t("uni-datetime-picker.startDate")
  319. },
  320. endDateText() {
  321. return this.endPlaceholder || t("uni-datetime-picker.endDate")
  322. },
  323. okText() {
  324. return t("uni-datetime-picker.ok")
  325. },
  326. monText() {
  327. return t("uni-calender.MON")
  328. },
  329. TUEText() {
  330. return t("uni-calender.TUE")
  331. },
  332. WEDText() {
  333. return t("uni-calender.WED")
  334. },
  335. THUText() {
  336. return t("uni-calender.THU")
  337. },
  338. FRIText() {
  339. return t("uni-calender.FRI")
  340. },
  341. SATText() {
  342. return t("uni-calender.SAT")
  343. },
  344. SUNText() {
  345. return t("uni-calender.SUN")
  346. },
  347. },
  348. created() {
  349. // 获取日历方法实例
  350. this.cale = new Calendar({
  351. // date: new Date(),
  352. selected: this.selected,
  353. startDate: this.startDate,
  354. endDate: this.endDate,
  355. range: this.range,
  356. // multipleStatus: this.pleStatus
  357. })
  358. // 选中某一天
  359. // this.cale.setDate(this.date)
  360. this.init(this.date)
  361. // this.setDay
  362. },
  363. methods: {
  364. leaveCale() {
  365. this.firstEnter = true
  366. },
  367. handleMouse(weeks) {
  368. if (weeks.disable) return
  369. if (this.cale.lastHover) return
  370. let {
  371. before,
  372. after
  373. } = this.cale.multipleStatus
  374. if (!before) return
  375. this.calendar = weeks
  376. // 设置范围选
  377. this.cale.setHoverMultiple(this.calendar.fullDate)
  378. this.weeks = this.cale.weeks
  379. // hover时,进入一个日历,更新另一个
  380. if (this.firstEnter) {
  381. this.$emit('firstEnterCale', this.cale.multipleStatus)
  382. this.firstEnter = false
  383. }
  384. },
  385. rangeWithinMonth(A, B) {
  386. const [yearA, monthA] = A.split('-')
  387. const [yearB, monthB] = B.split('-')
  388. return yearA === yearB && monthA === monthB
  389. },
  390. // 取消穿透
  391. clean() {
  392. this.close()
  393. },
  394. clearCalender() {
  395. if (this.range) {
  396. this.timeRange.startTime = ''
  397. this.timeRange.endTime = ''
  398. this.tempRange.before = ''
  399. this.tempRange.after = ''
  400. this.cale.multipleStatus.before = ''
  401. this.cale.multipleStatus.after = ''
  402. this.cale.multipleStatus.data = []
  403. this.cale.lastHover = false
  404. } else {
  405. this.time = ''
  406. this.tempSingleDate = ''
  407. }
  408. this.calendar.fullDate = ''
  409. this.setDate()
  410. },
  411. bindDateChange(e) {
  412. const value = e.detail.value + '-1'
  413. this.init(value)
  414. },
  415. /**
  416. * 初始化日期显示
  417. * @param {Object} date
  418. */
  419. init(date) {
  420. this.cale.setDate(date)
  421. this.weeks = this.cale.weeks
  422. this.nowDate = this.calendar = this.cale.getInfo(date)
  423. },
  424. // choiceDate(weeks) {
  425. // if (weeks.disable) return
  426. // this.calendar = weeks
  427. // // 设置多选
  428. // this.cale.setMultiple(this.calendar.fullDate, true)
  429. // this.weeks = this.cale.weeks
  430. // this.tempSingleDate = this.calendar.fullDate
  431. // this.tempRange.before = this.cale.multipleStatus.before
  432. // this.tempRange.after = this.cale.multipleStatus.after
  433. // this.change()
  434. // },
  435. /**
  436. * 打开日历弹窗
  437. */
  438. open() {
  439. // 弹窗模式并且清理数据
  440. if (this.clearDate && !this.insert) {
  441. this.cale.cleanMultipleStatus()
  442. // this.cale.setDate(this.date)
  443. this.init(this.date)
  444. }
  445. this.show = true
  446. this.$nextTick(() => {
  447. setTimeout(() => {
  448. this.aniMaskShow = true
  449. }, 50)
  450. })
  451. },
  452. /**
  453. * 关闭日历弹窗
  454. */
  455. close() {
  456. this.aniMaskShow = false
  457. this.$nextTick(() => {
  458. setTimeout(() => {
  459. this.show = false
  460. this.$emit('close')
  461. }, 300)
  462. })
  463. },
  464. /**
  465. * 确认按钮
  466. */
  467. confirm() {
  468. this.setEmit('confirm')
  469. this.close()
  470. },
  471. /**
  472. * 变化触发
  473. */
  474. change() {
  475. if (!this.insert) return
  476. this.setEmit('change')
  477. },
  478. /**
  479. * 选择月份触发
  480. */
  481. monthSwitch() {
  482. let {
  483. year,
  484. month
  485. } = this.nowDate
  486. this.$emit('monthSwitch', {
  487. year,
  488. month: Number(month)
  489. })
  490. },
  491. /**
  492. * 派发事件
  493. * @param {Object} name
  494. */
  495. setEmit(name) {
  496. let {
  497. year,
  498. month,
  499. date,
  500. fullDate,
  501. lunar,
  502. extraInfo
  503. } = this.calendar
  504. this.$emit(name, {
  505. range: this.cale.multipleStatus,
  506. year,
  507. month,
  508. date,
  509. time: this.time,
  510. timeRange: this.timeRange,
  511. fulldate: fullDate,
  512. lunar,
  513. extraInfo: extraInfo || {}
  514. })
  515. },
  516. /**
  517. * 选择天触发
  518. * @param {Object} weeks
  519. */
  520. choiceDate(weeks) {
  521. if (weeks.disable) return
  522. this.calendar = weeks
  523. this.calendar.userChecked = true
  524. // 设置多选
  525. this.cale.setMultiple(this.calendar.fullDate, true)
  526. this.weeks = this.cale.weeks
  527. this.tempSingleDate = this.calendar.fullDate
  528. this.tempRange.before = this.cale.multipleStatus.before
  529. this.tempRange.after = this.cale.multipleStatus.after
  530. this.change()
  531. },
  532. /**
  533. * 回到今天
  534. */
  535. backtoday() {
  536. let date = this.cale.getDate(new Date()).fullDate
  537. // this.cale.setDate(date)
  538. this.init(date)
  539. this.change()
  540. },
  541. /**
  542. * 比较时间大小
  543. */
  544. dateCompare(startDate, endDate) {
  545. // 计算截止时间
  546. startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
  547. // 计算详细项的截止时间
  548. endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
  549. if (startDate <= endDate) {
  550. return true
  551. } else {
  552. return false
  553. }
  554. },
  555. /**
  556. * 上个月
  557. */
  558. pre() {
  559. const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate
  560. this.setDate(preDate)
  561. this.monthSwitch()
  562. },
  563. /**
  564. * 下个月
  565. */
  566. next() {
  567. const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate
  568. this.setDate(nextDate)
  569. this.monthSwitch()
  570. },
  571. /**
  572. * 设置日期
  573. * @param {Object} date
  574. */
  575. setDate(date) {
  576. this.cale.setDate(date)
  577. this.weeks = this.cale.weeks
  578. this.nowDate = this.cale.getInfo(date)
  579. }
  580. }
  581. }
  582. </script>
  583. <style lang="scss" scoped>
  584. .uni-calendar {
  585. /* #ifndef APP-NVUE */
  586. display: flex;
  587. /* #endif */
  588. flex-direction: column;
  589. }
  590. .uni-calendar__mask {
  591. position: fixed;
  592. bottom: 0;
  593. top: 0;
  594. left: 0;
  595. right: 0;
  596. background-color: $uni-bg-color-mask;
  597. transition-property: opacity;
  598. transition-duration: 0.3s;
  599. opacity: 0;
  600. /* #ifndef APP-NVUE */
  601. z-index: 99;
  602. /* #endif */
  603. }
  604. .uni-calendar--mask-show {
  605. opacity: 1
  606. }
  607. .uni-calendar--fixed {
  608. position: fixed;
  609. bottom: calc(var(--window-bottom));
  610. left: 0;
  611. right: 0;
  612. transition-property: transform;
  613. transition-duration: 0.3s;
  614. transform: translateY(460px);
  615. /* #ifndef APP-NVUE */
  616. z-index: 99;
  617. /* #endif */
  618. }
  619. .uni-calendar--ani-show {
  620. transform: translateY(0);
  621. }
  622. .uni-calendar__content {
  623. background-color: #fff;
  624. }
  625. .uni-calendar__header {
  626. position: relative;
  627. /* #ifndef APP-NVUE */
  628. display: flex;
  629. /* #endif */
  630. flex-direction: row;
  631. justify-content: center;
  632. align-items: center;
  633. height: 50px;
  634. // border-bottom-color: $uni-border-color;
  635. // border-bottom-style: solid;
  636. // border-bottom-width: 1px;
  637. }
  638. .uni-calendar--fixed-top {
  639. /* #ifndef APP-NVUE */
  640. display: flex;
  641. /* #endif */
  642. flex-direction: row;
  643. justify-content: space-between;
  644. border-top-color: $uni-border-color;
  645. border-top-style: solid;
  646. border-top-width: 1px;
  647. }
  648. .uni-calendar--fixed-width {
  649. width: 50px;
  650. // padding: 0 15px;
  651. }
  652. .uni-calendar__backtoday {
  653. position: absolute;
  654. right: 0;
  655. top: 25rpx;
  656. padding: 0 5px;
  657. padding-left: 10px;
  658. height: 25px;
  659. line-height: 25px;
  660. font-size: 12px;
  661. border-top-left-radius: 25px;
  662. border-bottom-left-radius: 25px;
  663. color: $uni-text-color;
  664. background-color: $uni-bg-color-hover;
  665. }
  666. .uni-calendar__header-text {
  667. text-align: center;
  668. width: 100px;
  669. font-size: $uni-font-size-base;
  670. color: $uni-text-color;
  671. }
  672. .uni-calendar__button-text {
  673. text-align: center;
  674. width: 100px;
  675. font-size: $uni-font-size-base;
  676. color: #007aff;
  677. /* #ifndef APP-NVUE */
  678. letter-spacing: 3px;
  679. /* #endif */
  680. }
  681. .uni-calendar__header-btn-box {
  682. /* #ifndef APP-NVUE */
  683. display: flex;
  684. /* #endif */
  685. flex-direction: row;
  686. align-items: center;
  687. justify-content: center;
  688. width: 50px;
  689. height: 50px;
  690. }
  691. .uni-calendar__header-btn {
  692. width: 8px;
  693. height: 8px;
  694. border-left-color: $uni-text-color-placeholder;
  695. border-left-style: solid;
  696. border-left-width: 1px;
  697. border-top-color: $uni-color-subtitle;
  698. border-top-style: solid;
  699. border-top-width: 1px;
  700. }
  701. .uni-calendar--left {
  702. transform: rotate(-45deg);
  703. }
  704. .uni-calendar--right {
  705. transform: rotate(135deg);
  706. }
  707. .uni-calendar__weeks {
  708. position: relative;
  709. /* #ifndef APP-NVUE */
  710. display: flex;
  711. /* #endif */
  712. flex-direction: row;
  713. }
  714. .uni-calendar__weeks-item {
  715. flex: 1;
  716. }
  717. .uni-calendar__weeks-day {
  718. flex: 1;
  719. /* #ifndef APP-NVUE */
  720. display: flex;
  721. /* #endif */
  722. flex-direction: column;
  723. justify-content: center;
  724. align-items: center;
  725. height: 40px;
  726. border-bottom-color: #F5F5F5;
  727. border-bottom-style: solid;
  728. border-bottom-width: 1px;
  729. }
  730. .uni-calendar__weeks-day-text {
  731. font-size: 12px;
  732. }
  733. .uni-calendar__box {
  734. position: relative;
  735. }
  736. .uni-calendar__box-bg {
  737. /* #ifndef APP-NVUE */
  738. display: flex;
  739. /* #endif */
  740. justify-content: center;
  741. align-items: center;
  742. position: absolute;
  743. top: 0;
  744. left: 0;
  745. right: 0;
  746. bottom: 0;
  747. }
  748. .uni-calendar__box-bg-text {
  749. font-size: 200px;
  750. font-weight: bold;
  751. color: $uni-text-color-grey;
  752. opacity: 0.1;
  753. text-align: center;
  754. /* #ifndef APP-NVUE */
  755. line-height: 1;
  756. /* #endif */
  757. }
  758. .uni-date-changed {
  759. padding: 0 10px;
  760. // line-height: 50px;
  761. text-align: center;
  762. color: #333;
  763. border-top-color: $uni-border-color;
  764. border-top-style: solid;
  765. border-top-width: 1px;
  766. flex: 1;
  767. }
  768. .uni-date-changed--time-start {
  769. /* #ifndef APP-NVUE */
  770. display: flex;
  771. /* #endif */
  772. align-items: center;
  773. }
  774. .uni-date-changed--time-end {
  775. /* #ifndef APP-NVUE */
  776. display: flex;
  777. /* #endif */
  778. align-items: center;
  779. }
  780. .uni-date-changed--time-date {
  781. color: #999;
  782. line-height: 50px;
  783. margin-right: 5px;
  784. // opacity: 0.6;
  785. }
  786. .time-picker-style {
  787. // width: 62px;
  788. /* #ifndef APP-NVUE */
  789. display: flex;
  790. /* #endif */
  791. justify-content: center;
  792. align-items: center
  793. }
  794. .mr-10 {
  795. margin-right: 10px;
  796. }
  797. </style>