index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view >
  3. <uni-popup ref="popup" type="bottom" background-color="#fff">
  4. <view class="popup-box">
  5. <view class="flex justify-between popup-title" >
  6. <text @tap="onCancel">取消</text>
  7. <text style=" font-size: 34upx;">选择营业时段</text>
  8. <text style=" color: #449AFF ;" @tap="onConfirm">确定</text>
  9. </view>
  10. <view class="select-date-wrapper">
  11. <view class="select-date" :class="{ active: activeDate == 'startDate' }" @tap="onTapStartDate">
  12. <view class="select-date-value" v-if="startDate">{{ startDate }}</view>
  13. <view class="select-date-placeholder" v-else>请选择时间</view>
  14. </view>
  15. <view style="margin: 0 16px">~</view>
  16. <view class="select-date" :class="{ active: activeDate == 'endDate' }" @tap="onTapEndDate">
  17. <view class="select-date-value" v-if="endDate">{{ endDate }}</view>
  18. <view class="select-date-placeholder" v-else>请选择时间</view>
  19. </view>
  20. </view>
  21. <DateTimePicker
  22. v-if="showStartDatePicker"
  23. @onChange="onChangeStartDate"
  24. :defaultDate="startDate"
  25. :minDate="minDate || ''"
  26. :maxDate="endDate || maxDate || ''"
  27. :mode="mode"
  28. />
  29. <DateTimePicker
  30. v-if="showEndDatePicker"
  31. @onChange="onChangeEndDate"
  32. :defaultDate="endDate"
  33. :minDate="startDate || minDate || ''"
  34. :maxDate="maxDate || ''"
  35. :mode="mode"
  36. />
  37. <!-- <view class="btn-group" v-if="showStartDatePicker || showEndDatePicker">
  38. <view class="btn-cancel" @tap="onCancel">取消</view>
  39. <view class="btn-confirm" @tap="onConfirm">确定</view>
  40. </view> -->
  41. </view>
  42. </uni-popup>
  43. </view>
  44. </template>
  45. <script src="./index.js"></script>
  46. <style lang="css" scoped src="./index.css"></style>