u-calendar.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <template>
  2. <u-popup closeable :maskCloseAble="maskCloseAble" :mode="popupMode" :mask="popupMask" :popup="false" v-model="value" length="auto"
  3. :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex" :border-radius="borderRadius" :closeable="closeable">
  4. <view class="u-calendar">
  5. <view class="u-calendar__header">
  6. <view class="u-calendar__header__text" v-if="!$slots['tooltip']">
  7. {{toolTip}}
  8. </view>
  9. <slot v-else name="tooltip" />
  10. </view>
  11. <view class="u-calendar__action u-flex u-row-center">
  12. <view class="u-calendar__action__icon">
  13. <u-icon v-if="changeYear" name="arrow-left-double" :color="yearArrowColor" @click="changeYearHandler(0)"></u-icon>
  14. </view>
  15. <view class="u-calendar__action__icon">
  16. <u-icon v-if="changeMonth" name="arrow-left" :color="monthArrowColor" @click="changeMonthHandler(0)"></u-icon>
  17. </view>
  18. <view class="u-calendar__action__text">{{ showTitle }}</view>
  19. <view class="u-calendar__action__icon">
  20. <u-icon v-if="changeMonth" name="arrow-right" :color="monthArrowColor" @click="changeMonthHandler(1)"></u-icon>
  21. </view>
  22. <view class="u-calendar__action__icon">
  23. <u-icon v-if="changeYear" name="arrow-right-double" :color="yearArrowColor" @click="changeYearHandler(1)"></u-icon>
  24. </view>
  25. </view>
  26. <view class="u-calendar__week-day">
  27. <view class="u-calendar__week-day__text" v-for="(item, index) in weekDayZh" :key="index">{{item}}</view>
  28. </view>
  29. <view class="u-calendar__content">
  30. <!-- 前置空白部分 -->
  31. <block v-for="(item, index) in weekdayArr" :key="index">
  32. <view class="u-calendar__content__item"></view>
  33. </block>
  34. <view class="u-calendar__content__item" :class="{
  35. 'u-hover-class':openDisAbled(year,month,index+1),
  36. 'u-calendar__content--start-date': (mode == 'range' && startDate==`${year}-${month}-${index+1}`) || mode== 'date',
  37. 'u-calendar__content--end-date':(mode== 'range' && endDate==`${year}-${month}-${index+1}`) || mode == 'date'
  38. }"
  39. :style="{backgroundColor: getColor(index,1)}" v-for="(item, index) in daysArr" :key="index" @tap="dateClick(index)">
  40. <view class="u-calendar__content__item__inner" :style="{color: getColor(index,2)}">
  41. <view>{{ index + 1 }}</view>
  42. </view>
  43. <view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="filterAvailable(`${year}-${month}-${index+1}`)">{{availableText}}</view>
  44. <view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="filterActive(`${year}-${month}-${index+1}`)">{{activeText}}</view>
  45. <view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="mode== 'range' && startDate==`${year}-${month}-${index+1}` && startDate!=endDate">{{startText}}</view>
  46. <view class="u-calendar__content__item__tips" :style="{color:activeColor}" v-if="mode== 'range' && endDate==`${year}-${month}-${index+1}`">{{endText}}</view>
  47. </view>
  48. <view class="u-calendar__content__bg-month">{{month}}</view>
  49. </view>
  50. <view class="u-calendar__bottom" v-if="handleStatus">
  51. <view class="u-calendar__bottom__choose">
  52. <text>{{mode == 'date' ? activeDate : startDate}}</text>
  53. <text v-if="endDate">至{{endDate}}</text>
  54. </view>
  55. <view class="u-calendar__bottom__btn">
  56. <u-button :type="btnType" shape="circle" size="default" @click="btnFix(false)">确定</u-button>
  57. </view>
  58. </view>
  59. </view>
  60. </u-popup>
  61. </template>
  62. <script>
  63. /**
  64. * calendar 日历
  65. * @description 此组件用于单个选择日期,范围选择日期等,日历被包裹在底部弹起的容器中。
  66. * @tutorial http://uviewui.com/components/calendar.html
  67. * @property {String} mode 选择日期的模式,date-为单个日期,range-为选择日期范围
  68. * @property {Boolean} v-model 布尔值变量,用于控制日历的弹出与收起
  69. * @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
  70. * @property {Boolean} change-year 是否显示顶部的切换年份方向的按钮(默认true)
  71. * @property {Boolean} change-month 是否显示顶部的切换月份方向的按钮(默认true)
  72. * @property {String Number} max-year 可切换的最大年份(默认2050)
  73. * @property {String Number} min-year 最小可选日期(默认1950)
  74. * @property {String Number} min-date 可切换的最小年份(默认1950-01-01)
  75. * @property {String Number} max-date 最大可选日期(默认当前日期)
  76. * @property {String Number} 弹窗顶部左右两边的圆角值,单位rpx(默认20)
  77. * @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭日历(默认true)
  78. * @property {String} month-arrow-color 月份切换按钮箭头颜色(默认#606266)
  79. * @property {String} year-arrow-color 年份切换按钮箭头颜色(默认#909399)
  80. * @property {String} color 日期字体的默认颜色(默认#303133)
  81. * @property {String} active-bg-color 起始/结束日期按钮的背景色(默认#2979ff)
  82. * @property {String Number} z-index 弹出时的z-index值(默认10075)
  83. * @property {String} active-color 起始/结束日期按钮的字体颜色(默认#ffffff)
  84. * @property {String} range-bg-color 起始/结束日期之间的区域的背景颜色(默认rgba(41,121,255,0.13))
  85. * @property {String} range-color 选择范围内字体颜色(默认#2979ff)
  86. * @property {String} start-text 起始日期底部的提示文字(默认 '开始')
  87. * @property {String} end-text 结束日期底部的提示文字(默认 '结束')
  88. * @property {String} btn-type 底部确定按钮的主题(默认 'primary')
  89. * @property {String} toolTip 顶部提示文字,如设置名为tooltip的slot,此参数将失效(默认 '选择日期')
  90. * @property {Boolean} closeable 是否显示右上角的关闭图标(默认true)
  91. * @example <u-calendar v-model="show" :mode="mode"></u-calendar>
  92. */
  93. export default {
  94. name: 'u-calendar',
  95. props: {
  96. safeAreaInsetBottom: {
  97. type: Boolean,
  98. default: false
  99. },
  100. // 是否允许通过点击遮罩关闭Picker
  101. maskCloseAble: {
  102. type: Boolean,
  103. default: true
  104. },
  105. // 通过双向绑定控制组件的弹出与收起
  106. value: {
  107. type: Boolean,
  108. default: false
  109. },
  110. // 弹出的z-index值
  111. zIndex: {
  112. type: [String, Number],
  113. default: 0
  114. },
  115. // 是否允许切换年份
  116. changeYear: {
  117. type: Boolean,
  118. default: true
  119. },
  120. // 是否允许切换月份
  121. changeMonth: {
  122. type: Boolean,
  123. default: true
  124. },
  125. // date-单个日期选择,range-开始日期+结束日期选择
  126. mode: {
  127. type: String,
  128. default: 'date'
  129. },
  130. // 可切换的最大年份
  131. maxYear: {
  132. type: [Number, String],
  133. default: 2050
  134. },
  135. // 可切换的最小年份
  136. minYear: {
  137. type: [Number, String],
  138. default: 1950
  139. },
  140. // 最小可选日期(不在范围内日期禁用不可选)
  141. minDate: {
  142. type: [Number, String],
  143. default: '1950-01-01'
  144. },
  145. /**
  146. * 最大可选日期
  147. * 默认最大值为今天,之后的日期不可选
  148. * 2030-12-31
  149. * */
  150. maxDate: {
  151. type: [Number, String],
  152. default: ''
  153. },
  154. // 弹窗顶部左右两边的圆角值
  155. borderRadius: {
  156. type: [String, Number],
  157. default: 20
  158. },
  159. // 月份切换按钮箭头颜色
  160. monthArrowColor: {
  161. type: String,
  162. default: '#606266'
  163. },
  164. // 年份切换按钮箭头颜色
  165. yearArrowColor: {
  166. type: String,
  167. default: '#909399'
  168. },
  169. // 默认日期字体颜色
  170. color: {
  171. type: String,
  172. default: '#303133'
  173. },
  174. // 选中|起始结束日期背景色
  175. activeBgColor: {
  176. type: String,
  177. default: '#2979ff'
  178. },
  179. // 选中|起始结束日期字体颜色
  180. activeColor: {
  181. type: String,
  182. default: '#ffffff'
  183. },
  184. // 范围内日期背景色
  185. rangeBgColor: {
  186. type: String,
  187. default: 'rgba(41,121,255,0.13)'
  188. },
  189. // 范围内日期字体颜色
  190. rangeColor: {
  191. type: String,
  192. default: '#2979ff'
  193. },
  194. // mode=range时生效,起始日期自定义文案
  195. startText: {
  196. type: String,
  197. default: '开始'
  198. },
  199. // mode=range时生效,结束日期自定义文案
  200. endText: {
  201. type: String,
  202. default: '结束'
  203. },
  204. //按钮样式类型
  205. btnType: {
  206. type: String,
  207. default: 'primary'
  208. },
  209. // 当前选中日期带选中效果
  210. isActiveCurrent: {
  211. type: Boolean,
  212. default: true
  213. },
  214. // 切换年月是否触发事件 mode=date时生效
  215. isChange: {
  216. type: Boolean,
  217. default: false
  218. },
  219. // 是否显示右上角的关闭图标
  220. closeable: {
  221. type: Boolean,
  222. default: true
  223. },
  224. // 顶部的提示文字
  225. toolTip: {
  226. type: String,
  227. default: '选择日期'
  228. },
  229. // 可用提示背景色
  230. availableBgColor: {
  231. type: String,
  232. default: '#fcbd71'
  233. },
  234. // 可用提示文字
  235. availableText: {
  236. type: String,
  237. default: '可用'
  238. },
  239. // 可用日期列表
  240. available: {
  241. type: Array,
  242. default () {
  243. return []
  244. }
  245. },
  246. // 可用提示文字
  247. activeText: {
  248. type: String,
  249. default: ''
  250. },
  251. // 激活列表
  252. activeList: {
  253. type: Array,
  254. default () {
  255. return []
  256. }
  257. },
  258. handleStatus: {
  259. type: Boolean,
  260. default: true
  261. },
  262. popupMask: {
  263. type: Boolean,
  264. default: true
  265. },
  266. popupMode: {
  267. type: String,
  268. default: 'bottom'
  269. }
  270. },
  271. data() {
  272. return {
  273. // 星期几,值为1-7
  274. weekday: 1,
  275. weekdayArr: [],
  276. // 当前月有多少天
  277. days: 0,
  278. daysArr: [],
  279. showTitle: '',
  280. year: 2020,
  281. month: 0,
  282. day: 0,
  283. startYear: 0,
  284. startMonth: 0,
  285. startDay: 0,
  286. endYear: 0,
  287. endMonth: 0,
  288. endDay: 0,
  289. today: '',
  290. activeDate: '',
  291. startDate: '',
  292. endDate: '',
  293. isStart: true,
  294. min: null,
  295. max: null,
  296. weekDayZh: ['日', '一', '二', '三', '四', '五', '六']
  297. };
  298. },
  299. computed: {
  300. dataChange() {
  301. return `${this.mode}-${this.minDate}-${this.maxDate}`;
  302. },
  303. uZIndex() {
  304. // 如果用户有传递z-index值,优先使用
  305. return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
  306. }
  307. },
  308. watch: {
  309. dataChange(val) {
  310. this.init()
  311. }
  312. },
  313. created() {
  314. this.init()
  315. },
  316. methods: {
  317. getColor(index, type) {
  318. let color = type == 1 ? '' : this.color;
  319. let day = index + 1
  320. let date = `${this.year}-${this.month}-${day}`
  321. let timestamp = new Date(date.replace(/\-/g, '/')).getTime();
  322. let start = this.startDate.replace(/\-/g, '/')
  323. let end = this.endDate.replace(/\-/g, '/')
  324. if ((this.isActiveCurrent && this.activeDate == date) || this.startDate == date || this.endDate == date) {
  325. color = type == 1 ? this.activeBgColor : this.activeColor;
  326. } else if (this.endDate && timestamp > new Date(start).getTime() && timestamp < new Date(end).getTime()) {
  327. color = type == 1 ? this.rangeBgColor : this.rangeColor;
  328. }
  329. if (this.available.length && !(this.isActiveCurrent && this.activeDate == date)) {
  330. if (this.filterAvailable(`${this.year}-${this.month}-${day}`)) {
  331. return type == 1 ? this.availableBgColor : this.activeColor;
  332. }
  333. }
  334. if (this.activeList.length && !(this.isActiveCurrent && this.activeDate == date)) {
  335. if (this.filterActive(`${this.year}-${this.month}-${day}`)) {
  336. return type == 1 ? this.activeBgColor : this.activeColor;
  337. }
  338. }
  339. return color;
  340. },
  341. filterAvailable(date) {
  342. return this.available.filter(site => site == date).length
  343. },
  344. filterActive(date) {
  345. return this.activeList.filter(site => site == date).length
  346. },
  347. init() {
  348. let now = new Date();
  349. this.year = now.getFullYear();
  350. this.month = now.getMonth() + 1;
  351. this.day = now.getDate();
  352. this.today = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
  353. this.activeDate = this.today;
  354. this.min = this.initDate(this.minDate);
  355. this.max = this.initDate(this.maxDate || this.today);
  356. this.startDate = "";
  357. this.startYear = 0;
  358. this.startMonth = 0;
  359. this.startDay = 0;
  360. this.endYear = 0;
  361. this.endMonth = 0;
  362. this.endDay = 0;
  363. this.endDate = "";
  364. this.isStart = true;
  365. this.changeData();
  366. },
  367. //日期处理
  368. initDate(date) {
  369. let fdate = date.split('-');
  370. return {
  371. year: Number(fdate[0] || 1920),
  372. month: Number(fdate[1] || 1),
  373. day: Number(fdate[2] || 1)
  374. }
  375. },
  376. openDisAbled: function(year, month, day) {
  377. let bool = true;
  378. let date = `${year}/${month}/${day}`;
  379. // let today = this.today.replace(/\-/g, '/');
  380. let min = `${this.min.year}/${this.min.month}/${this.min.day}`;
  381. let max = `${this.max.year}/${this.max.month}/${this.max.day}`;
  382. let timestamp = new Date(date).getTime();
  383. if (timestamp >= new Date(min).getTime() && timestamp <= new Date(max).getTime()) {
  384. bool = false;
  385. }
  386. return bool;
  387. },
  388. generateArray: function(start, end) {
  389. return Array.from(new Array(end + 1).keys()).slice(start);
  390. },
  391. formatNum: function(num) {
  392. return num < 10 ? '0' + num : num + '';
  393. },
  394. //一个月有多少天
  395. getMonthDay(year, month) {
  396. let days = new Date(year, month, 0).getDate();
  397. return days;
  398. },
  399. getWeekday(year, month) {
  400. let date = new Date(`${year}/${month}/01 00:00:00`);
  401. return date.getDay();
  402. },
  403. checkRange(year) {
  404. let overstep = false;
  405. if (year < this.minYear || year > this.maxYear) {
  406. uni.showToast({
  407. title: "日期超出范围啦~",
  408. icon: 'none'
  409. })
  410. overstep = true;
  411. }
  412. return overstep;
  413. },
  414. changeMonthHandler(isAdd) {
  415. if (isAdd) {
  416. let month = this.month + 1;
  417. let year = month > 12 ? this.year + 1 : this.year;
  418. if (!this.checkRange(year)) {
  419. this.month = month > 12 ? 1 : month;
  420. this.year = year;
  421. this.changeData();
  422. }
  423. } else {
  424. let month = this.month - 1;
  425. let year = month < 1 ? this.year - 1 : this.year;
  426. if (!this.checkRange(year)) {
  427. this.month = month < 1 ? 12 : month;
  428. this.year = year;
  429. this.changeData();
  430. }
  431. }
  432. },
  433. changeYearHandler(isAdd) {
  434. let year = isAdd ? this.year + 1 : this.year - 1;
  435. if (!this.checkRange(year)) {
  436. this.year = year;
  437. this.changeData();
  438. }
  439. },
  440. changeData() {
  441. this.days = this.getMonthDay(this.year, this.month);
  442. this.daysArr = this.generateArray(1, this.days)
  443. this.weekday = this.getWeekday(this.year, this.month);
  444. this.weekdayArr = this.generateArray(1, this.weekday)
  445. this.showTitle = `${this.year}年${this.month}月`;
  446. if (this.isChange && this.mode == 'date') {
  447. this.btnFix(true);
  448. }
  449. },
  450. dateClick: function(day) {
  451. day += 1;
  452. if (!this.openDisAbled(this.year, this.month, day)) {
  453. this.day = day;
  454. let date = `${this.year}-${this.month}-${day}`;
  455. if (this.mode == 'date') {
  456. this.activeDate = date;
  457. } else {
  458. let compare = new Date(date.replace(/\-/g, '/')).getTime() < new Date(this.startDate.replace(/\-/g, '/')).getTime()
  459. if (this.isStart || compare) {
  460. this.startDate = date;
  461. this.startYear = this.year;
  462. this.startMonth = this.month;
  463. this.startDay = this.day;
  464. this.endYear = 0;
  465. this.endMonth = 0;
  466. this.endDay = 0;
  467. this.endDate = "";
  468. this.activeDate = "";
  469. this.isStart = false;
  470. } else {
  471. this.endDate = date;
  472. this.endYear = this.year;
  473. this.endMonth = this.month;
  474. this.endDay = this.day;
  475. this.isStart = true;
  476. }
  477. }
  478. }
  479. },
  480. close() {
  481. // 修改通过v-model绑定的父组件变量的值为false,从而隐藏日历弹窗
  482. this.$emit('input', false);
  483. },
  484. getWeekText(date) {
  485. date = new Date(`${date.replace(/\-/g, '/')} 00:00:00`);
  486. let week = date.getDay();
  487. return '星期' + ['日', '一', '二', '三', '四', '五', '六'][week];
  488. },
  489. btnFix(show) {
  490. if (!show) {
  491. this.close();
  492. }
  493. if (this.mode == 'date') {
  494. let arr = this.activeDate.split('-')
  495. let year = this.isChange ? this.year : Number(arr[0]);
  496. let month = this.isChange ? this.month : Number(arr[1]);
  497. let day = this.isChange ? this.day : Number(arr[2]);
  498. //当前月有多少天
  499. let days = this.getMonthDay(year, month);
  500. let result = `${year}-${this.formatNum(month)}-${this.formatNum(day)}`;
  501. let weekText = this.getWeekText(result);
  502. let isToday = false;
  503. if (`${year}-${month}-${day}` == this.today) {
  504. //今天
  505. isToday = true;
  506. }
  507. this.$emit('change', {
  508. year: year,
  509. month: month,
  510. day: day,
  511. days: days,
  512. result: result,
  513. week: weekText,
  514. isToday: isToday,
  515. // switch: show //是否是切换年月操作
  516. });
  517. } else {
  518. if (!this.startDate || !this.endDate) return;
  519. let startMonth = this.formatNum(this.startMonth);
  520. let startDay = this.formatNum(this.startDay);
  521. let startDate = `${this.startYear}-${startMonth}-${startDay}`;
  522. let startWeek = this.getWeekText(startDate)
  523. let endMonth = this.formatNum(this.endMonth);
  524. let endDay = this.formatNum(this.endDay);
  525. let endDate = `${this.endYear}-${endMonth}-${endDay}`;
  526. let endWeek = this.getWeekText(endDate);
  527. this.$emit('change', {
  528. startYear: this.startYear,
  529. startMonth: this.startMonth,
  530. startDay: this.startDay,
  531. startDate: startDate,
  532. startWeek: startWeek,
  533. endYear: this.endYear,
  534. endMonth: this.endMonth,
  535. endDay: this.endDay,
  536. endDate: endDate,
  537. endWeek: endWeek
  538. });
  539. }
  540. }
  541. }
  542. };
  543. </script>
  544. <style scoped lang="scss">
  545. @import "../../libs/css/style.components.scss";
  546. .u-calendar {
  547. color: $u-content-color;
  548. &__header {
  549. width: 100%;
  550. box-sizing: border-box;
  551. font-size: 30rpx;
  552. background-color: #fff;
  553. color: $u-main-color;
  554. &__text {
  555. margin-top: 30rpx;
  556. padding: 0 60rpx;
  557. @include vue-flex;
  558. justify-content: center;
  559. align-items: center;
  560. }
  561. }
  562. &__action {
  563. padding: 40rpx 0 40rpx 0;
  564. &__icon {
  565. margin: 0 16rpx;
  566. }
  567. &__text {
  568. padding: 0 16rpx;
  569. color: $u-main-color;
  570. font-size: 32rpx;
  571. line-height: 32rpx;
  572. font-weight: bold;
  573. }
  574. }
  575. &__week-day {
  576. @include vue-flex;
  577. align-items: center;
  578. justify-content: center;
  579. padding: 6px 0;
  580. overflow: hidden;
  581. &__text {
  582. flex: 1;
  583. text-align: center;
  584. }
  585. }
  586. &__content {
  587. width: 100%;
  588. @include vue-flex;
  589. flex-wrap: wrap;
  590. padding: 6px 0;
  591. box-sizing: border-box;
  592. background-color: #fff;
  593. position: relative;
  594. &--end-date {
  595. border-top-right-radius: 8rpx;
  596. border-bottom-right-radius: 8rpx;
  597. }
  598. &--start-date {
  599. border-top-left-radius: 8rpx;
  600. border-bottom-left-radius: 8rpx;
  601. }
  602. &__item {
  603. width: 14.2857%;
  604. @include vue-flex;
  605. align-items: center;
  606. justify-content: center;
  607. padding: 6px 0;
  608. overflow: hidden;
  609. position: relative;
  610. z-index: 2;
  611. &__inner {
  612. height: 84rpx;
  613. @include vue-flex;
  614. align-items: center;
  615. justify-content: center;
  616. flex-direction: column;
  617. font-size: 32rpx;
  618. position: relative;
  619. border-radius: 50%;
  620. &__desc {
  621. width: 100%;
  622. font-size: 24rpx;
  623. line-height: 24rpx;
  624. transform: scale(0.75);
  625. transform-origin: center center;
  626. position: absolute;
  627. left: 0;
  628. text-align: center;
  629. bottom: 2rpx;
  630. }
  631. }
  632. &__tips {
  633. width: 100%;
  634. font-size: 24rpx;
  635. line-height: 24rpx;
  636. position: absolute;
  637. left: 0;
  638. transform: scale(0.8);
  639. transform-origin: center center;
  640. text-align: center;
  641. bottom: 8rpx;
  642. z-index: 2;
  643. }
  644. }
  645. &__bg-month {
  646. position: absolute;
  647. font-size: 130px;
  648. line-height: 130px;
  649. left: 50%;
  650. top: 50%;
  651. transform: translate(-50%, -50%);
  652. color: #e4e7ed;
  653. z-index: 1;
  654. }
  655. }
  656. &__bottom {
  657. width: 100%;
  658. @include vue-flex;
  659. align-items: center;
  660. justify-content: center;
  661. flex-direction: column;
  662. background-color: #fff;
  663. padding: 0 40rpx 30rpx;
  664. box-sizing: border-box;
  665. font-size: 24rpx;
  666. color: $u-tips-color;
  667. &__choose {
  668. height: 50rpx;
  669. }
  670. &__btn {
  671. width: 100%;
  672. }
  673. }
  674. }
  675. </style>