calendar.vue 21 KB

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