<template>
  <scroll-view scroll-y="true" class="scroll-Y">
    <wx-points-commit ref="wxPointsCommit"></wx-points-commit>
    <van-checkbox-group
      @change="checkboxChange"
      v-model="checkedList"
      checked-color="#EA3323"
    >
      <div class="container" v-if="false">
        <!--todo: 杭州首停不显示暂时根据groupId写死-->
        <div class="item">
          <div class="title">首停优惠</div>
          <div class="content">
            首停减免{{ parkInfoEntity.parkHour }}小时。可优惠{{
              firstParkDiscountFee
            }}元
          </div>
        </div>
        <van-checkbox
          value="firstPark"
          color="#fff"
          :checked="isCheck('firstPark')"
        />
      </div>

      <div class="container" v-if="parkInfoEntity.memberLevelReduce">
        <div class="item">
          <div class="title">会员等级减免</div>
          <div class="content">
            {{ memberDiscount.memberOrderdesc || '' }}减免{{
              memberDiscount.reduceContent || 0
            }}小时。可优惠{{ memberDiscountFee || 0 }}元
          </div>
        </div>
        <van-checkbox
          name="member"
          color="#fff"
          :disabled="
            (!isCheck('member') && isDiscountDisabled) ||
            isMemberDiscountDisabled ||
            memberDiscount.reduceContent <= 0
          "
          :checked="isCheck('member')"
        />
        <div class="member-discount-info" v-if="isMemberDiscountDisabled">
          当日已使用
        </div>
      </div>
      <div class="container" v-if="isShowReduceDiscount">
        <div class="item">
          <div class="title">消费减免</div>
          <!-- <div class="content" v-if="parkInfoEntity.parkMallCode === 1 && parkInfoEntity.expirationDate">{{reduceDiscountMessage}}</div> -->
          <div class="content" v-if="parkInfoEntity.parkMallCode !== 1">
            {{ todayReduceDiscountMessage }}
          </div>
          <uni-number-box
            v-if="parkInfoEntity.isSplit === 0 && maxReduceDiscount > 0"
            :min="1"
            :max="maxReduceDiscount"
            v-model="reduceHours"
            @input="reducesChange"
          ></uni-number-box>
        </div>
        <van-checkbox
          name="reduces"
          color="#fff"
          :disabled="
            (!isCheck('reduces') && isDiscountDisabled) ||
            !reducesDiscount.recuceContent
          "
          :checked="isCheck('reduces')"
        />
      </div>
      <div class="flewx">
        <div class="flewx-content">
          应付<span style="color: red; font-size: 32px; padding-left: 20px">{{
            actualFee | currency
          }}</span>
          元
          <span style="color: #8d8d8d; padding-left: 30px; font-size: 28px"
            >已优惠{{ discountFee | currency }}元</span
          >
        </div>
        <div
          :class="{
            flewx_index3: true,
            blue_flewx_index3: custTypeId === 1,
            green_flewx_index3: custTypeId === 2,
            'btn-disabled': !parkInfo.servicefee,
          }"
          @click="confirm"
        >
          确定
        </div>
      </div>
    </van-checkbox-group>
  </scroll-view>
</template>

<script>
import parkingFeeDiscountsJs from '../../mixins/parkingFeeDiscounts';

export default {
  mixins: [parkingFeeDiscountsJs],
};
</script>

<style lang="less" scoped>
//@import '../../styles/common.less';
.scroll-Y {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f1f1f1;
}

.container {
  background-color: #fff;
  width: 650px;
  margin: 25px 30px;
  padding-left: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  line-height: 70px;
  position: relative;

  .item {
    width: 570px;
    padding: 20px 0;

    .title {
      font-size: 34px;
    }

    .content {
      font-size: 28px;
      color: #989898;
    }
  }

  .member-discount-info {
    font-size: 20px;
    position: absolute;
    right: 12px;
    bottom: 0;
    color: #989898;
  }

  .page_img {
    width: 49px;
    height: 49px;
    border: 1px solid #e6e6e6;
    border-radius: 50%;
    overflow: hidden;

    image {
      width: 50px;
      height: 50px;
      margin-left: -1px;
    }
  }
}

.flewx {
  width: 100%;
  height: 100px;
  background-color: #fff;
  position: fixed;
  bottom: 0;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  // padding-bottom: constant(safe-area-inset-bottom);
  // padding-bottom: env(safe-area-inset-bottom);
  padding-bottom: 20px;

  .flewx-content {
    position: absolute;
    left: 16px;
  }

  .flewx_index3 {
    width: 150px;
    height: 70px;
    border-radius: 50px;
    text-align: center;
    font-size: 28px;
    line-height: 70px;
    color: #fff;
    background-image: linear-gradient(to right, #7e4fa1, #433c7f);
    box-shadow: 2px 3px 5px #888888;
    position: absolute;
    right: 16px;
  }

  .blue_flewx_index3 {
    .color-background-color('blue');
  }

  .green_flewx_index3 {
    .color-background-color('green');
  }
}

/deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  background-color: red !important;
  border-radius: 50% !important;
  border: 1px solid red;
}

/deep/ checkbox .wx-checkbox-input {
  border-radius: 50% !important;
}
</style>
