calendar.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  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, '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. clearCalender() {
  410. if (this.range) {
  411. this.timeRange.startTime = ''
  412. this.timeRange.endTime = ''
  413. this.tempRange.before = ''
  414. this.tempRange.after = ''
  415. this.cale.multipleStatus.before = ''
  416. this.cale.multipleStatus.after = ''
  417. this.cale.multipleStatus.data = []
  418. this.cale.lastHover = false
  419. } else {
  420. this.time = ''
  421. this.tempSingleDate = ''
  422. }
  423. this.calendar.fullDate = ''
  424. this.setDate()
  425. },
  426. bindDateChange(e) {
  427. const value = e.detail.value + '-1'
  428. this.init(value)
  429. },
  430. /**
  431. * 初始化日期显示
  432. * @param {Object} date
  433. */
  434. init(date) {
  435. this.cale.setDate(date)
  436. this.weeks = this.cale.weeks
  437. this.nowDate = this.calendar = this.cale.getInfo(date)
  438. },
  439. // choiceDate(weeks) {
  440. // if (weeks.disable) return
  441. // this.calendar = weeks
  442. // // 设置多选
  443. // this.cale.setMultiple(this.calendar.fullDate, true)
  444. // this.weeks = this.cale.weeks
  445. // this.tempSingleDate = this.calendar.fullDate
  446. // this.tempRange.before = this.cale.multipleStatus.before
  447. // this.tempRange.after = this.cale.multipleStatus.after
  448. // this.change()
  449. // },
  450. /**
  451. * 打开日历弹窗
  452. */
  453. open() {
  454. // 弹窗模式并且清理数据
  455. if (this.clearDate && !this.insert) {
  456. this.cale.cleanMultipleStatus()
  457. // this.cale.setDate(this.date)
  458. this.init(this.date)
  459. }
  460. this.show = true
  461. this.$nextTick(() => {
  462. setTimeout(() => {
  463. this.aniMaskShow = true
  464. }, 50)
  465. })
  466. },
  467. /**
  468. * 关闭日历弹窗
  469. */
  470. close() {
  471. this.aniMaskShow = false
  472. this.$nextTick(() => {
  473. setTimeout(() => {
  474. this.show = false
  475. this.$emit('close')
  476. }, 300)
  477. })
  478. },
  479. /**
  480. * 确认按钮
  481. */
  482. confirm() {
  483. this.setEmit('confirm')
  484. this.close()
  485. },
  486. /**
  487. * 变化触发
  488. */
  489. change() {
  490. if (!this.insert) return
  491. this.setEmit('change')
  492. },
  493. /**
  494. * 选择月份触发
  495. */
  496. monthSwitch() {
  497. let {
  498. year,
  499. month
  500. } = this.nowDate
  501. this.$emit('monthSwitch', {
  502. year,
  503. month: Number(month)
  504. })
  505. },
  506. /**
  507. * 派发事件
  508. * @param {Object} name
  509. */
  510. setEmit(name) {
  511. let {
  512. year,
  513. month,
  514. date,
  515. fullDate,
  516. lunar,
  517. extraInfo
  518. } = this.calendar
  519. this.$emit(name, {
  520. range: this.cale.multipleStatus,
  521. year,
  522. month,
  523. date,
  524. time: this.time,
  525. timeRange: this.timeRange,
  526. fulldate: fullDate,
  527. lunar,
  528. extraInfo: extraInfo || {}
  529. })
  530. },
  531. /**
  532. * 选择天触发
  533. * @param {Object} weeks
  534. */
  535. choiceDate(weeks) {
  536. if (weeks.disable) return
  537. this.calendar = weeks
  538. this.calendar.userChecked = true
  539. // 设置多选
  540. this.cale.setMultiple(this.calendar.fullDate, true)
  541. this.weeks = this.cale.weeks
  542. this.tempSingleDate = this.calendar.fullDate
  543. this.tempRange.before = this.cale.multipleStatus.before
  544. this.tempRange.after = this.cale.multipleStatus.after
  545. this.change()
  546. },
  547. /**
  548. * 回到今天
  549. */
  550. backtoday() {
  551. let date = this.cale.getDate(new Date()).fullDate
  552. // this.cale.setDate(date)
  553. this.init(date)
  554. this.change()
  555. },
  556. /**
  557. * 比较时间大小
  558. */
  559. dateCompare(startDate, endDate) {
  560. // 计算截止时间
  561. startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
  562. // 计算详细项的截止时间
  563. endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
  564. if (startDate <= endDate) {
  565. return true
  566. } else {
  567. return false
  568. }
  569. },
  570. /**
  571. * 上个月
  572. */
  573. pre() {
  574. const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate
  575. this.setDate(preDate)
  576. this.monthSwitch()
  577. },
  578. /**
  579. * 下个月
  580. */
  581. next() {
  582. const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate
  583. this.setDate(nextDate)
  584. this.monthSwitch()
  585. },
  586. /**
  587. * 设置日期
  588. * @param {Object} date
  589. */
  590. setDate(date) {
  591. this.cale.setDate(date)
  592. this.weeks = this.cale.weeks
  593. this.nowDate = this.cale.getInfo(date)
  594. }
  595. }
  596. }
  597. </script>
  598. <style lang="scss" >
  599. .uni-calendar {
  600. /* #ifndef APP-NVUE */
  601. display: flex;
  602. /* #endif */
  603. flex-direction: column;
  604. }
  605. .uni-calendar__mask {
  606. position: fixed;
  607. bottom: 0;
  608. top: 0;
  609. left: 0;
  610. right: 0;
  611. background-color: rgba(0, 0, 0, 0.4);
  612. transition-property: opacity;
  613. transition-duration: 0.3s;
  614. opacity: 0;
  615. /* #ifndef APP-NVUE */
  616. z-index: 99;
  617. /* #endif */
  618. }
  619. .uni-calendar--mask-show {
  620. opacity: 1
  621. }
  622. .uni-calendar--fixed {
  623. position: fixed;
  624. bottom: calc(var(--window-bottom));
  625. left: 0;
  626. right: 0;
  627. transition-property: transform;
  628. transition-duration: 0.3s;
  629. transform: translateY(460px);
  630. /* #ifndef APP-NVUE */
  631. z-index: 99;
  632. /* #endif */
  633. }
  634. .uni-calendar--ani-show {
  635. transform: translateY(0);
  636. }
  637. .uni-calendar__content {
  638. background-color: #fff;
  639. }
  640. .uni-calendar__content-mobile {
  641. border-top-left-radius: 10px;
  642. border-top-right-radius: 10px;
  643. box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
  644. }
  645. .uni-calendar__header {
  646. position: relative;
  647. /* #ifndef APP-NVUE */
  648. display: flex;
  649. /* #endif */
  650. flex-direction: row;
  651. justify-content: center;
  652. align-items: center;
  653. height: 50px;
  654. }
  655. .uni-calendar__header-mobile {
  656. padding: 10px;
  657. padding-bottom: 0;
  658. }
  659. .uni-calendar--fixed-top {
  660. /* #ifndef APP-NVUE */
  661. display: flex;
  662. /* #endif */
  663. flex-direction: row;
  664. justify-content: space-between;
  665. border-top-color: rgba(0, 0, 0, 0.4);
  666. border-top-style: solid;
  667. border-top-width: 1px;
  668. }
  669. .uni-calendar--fixed-width {
  670. width: 50px;
  671. }
  672. .uni-calendar__backtoday {
  673. position: absolute;
  674. right: 0;
  675. top: 25rpx;
  676. padding: 0 5px;
  677. padding-left: 10px;
  678. height: 25px;
  679. line-height: 25px;
  680. font-size: 12px;
  681. border-top-left-radius: 25px;
  682. border-bottom-left-radius: 25px;
  683. color: #fff;
  684. background-color: #f1f1f1;
  685. }
  686. .uni-calendar__header-text {
  687. text-align: center;
  688. width: 100px;
  689. font-size: 15px;
  690. color: #666;
  691. }
  692. .uni-calendar__button-text {
  693. text-align: center;
  694. width: 100px;
  695. font-size: 14px;
  696. color: #007aff;
  697. /* #ifndef APP-NVUE */
  698. letter-spacing: 3px;
  699. /* #endif */
  700. }
  701. .uni-calendar__header-btn-box {
  702. /* #ifndef APP-NVUE */
  703. display: flex;
  704. /* #endif */
  705. flex-direction: row;
  706. align-items: center;
  707. justify-content: center;
  708. width: 50px;
  709. height: 50px;
  710. }
  711. .uni-calendar__header-btn {
  712. width: 9px;
  713. height: 9px;
  714. border-left-color: #808080;
  715. border-left-style: solid;
  716. border-left-width: 1px;
  717. border-top-color: #555555;
  718. border-top-style: solid;
  719. border-top-width: 1px;
  720. }
  721. .uni-calendar--left {
  722. transform: rotate(-45deg);
  723. }
  724. .uni-calendar--right {
  725. transform: rotate(135deg);
  726. }
  727. .uni-calendar__weeks {
  728. position: relative;
  729. /* #ifndef APP-NVUE */
  730. display: flex;
  731. /* #endif */
  732. flex-direction: row;
  733. }
  734. .uni-calendar__weeks-item {
  735. flex: 1;
  736. }
  737. .uni-calendar__weeks-day {
  738. flex: 1;
  739. /* #ifndef APP-NVUE */
  740. display: flex;
  741. /* #endif */
  742. flex-direction: column;
  743. justify-content: center;
  744. align-items: center;
  745. height: 40px;
  746. border-bottom-color: #F5F5F5;
  747. border-bottom-style: solid;
  748. border-bottom-width: 1px;
  749. }
  750. .uni-calendar__weeks-day-text {
  751. font-size: 12px;
  752. color: #B2B2B2;
  753. }
  754. .uni-calendar__box {
  755. position: relative;
  756. // padding: 0 10px;
  757. padding-bottom: 7px;
  758. }
  759. .uni-calendar__box-bg {
  760. /* #ifndef APP-NVUE */
  761. display: flex;
  762. /* #endif */
  763. justify-content: center;
  764. align-items: center;
  765. position: absolute;
  766. top: 0;
  767. left: 0;
  768. right: 0;
  769. bottom: 0;
  770. }
  771. .uni-calendar__box-bg-text {
  772. font-size: 200px;
  773. font-weight: bold;
  774. color: #999;
  775. opacity: 0.1;
  776. text-align: center;
  777. /* #ifndef APP-NVUE */
  778. line-height: 1;
  779. /* #endif */
  780. }
  781. .uni-date-changed {
  782. padding: 0 10px;
  783. // line-height: 50px;
  784. text-align: center;
  785. color: #333;
  786. border-top-color: #DCDCDC;
  787. ;
  788. border-top-style: solid;
  789. border-top-width: 1px;
  790. flex: 1;
  791. }
  792. .uni-date-btn--ok {
  793. padding: 20px 15px;
  794. }
  795. .uni-date-changed--time-start {
  796. /* #ifndef APP-NVUE */
  797. display: flex;
  798. /* #endif */
  799. align-items: center;
  800. }
  801. .uni-date-changed--time-end {
  802. /* #ifndef APP-NVUE */
  803. display: flex;
  804. /* #endif */
  805. align-items: center;
  806. }
  807. .uni-date-changed--time-date {
  808. color: #999;
  809. line-height: 50px;
  810. margin-right: 5px;
  811. // opacity: 0.6;
  812. }
  813. .time-picker-style {
  814. // width: 62px;
  815. /* #ifndef APP-NVUE */
  816. display: flex;
  817. /* #endif */
  818. justify-content: center;
  819. align-items: center
  820. }
  821. .mr-10 {
  822. margin-right: 10px;
  823. }
  824. .dialog-close {
  825. position: absolute;
  826. top: 0;
  827. right: 0;
  828. bottom: 0;
  829. /* #ifndef APP-NVUE */
  830. display: flex;
  831. /* #endif */
  832. flex-direction: row;
  833. align-items: center;
  834. padding: 0 25px;
  835. margin-top: 10px;
  836. }
  837. .dialog-close-plus {
  838. width: 16px;
  839. height: 2px;
  840. background-color: #737987;
  841. border-radius: 2px;
  842. transform: rotate(45deg);
  843. }
  844. .dialog-close-rotate {
  845. position: absolute;
  846. transform: rotate(-45deg);
  847. }
  848. .uni-datetime-picker--btn {
  849. border-radius: 100px;
  850. height: 40px;
  851. line-height: 40px;
  852. background-color: #007aff;
  853. color: #fff;
  854. font-size: 16px;
  855. letter-spacing: 2px;
  856. }
  857. /* #ifndef APP-NVUE */
  858. .uni-datetime-picker--btn:active {
  859. opacity: 0.7;
  860. }
  861. /* #endif */
  862. </style>