<template>
  <scroll-view scroll-y="true" class="scroll-Y">
    <div>
      <wx-points-commit ref="wxPointsCommit"></wx-points-commit>

      <div class="worp">
        <div style="font-size: 32px">纸质优惠劵减免说明</div>
        <div style="font-size: 28px; color: #808080; padding-top: 12px">{{
            parkPaperCouponRemark
          }}</div>
      </div>
      <template v-if="paperCouponList.length">
        <div
          class="worp_index1"
          v-for="(item, index) in paperCouponList"
          :key="item.discountCode"
        >
          <div class="worp_index1_index">
            <div class="content">劵码 {{ item.discountCode }}</div>
            <div @click="deleteCoupon(index)"
            ><img
              :src="require('../../static/images/delete.png')"
              style="width: 30px; height: 30px; margin-right: 20px"
            /></div>
          </div>
          <div
            style="
                padding-bottom: 25px;
                margin-left: 20px;
                margin-top: 20px;
                font-size: 28px;
              "
          >优惠劵金额 :<span style="color: #ed1c24">{{
              item.discountValueMoney | currency
            }}</span></div
          >
        </div>
      </template>

      <div
        :class="{
            worp_button: true,
            blue_flewx_index3: custTypeId === 1,
            green_flewx_index3: custTypeId === 2,
          }"
        @click="scanCode"
      >
        <img
          :src="require('../../static/images/sweep.png')"
          style="width: 35px; height: 35px; margin-right: 20px"
        />
        <div>扫码用劵</div>
      </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>
      <!-- 新的toast -->
      <fui-toast ref="toast"></fui-toast>
    </div>
  </scroll-view>
</template>

<script>
import parkingFeePaperCouponJs from '../../mixins/parkingFeePaperCoupon'
export default {
  mixins:[parkingFeePaperCouponJs]
}
</script>

<style lang="less" scoped>
//@import '../../styles/common.less';
.scroll-Y {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f1f1f1;
}
.worp {
  padding-left: 30px;
  margin-top: 30px;
  overflow: hidden;
}
.worp_index1 {
  width: 92%;
  background-color: #fff;
  margin-top: 30px;
  border-radius: 10px;
  margin-left: 4%;
  font-size: 30px;
}
.worp_index1_index {
  width: 650px;
  height: 60px;
  margin-left: 20px;
  border-bottom: 1px solid #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  .content {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}
.worp_button {
  width: 690px;
  height: 80px;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  line-height: 80px;
  color: #fff;
  margin-top: 40px;
  background-image: linear-gradient(to right, #7e4fa1, #433c7f);
  margin-left: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flewx {
  width: 100%;
  height: 100px;
  background-color: #fff;
  position: fixed;
  bottom: 0;
  display: flex;
  align-items: center;
  // 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_flewx_index3('blue');
}
.green_flewx_index3 {
  .color_flewx_index3('green');
}
.color_flewx_index3(@value) {
  @color: 'color-@{value}';
  background-image: none !important;
  background-color: @@color !important;
}
</style>
