calendar.vue 21 KB

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