calendar.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  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||'') + ' 年 ' + ( nowDate.month||'') +' 月'}}</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">确认</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. this.timeRange.startTime = newVal.start
  248. this.timeRange.endTime = newVal.end
  249. }
  250. }
  251. },
  252. startDate(val) {
  253. this.cale.resetSatrtDate(val)
  254. this.cale.setDate(this.nowDate.fullDate)
  255. this.weeks = this.cale.weeks
  256. },
  257. endDate(val) {
  258. this.cale.resetEndDate(val)
  259. this.cale.setDate(this.nowDate.fullDate)
  260. this.weeks = this.cale.weeks
  261. },
  262. selected(newVal) {
  263. this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
  264. this.weeks = this.cale.weeks
  265. },
  266. pleStatus: {
  267. immediate: true,
  268. handler(newVal, oldVal) {
  269. const {
  270. before,
  271. after,
  272. fulldate,
  273. which
  274. } = newVal
  275. this.tempRange.before = before
  276. this.tempRange.after = after
  277. setTimeout(() => {
  278. if (fulldate) {
  279. this.cale.setHoverMultiple(fulldate)
  280. if (before && after) {
  281. this.cale.lastHover = true
  282. if (this.rangeWithinMonth(after, before)) return
  283. this.setDate(before)
  284. } else {
  285. this.cale.setMultiple(fulldate)
  286. this.setDate(this.nowDate.fullDate)
  287. this.calendar.fullDate = ''
  288. this.cale.lastHover = false
  289. }
  290. } else {
  291. this.cale.setDefaultMultiple(before, after)
  292. if (which === 'left') {
  293. this.setDate(before)
  294. this.weeks = this.cale.weeks
  295. } else {
  296. this.setDate(after)
  297. this.weeks = this.cale.weeks
  298. }
  299. this.cale.lastHover = true
  300. }
  301. }, 16)
  302. }
  303. }
  304. },
  305. computed: {
  306. reactStartTime() {
  307. const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate
  308. const res = activeDate === this.startDate ? this.selectableTimes.start : ''
  309. return res
  310. },
  311. reactEndTime() {
  312. const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate
  313. const res = activeDate === this.endDate ? this.selectableTimes.end : ''
  314. return res
  315. },
  316. /**
  317. * for i18n
  318. */
  319. selectDateText() {
  320. return t("uni-datetime-picker.selectDate")
  321. },
  322. startDateText() {
  323. return this.startPlaceholder || t("uni-datetime-picker.startDate")
  324. },
  325. endDateText() {
  326. return this.endPlaceholder || t("uni-datetime-picker.endDate")
  327. },
  328. okText() {
  329. return t("uni-datetime-picker.ok")
  330. },
  331. monText() {
  332. return t("uni-calender.MON")
  333. },
  334. TUEText() {
  335. return t("uni-calender.TUE")
  336. },
  337. WEDText() {
  338. return t("uni-calender.WED")
  339. },
  340. THUText() {
  341. return t("uni-calender.THU")
  342. },
  343. FRIText() {
  344. return t("uni-calender.FRI")
  345. },
  346. SATText() {
  347. return t("uni-calender.SAT")
  348. },
  349. SUNText() {
  350. return t("uni-calender.SUN")
  351. },
  352. },
  353. created() {
  354. // 获取日历方法实例
  355. this.cale = new Calendar({
  356. // date: new Date(),
  357. selected: this.selected,
  358. startDate: this.startDate,
  359. endDate: this.endDate,
  360. range: this.range,
  361. // multipleStatus: this.pleStatus
  362. })
  363. // 选中某一天
  364. // this.cale.setDate(this.date)
  365. this.init(this.date)
  366. // this.setDay
  367. },
  368. methods: {
  369. leaveCale() {
  370. this.firstEnter = true
  371. },
  372. handleMouse(weeks) {
  373. if (weeks.disable) return
  374. if (this.cale.lastHover) return
  375. let {
  376. before,
  377. after
  378. } = this.cale.multipleStatus
  379. if (!before) return
  380. this.calendar = weeks
  381. // 设置范围选
  382. this.cale.setHoverMultiple(this.calendar.fullDate)
  383. this.weeks = this.cale.weeks
  384. // hover时,进入一个日历,更新另一个
  385. if (this.firstEnter) {
  386. this.$emit('firstEnterCale', this.cale.multipleStatus)
  387. this.firstEnter = false
  388. }
  389. },
  390. rangeWithinMonth(A, B) {
  391. const [yearA, monthA] = A.split('-')
  392. const [yearB, monthB] = B.split('-')
  393. return yearA === yearB && monthA === monthB
  394. },
  395. // 取消穿透
  396. clean() {
  397. this.close()
  398. },
  399. clearCalender() {
  400. if (this.range) {
  401. this.timeRange.startTime = ''
  402. this.timeRange.endTime = ''
  403. this.tempRange.before = ''
  404. this.tempRange.after = ''
  405. this.cale.multipleStatus.before = ''
  406. this.cale.multipleStatus.after = ''
  407. this.cale.multipleStatus.data = []
  408. this.cale.lastHover = false
  409. } else {
  410. this.time = ''
  411. this.tempSingleDate = ''
  412. }
  413. this.calendar.fullDate = ''
  414. this.setDate()
  415. },
  416. bindDateChange(e) {
  417. const value = e.detail.value + '-1'
  418. this.init(value)
  419. },
  420. /**
  421. * 初始化日期显示
  422. * @param {Object} date
  423. */
  424. init(date) {
  425. this.cale.setDate(date)
  426. this.weeks = this.cale.weeks
  427. this.nowDate = this.calendar = this.cale.getInfo(date)
  428. },
  429. // choiceDate(weeks) {
  430. // if (weeks.disable) return
  431. // this.calendar = weeks
  432. // // 设置多选
  433. // this.cale.setMultiple(this.calendar.fullDate, true)
  434. // this.weeks = this.cale.weeks
  435. // this.tempSingleDate = this.calendar.fullDate
  436. // this.tempRange.before = this.cale.multipleStatus.before
  437. // this.tempRange.after = this.cale.multipleStatus.after
  438. // this.change()
  439. // },
  440. /**
  441. * 打开日历弹窗
  442. */
  443. open() {
  444. // 弹窗模式并且清理数据
  445. if (this.clearDate && !this.insert) {
  446. this.cale.cleanMultipleStatus()
  447. // this.cale.setDate(this.date)
  448. this.init(this.date)
  449. }
  450. this.show = true
  451. this.$nextTick(() => {
  452. setTimeout(() => {
  453. this.aniMaskShow = true
  454. }, 50)
  455. })
  456. },
  457. /**
  458. * 关闭日历弹窗
  459. */
  460. close() {
  461. this.aniMaskShow = false
  462. this.$nextTick(() => {
  463. setTimeout(() => {
  464. this.show = false
  465. this.$emit('close')
  466. }, 300)
  467. })
  468. },
  469. /**
  470. * 确认按钮
  471. */
  472. confirm() {
  473. this.setEmit('confirm')
  474. this.close()
  475. },
  476. /**
  477. * 变化触发
  478. */
  479. change() {
  480. if (!this.insert) return
  481. this.setEmit('change')
  482. },
  483. /**
  484. * 选择月份触发
  485. */
  486. monthSwitch() {
  487. let {
  488. year,
  489. month
  490. } = this.nowDate
  491. this.$emit('monthSwitch', {
  492. year,
  493. month: Number(month)
  494. })
  495. },
  496. /**
  497. * 派发事件
  498. * @param {Object} name
  499. */
  500. setEmit(name) {
  501. let {
  502. year,
  503. month,
  504. date,
  505. fullDate,
  506. lunar,
  507. extraInfo
  508. } = this.calendar
  509. this.$emit(name, {
  510. range: this.cale.multipleStatus,
  511. year,
  512. month,
  513. date,
  514. time: this.time,
  515. timeRange: this.timeRange,
  516. fulldate: fullDate,
  517. lunar,
  518. extraInfo: extraInfo || {}
  519. })
  520. },
  521. /**
  522. * 选择天触发
  523. * @param {Object} weeks
  524. */
  525. choiceDate(weeks) {
  526. if (weeks.disable) return
  527. this.calendar = weeks
  528. this.calendar.userChecked = true
  529. // 设置多选
  530. this.cale.setMultiple(this.calendar.fullDate, true)
  531. this.weeks = this.cale.weeks
  532. this.tempSingleDate = this.calendar.fullDate
  533. this.tempRange.before = this.cale.multipleStatus.before
  534. this.tempRange.after = this.cale.multipleStatus.after
  535. this.change()
  536. },
  537. /**
  538. * 回到今天
  539. */
  540. backtoday() {
  541. let date = this.cale.getDate(new Date()).fullDate
  542. // this.cale.setDate(date)
  543. this.init(date)
  544. this.change()
  545. },
  546. /**
  547. * 比较时间大小
  548. */
  549. dateCompare(startDate, endDate) {
  550. // 计算截止时间
  551. startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
  552. // 计算详细项的截止时间
  553. endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
  554. if (startDate <= endDate) {
  555. return true
  556. } else {
  557. return false
  558. }
  559. },
  560. /**
  561. * 上个月
  562. */
  563. pre() {
  564. const preDate = this.cale.getDate(this.nowDate.fullDate, -1, 'month').fullDate
  565. this.setDate(preDate)
  566. this.monthSwitch()
  567. },
  568. /**
  569. * 下个月
  570. */
  571. next() {
  572. const nextDate = this.cale.getDate(this.nowDate.fullDate, +1, 'month').fullDate
  573. this.setDate(nextDate)
  574. this.monthSwitch()
  575. },
  576. /**
  577. * 设置日期
  578. * @param {Object} date
  579. */
  580. setDate(date) {
  581. this.cale.setDate(date)
  582. this.weeks = this.cale.weeks
  583. this.nowDate = this.cale.getInfo(date)
  584. }
  585. }
  586. }
  587. </script>
  588. <style lang="scss" >
  589. .uni-calendar {
  590. /* #ifndef APP-NVUE */
  591. display: flex;
  592. /* #endif */
  593. flex-direction: column;
  594. }
  595. .uni-calendar__mask {
  596. position: fixed;
  597. bottom: 0;
  598. top: 0;
  599. left: 0;
  600. right: 0;
  601. background-color: rgba(0, 0, 0, 0.4);
  602. transition-property: opacity;
  603. transition-duration: 0.3s;
  604. opacity: 0;
  605. /* #ifndef APP-NVUE */
  606. z-index: 99;
  607. /* #endif */
  608. }
  609. .uni-calendar--mask-show {
  610. opacity: 1
  611. }
  612. .uni-calendar--fixed {
  613. position: fixed;
  614. bottom: calc(var(--window-bottom));
  615. left: 0;
  616. right: 0;
  617. transition-property: transform;
  618. transition-duration: 0.3s;
  619. transform: translateY(460px);
  620. /* #ifndef APP-NVUE */
  621. z-index: 99;
  622. /* #endif */
  623. }
  624. .uni-calendar--ani-show {
  625. transform: translateY(0);
  626. }
  627. .uni-calendar__content {
  628. background-color: #fff;
  629. }
  630. .uni-calendar__content-mobile {
  631. border-top-left-radius: 10px;
  632. border-top-right-radius: 10px;
  633. box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
  634. }
  635. .uni-calendar__header {
  636. position: relative;
  637. /* #ifndef APP-NVUE */
  638. display: flex;
  639. /* #endif */
  640. flex-direction: row;
  641. justify-content: center;
  642. align-items: center;
  643. height: 50px;
  644. }
  645. .uni-calendar__header-mobile {
  646. padding: 10px;
  647. padding-bottom: 0;
  648. }
  649. .uni-calendar--fixed-top {
  650. /* #ifndef APP-NVUE */
  651. display: flex;
  652. /* #endif */
  653. flex-direction: row;
  654. justify-content: space-between;
  655. border-top-color: rgba(0, 0, 0, 0.4);
  656. border-top-style: solid;
  657. border-top-width: 1px;
  658. }
  659. .uni-calendar--fixed-width {
  660. width: 50px;
  661. }
  662. .uni-calendar__backtoday {
  663. position: absolute;
  664. right: 0;
  665. top: 25rpx;
  666. padding: 0 5px;
  667. padding-left: 10px;
  668. height: 25px;
  669. line-height: 25px;
  670. font-size: 12px;
  671. border-top-left-radius: 25px;
  672. border-bottom-left-radius: 25px;
  673. color: #fff;
  674. background-color: #f1f1f1;
  675. }
  676. .uni-calendar__header-text {
  677. text-align: center;
  678. width: 100px;
  679. font-size: 15px;
  680. color: #666;
  681. }
  682. .uni-calendar__button-text {
  683. text-align: center;
  684. width: 100px;
  685. font-size: 14px;
  686. color: #007aff;
  687. /* #ifndef APP-NVUE */
  688. letter-spacing: 3px;
  689. /* #endif */
  690. }
  691. .uni-calendar__header-btn-box {
  692. /* #ifndef APP-NVUE */
  693. display: flex;
  694. /* #endif */
  695. flex-direction: row;
  696. align-items: center;
  697. justify-content: center;
  698. width: 50px;
  699. height: 50px;
  700. }
  701. .uni-calendar__header-btn {
  702. width: 9px;
  703. height: 9px;
  704. border-left-color: #808080;
  705. border-left-style: solid;
  706. border-left-width: 1px;
  707. border-top-color: #555555;
  708. border-top-style: solid;
  709. border-top-width: 1px;
  710. }
  711. .uni-calendar--left {
  712. transform: rotate(-45deg);
  713. }
  714. .uni-calendar--right {
  715. transform: rotate(135deg);
  716. }
  717. .uni-calendar__weeks {
  718. position: relative;
  719. /* #ifndef APP-NVUE */
  720. display: flex;
  721. /* #endif */
  722. flex-direction: row;
  723. }
  724. .uni-calendar__weeks-item {
  725. flex: 1;
  726. }
  727. .uni-calendar__weeks-day {
  728. flex: 1;
  729. /* #ifndef APP-NVUE */
  730. display: flex;
  731. /* #endif */
  732. flex-direction: column;
  733. justify-content: center;
  734. align-items: center;
  735. height: 40px;
  736. border-bottom-color: #F5F5F5;
  737. border-bottom-style: solid;
  738. border-bottom-width: 1px;
  739. }
  740. .uni-calendar__weeks-day-text {
  741. font-size: 12px;
  742. color: #B2B2B2;
  743. }
  744. .uni-calendar__box {
  745. position: relative;
  746. // padding: 0 10px;
  747. padding-bottom: 7px;
  748. }
  749. .uni-calendar__box-bg {
  750. /* #ifndef APP-NVUE */
  751. display: flex;
  752. /* #endif */
  753. justify-content: center;
  754. align-items: center;
  755. position: absolute;
  756. top: 0;
  757. left: 0;
  758. right: 0;
  759. bottom: 0;
  760. }
  761. .uni-calendar__box-bg-text {
  762. font-size: 200px;
  763. font-weight: bold;
  764. color: #999;
  765. opacity: 0.1;
  766. text-align: center;
  767. /* #ifndef APP-NVUE */
  768. line-height: 1;
  769. /* #endif */
  770. }
  771. .uni-date-changed {
  772. padding: 0 10px;
  773. // line-height: 50px;
  774. text-align: center;
  775. color: #333;
  776. border-top-color: #DCDCDC;
  777. ;
  778. border-top-style: solid;
  779. border-top-width: 1px;
  780. flex: 1;
  781. }
  782. .uni-date-btn--ok {
  783. padding: 20px 15px;
  784. }
  785. .uni-date-changed--time-start {
  786. /* #ifndef APP-NVUE */
  787. display: flex;
  788. /* #endif */
  789. align-items: center;
  790. }
  791. .uni-date-changed--time-end {
  792. /* #ifndef APP-NVUE */
  793. display: flex;
  794. /* #endif */
  795. align-items: center;
  796. }
  797. .uni-date-changed--time-date {
  798. color: #999;
  799. line-height: 50px;
  800. margin-right: 5px;
  801. // opacity: 0.6;
  802. }
  803. .time-picker-style {
  804. // width: 62px;
  805. /* #ifndef APP-NVUE */
  806. display: flex;
  807. /* #endif */
  808. justify-content: center;
  809. align-items: center
  810. }
  811. .mr-10 {
  812. margin-right: 10px;
  813. }
  814. .dialog-close {
  815. position: absolute;
  816. top: 0;
  817. right: 0;
  818. bottom: 0;
  819. /* #ifndef APP-NVUE */
  820. display: flex;
  821. /* #endif */
  822. flex-direction: row;
  823. align-items: center;
  824. padding: 0 25px;
  825. margin-top: 10px;
  826. }
  827. .dialog-close-plus {
  828. width: 16px;
  829. height: 2px;
  830. background-color: #737987;
  831. border-radius: 2px;
  832. transform: rotate(45deg);
  833. }
  834. .dialog-close-rotate {
  835. position: absolute;
  836. transform: rotate(-45deg);
  837. }
  838. .uni-datetime-picker--btn {
  839. border-radius: 100px;
  840. height: 40px;
  841. line-height: 40px;
  842. background-color: #007aff;
  843. color: #fff;
  844. font-size: 16px;
  845. letter-spacing: 5px;
  846. }
  847. /* #ifndef APP-NVUE */
  848. .uni-datetime-picker--btn:active {
  849. opacity: 0.7;
  850. }
  851. /* #endif */
  852. </style>