select_date.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="popup" @tap="closePopup">
  3. <view class="model" @tap.stop>
  4. <view class="title">
  5. <text>选择时间段</text>
  6. <image src="/static/index/cut.png" mode="" @click="isAddGroup = false"></image>
  7. </view>
  8. <view class="popup-body">
  9. <view class="time-picker">
  10. <text>开始时间</text>
  11. <!-- <picker mode="date" :value="startTime" @change="onStartTimeChange">
  12. <view class="picker">{{ startTime }}</view>
  13. </picker> -->
  14. </view>
  15. <view class="time-picker">
  16. <text>结束时间</text>
  17. <!-- <picker mode="date" :value="endTime" @change="onEndTimeChange">
  18. <view class="picker">{{ endTime }}</view>
  19. </picker> -->
  20. </view>
  21. </view>
  22. <view class="foot">
  23. <view @tap="closePopup">取消</view>
  24. <view @tap="confirm">确定</view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. startTime: '开始时间',
  34. endTime: '结束时间'
  35. };
  36. },
  37. methods: {
  38. closePopup() {
  39. this.$emit('close');
  40. },
  41. confirm() {
  42. this.$emit('confirm', {
  43. startTime: this.startTime,
  44. endTime: this.endTime
  45. });
  46. this.closePopup();
  47. },
  48. onStartTimeChange(e) {
  49. this.startTime = e.detail.value;
  50. },
  51. onEndTimeChange(e) {
  52. this.endTime = e.detail.value;
  53. }
  54. }
  55. };
  56. </script>
  57. <style lang="scss" scoped>
  58. .popup {
  59. width: 100vw;
  60. height: 100vh;
  61. position: fixed;
  62. top: 0;
  63. left: 0;
  64. background: rgba(0, 0, 0, 0.4);
  65. display: flex;
  66. align-items: end;
  67. z-index: 99;
  68. .model{
  69. width: 100%;
  70. background-color: #fff;
  71. border-radius: 20rpx 20rpx 0rpx 0rpx;
  72. padding: 0rpx 24rpx;
  73. padding-bottom: 20rpx;
  74. .title {
  75. width: 100%;
  76. height: 86rpx;
  77. display: flex;
  78. align-items: center;
  79. justify-content: center;
  80. position: relative;
  81. border-bottom: 1px solid #eeeeee;
  82. margin-bottom: 24rpx;
  83. image {
  84. width: 40rpx;
  85. height: 40rpx;
  86. position: absolute;
  87. right: 0px;
  88. }
  89. }
  90. .foot{
  91. }
  92. }
  93. }
  94. .popup-content {
  95. background-color: #fff;
  96. width: 80%;
  97. border-radius: 10px;
  98. overflow: hidden;
  99. }
  100. .popup-header {
  101. padding: 20px;
  102. border-bottom: 1px solid #eee;
  103. text-align: center;
  104. font-size: 18px;
  105. font-weight: bold;
  106. }
  107. .popup-body {
  108. padding: 20px;
  109. }
  110. .time-picker {
  111. margin-bottom: 20px;
  112. }
  113. .time-picker text {
  114. display: block;
  115. margin-bottom: 10px;
  116. font-size: 16px;
  117. }
  118. .picker {
  119. padding: 10px;
  120. border: 1px solid #eee;
  121. border-radius: 5px;
  122. text-align: center;
  123. }
  124. .popup-footer {
  125. display: flex;
  126. justify-content: space-between;
  127. padding: 10px;
  128. border-top: 1px solid #eee;
  129. }
  130. .popup-footer button {
  131. flex: 1;
  132. margin: 0 5px;
  133. }
  134. </style>