jiangping
2024-10-21 c5a0ff2661fe362dddbe88c6a28d19c48c24c39b
h5/pages/staff/vehicle/shiwai.vue
@@ -24,7 +24,7 @@
        <view class="value" @click="isShowDate = true">
          <text
            class="mr6"
            :style="{ color: param.startTime ? '#999999' : '#999999' }"
            :style="{ color: param.startTime ? '#000000' : '#999999' }"
          >
            <template v-if="param.startTime">
              {{ param.startHours }}至{{ param.endHours }}
@@ -36,8 +36,8 @@
      </view>
    </view>
    <view class="have_info" v-if="info && info.length > 0">
      <view class="tit">您申请的用车时段已有车辆预约</view>
      <view class="content" v-for="item,i in info" :key="i">
      <view class="tit">您申请的用车时段存在以下预约信息,无法预约</view>
      <view class="content" v-for="(item, i) in info" :key="i">
        <view class="card">{{ item.carCode }}</view>
        <view class="line">
          <text>用车时段</text>
@@ -61,7 +61,7 @@
        </view>
        <view class="line">
          <text>申请人</text>
          <text>{{ item.memberName }} {{ item.memberMobile}}</text>
          <text>{{ item.memberName }} {{ item.memberMobile }}</text>
        </view>
      </view>
    </view>
@@ -70,7 +70,7 @@
      <text class="sel" v-if="param.startTime"
        >{{ param.startHours }}至{{ param.endHours }}</text
      >
      <text class="btn" @click="onSubmit">确认预约</text>
      <text class="btn" :class="{disable: info && info.length > 0}" @click="onSubmit">确认预约</text>
    </view>
    <!--  -->
    <!-- 选择车辆 -->
@@ -83,7 +83,7 @@
      @confirm="seletedCar"
      @cancel="isShowCar = false"
    ></u-picker>
    <u-datetime-picker
   <!-- <u-datetime-picker
      mode="datetime"
      :show="isShowDate"
      :filter="timeFilter"
@@ -93,11 +93,20 @@
      :closeOnClickOverlay="true"
      @confirm="seletedDate"
      @cancel="isShowDate = false"
    />
    /> -->
      <u-datetime-picker
         mode="datetime"
         :show="isShowDate"
         title="开始时间"
         :minDate="minDate"
         @close="isShowDate = false"
         :closeOnClickOverlay="true"
         @confirm="seletedDate"
         @cancel="isShowDate = false"
       />
    <u-datetime-picker
      mode="datetime"
      :show="isShowEndDate"
      :filter="timeFilter"
      title="结束时间"
      :minDate="new Date(param.startTime || null).getTime()"
      @close="endtimeClose"
@@ -125,16 +134,14 @@
    }
  },
  onLoad() {
    this.minDate = new Date(dayjs().format('YYYY-MM-DD HH:') + '00:00').getTime()
    this.minDate = new Date(dayjs().format('YYYY-MM-DD HH:mm') + ':00').getTime()
    console.log('minDate', this.minDate);
    this.initData()
  },
  methods: {
    onSubmit() {
      const { param, info } = this
         if (info.length > 0) return uni.showToast({
        title: '请重新选择时间段',
        icon: 'none'
      })
      if (info.length > 0) return
      if (!param.startTime) return uni.showToast({
        title: '请先选择用车时间段',
        icon: 'none'
@@ -206,7 +213,7 @@
    },
    initData() {
      getCarsList({
        type: 1
        type: 0
      }).then(res => {
        this.carsList = [res.data]
      })
@@ -217,7 +224,7 @@
<style lang="scss">
.have_info {
   padding: 0 0 200rpx;
  padding: 0 0 200rpx;
  .tit {
    color: #ed4545;
    margin: 40rpx 0 24rpx;
@@ -226,10 +233,10 @@
    background: #f7f7f7;
    border-radius: 16rpx;
    padding: 30rpx 30rpx 10rpx;
      margin-bottom: 20rpx;
    margin-bottom: 20rpx;
    .card {
      margin-bottom: 30rpx;
      font-weight: 500;
      font-weight: 600;
      font-size: 32rpx;
      color: #222222;
      background: #f7f7f7;
@@ -317,7 +324,7 @@
  position: fixed;
  width: 100%;
  left: 0;
   background-color: #fff;
  background-color: #fff;
  bottom: 0;
  padding: 20rpx 30rpx 84rpx;
  box-shadow: 0rpx -3rpx 6rpx 0rpx #eeeeee;
@@ -329,15 +336,18 @@
    height: 72rpx;
    line-height: 72rpx;
    text-align: center;
    background: #279baa;
    background: $uni-color-primary;
    box-shadow: 0rpx -1rpx 0rpx 0rpx #eeeeee;
    border-radius: 36rpx;
    font-size: 30rpx;
    color: #ffffff;
  }
  .sel {
    color: #279baa;
    color: $uni-color-primary;
    flex: 1;
  }
   .disable{
      background: #CCCCCC;
   }
}
</style>