dmCalendarView.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <dm-pop-view ref='popView' title="选择时段" :isShowConfirm="true" :maskTapHide='maskTapHide' @confirm="confirmAction">
  3. <view class="content">
  4. <uni-calendar
  5. :date = "date==''?startDate:date"
  6. :insert="true"
  7. :lunar="true"
  8. :range = "false"
  9. :startDate = "afterDate"
  10. :end-date="nowDate"
  11. @change="change"
  12. />
  13. </view>
  14. </dm-pop-view>
  15. </template>
  16. <script>
  17. import dmPopView from './dmPopView.vue'
  18. import uniCalendar from '../uni-calendar/uni-calendar.vue'
  19. import moment from '../../static/moment.min.js'
  20. export default {
  21. props: {
  22. maskTapHide: {
  23. type: Boolean,
  24. default: true
  25. },
  26. dataList: Array,
  27. date: String
  28. },
  29. data() {
  30. return {
  31. nowDate:'',
  32. afterDate:'',
  33. startDate: '',
  34. endDate: ''
  35. }
  36. },
  37. created() {
  38. this.startDate = moment().locale('zh-cn').format('YYYY-MM-DD');
  39. },
  40. methods: {
  41. show() {
  42. this.$refs.popView.show()
  43. },
  44. confirmAction() {
  45. this.$emit('confirm',this.startDate)
  46. },
  47. change(e) {
  48. this.startDate = e.fulldate;
  49. }
  50. },
  51. components: {
  52. dmPopView,
  53. uniCalendar
  54. }
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .content {
  59. width: 100%;
  60. height: 776rpx;
  61. font-family: Verdana;
  62. padding-bottom: 100rpx;
  63. .list-content {
  64. margin-top: 20rpx;
  65. border-radius: 20rpx;
  66. background-color: #FFFFFF;
  67. margin-left: 20rpx;
  68. width: 670rpx;
  69. display: flex;
  70. flex-direction: column;
  71. padding: 30rpx 20rpx;
  72. .list-title {
  73. color: #333333;
  74. font-size: 28rpx;
  75. font-weight: bold;
  76. }
  77. .list-content-detail {
  78. margin-top: 14rpx;
  79. color: #333333;
  80. font-size: 24rpx;
  81. line-height: 46rpx;
  82. }
  83. }
  84. }
  85. </style>