ll
liukangdong
2024-11-07 b158a9a85078d57a0e660aba680f6ad88da7ab6a
h5/pages/staff/vehicle/shiwai.vue
@@ -21,7 +21,7 @@
          <text>*</text>
          <text>预计用车时段</text>
        </view>
        <view class="value" @click="isShowDate = true">
        <view class="value" @click="showDate">
          <text
            class="mr6"
            :style="{ color: param.startTime ? '#000000' : '#999999' }"
@@ -66,11 +66,14 @@
      </view>
    </view>
    <view class="main_footer">
      <text>已选择:</text>
      <text class="sel" v-if="param.startTime"
        >{{ param.startHours }}至{{ param.endHours }}</text
      >
      <text class="btn" :class="{disable: info && info.length > 0}" @click="onSubmit">确认预约</text>
      <view class="df_sb">
            <text>已选择:</text>
            <text class="sel" v-if="param.startTime"
              >{{ param.startHours }}至{{ param.endHours }}</text
            >
            <text class="btn" :class="{disable: info && info.length > 0}" @click="onSubmit">确认预约</text>
         </view>
         <view class="red">{{placeStr}}</view>
    </view>
    <!--  -->
    <!-- 选择车辆 -->
@@ -97,6 +100,7 @@
      <u-datetime-picker
         mode="datetime"
         :show="isShowDate"
         ref="startPick"
         title="开始时间"
         :minDate="minDate"
         @close="isShowDate = false"
@@ -130,15 +134,22 @@
      carsList: [],
      info: [],
      minDate: ''
      minDate: '',
         placeStr: ''
    }
  },
  onLoad() {
    this.minDate = new Date(dayjs().format('YYYY-MM-DD HH:mm') + ':00').getTime()
    console.log('minDate', this.minDate);
    // this.minDate = new Date(dayjs().format('YYYY-MM-DD HH:mm') + ':00').getTime()
    this.minDate = new Date().getTime() - (6 * 24 * 60 * 60 * 1000)
    this.initData()
  },
  methods: {
      showDate() {
         this.isShowDate = true
         if (!this.param.startTime) {
            this.$refs.startPick.innerValue = new Date().getTime()
         }
      },
    onSubmit() {
      const { param, info } = this
      if (info.length > 0) return
@@ -198,6 +209,12 @@
      if (this.param.carId && this.param.startTime) {
        this.getInfo()
      }
         console.log(e);
         if(new Date(this.param.startTime).getTime() < new Date().getTime() - 60 * 1000){
            this.placeStr = '当前选择包含已经过去时间,请确认后再提交;'
         }else{
            this.placeStr = ''
         }
      this.$forceUpdate()
    },
    endtimeClose() {
@@ -328,9 +345,12 @@
  bottom: 0;
  padding: 20rpx 30rpx 84rpx;
  box-shadow: 0rpx -3rpx 6rpx 0rpx #eeeeee;
  display: flex;
  align-items: center;
  justify-content: space-between;
   .df_sb{
      display: flex;
      align-items: center;
      justify-content: space-between;
   }
  .btn {
    width: 184rpx;
    height: 72rpx;