<template>
  <scroll-view
    :class="{ 'scroll-Y': true, 'color-scroll-Y': custTypeId !== 0 }"
  >
    <!--    <wx-points-commit ref='wxPointsCommit'></wx-points-commit>-->
    <!--    <authorize ref="authorize"></authorize>-->
    <!--    <my-protocol-modal ref="szProtocolModal" title="会员协议政策更新提示"></my-protocol-modal>-->
    <div class="wrap">
      <div class="parkingFee">
<!--        <div>{{ `url(${picUrl}${blueHeadBg});` }}:{{ typeof custTypeId }}:{{ custTypeId }}</div>-->
<!--        <img :src="`${picUrl}${blueHeadBg}`" alt="">-->
        <div
          class="parkingFee-top"
          :style="{
            color: '#999',
            background: `url(${require('../../static/images/parking-bgi.png')})`,
            a: 'url()',
            backgroundAttachment: 'fixed',
          }"
        >
          <div
            :class="{
              top_content: true,
              blue_top_content: custTypeId === 1,
              green_top_content: custTypeId === 2,
            }"
            :style="{
              'background-image':
                custTypeId === 1 ? `url(${picUrl}${blueHeadBg})` : '',
            }"
          >
            <div class="title_box">
              <span class="btn">缴费说明</span>
            </div>
            <div class="info" :class="!init_ch ? 'info_show' : ''">
              <span>{{ parkInfoEntity.payinstruction }}</span>
            </div>
          </div>
          <div
            class="top_down"
            @click="top_display"
            v-if="
              !init_ch &&
              parkInfoEntity.payinstruction &&
              parkInfoEntity.payinstruction.length > 60
            "
          >
            ︾
          </div>
          <div class="top_down" @click="top_display" v-else>︽</div>
          <div
            :class="{
              top_menu: true,
              blue_top_menu: custTypeId === 1,
              green_top_menu: custTypeId === 2,
            }"
            v-if="custTypeId >= 0"
          >
            <div class="menu_item" @click="doRouter">
              <img :src="`${require(`../../static/images/icon2${colorAry[custTypeId]}.png`)}`" />
              <span>缴费记录</span>
            </div>
            <div class="menu_item" @click="doRouter3">
              <img :src="`${require(`../../static/images/icon3${colorAry[custTypeId]}.png`)}`" />
              <span>停车劵兑换</span>
            </div>
            <div class="menu_item" @click="doRouter1">
              <img :src="`${require(`../../static/images/icon4${colorAry[custTypeId]}.png`)}`" />
              <span>停车开票</span>
            </div>
            <div class="menu_item" @click="doRouter2">
              <img :src="`${require(`../../static/images/icon1${colorAry[custTypeId]}.png`)}`" />
              <span>车辆管理</span>
            </div>
          </div>
        </div>
        <div
          :class="{
            'parkingFee-bottom': true,
            'blue-parkingFee-bottom': custTypeId === 1,
            'green-parkingFee-bottom': custTypeId === 2,
          }"
        >
          <div class="parkingFee-search">
            <div class="search_tip" v-if="custTypeId === 0">
              <div>车辆类型</div>
              <div class="search_tip_pt">
                <div
                  :class="carType == 0 ? 'search_tip_pt_index' : ''"
                  @click="toggleType(0)"
                >
                  普通车牌
                </div>
                <div
                  :class="carType == 1 ? 'search_tip_pt_index' : ''"
                  @click="toggleType(1)"
                >
                  新能源
                </div>
                <div
                  :class="carType == 2 ? 'search_tip_pt_index' : ''"
                  @click="toggleType(2)"
                >
                  特殊车牌
                </div>
              </div>
            </div>
            <div
              :class="{
                blueClassify: custTypeId === 1,
                greenClassify: custTypeId === 2,
              }"
              v-else
            >
              <div
                :class="{ classifyItem: true, isChecked: carType === index }"
                v-for="(item, index) in classifyList"
                :key="index"
              >
                <div @click="toggleType(index)">{{ item }}</div>
              </div>
            </div>
            <div class="input-box">
              <div
                class="li"
                @click="clickShowKeyboard(0)"
                :class="[active === 0 ? 'active' : '']"
              >
                {{ numArr[0] }}
              </div>
              <div
                class="li"
                @click="clickShowKeyboard(1)"
                :class="[active === 1 ? 'active' : '']"
              >
                {{ numArr[1] }}
              </div>
              <div class="input_box_dian">·</div>
              <div
                class="li"
                @click="clickShowKeyboard(2)"
                :class="[active === 2 ? 'active' : '']"
              >
                {{ numArr[2] }}
              </div>
              <div
                class="li"
                @click="clickShowKeyboard(3)"
                :class="[active === 3 ? 'active' : '']"
              >
                {{ numArr[3] }}
              </div>
              <div
                class="li"
                @click="clickShowKeyboard(4)"
                :class="[active === 4 ? 'active' : '']"
              >
                {{ numArr[4] }}
              </div>
              <div
                class="li"
                @click="clickShowKeyboard(5)"
                :class="[active === 5 ? 'active' : '']"
              >
                {{ numArr[5] }}
              </div>
              <div
                class="li"
                @click="clickShowKeyboard(6)"
                :class="[active === 6 ? 'active' : '']"
              >
                {{ numArr[6] }}
              </div>
              <div
                class="li"
                @click="clickShowKeyboard(7)"
                :class="[active === 7 ? 'active' : '']"
                v-if="carType == 1"
              >
                <span v-if="numArr[7]">{{ numArr[7] }}</span>
              </div>
            </div>
            <div
              type="primary"
              class="search-btn"
              :class="disabledBtn ? 'disabled-btn' : ''"
              :disabled="disabledBtn"
              @click="preHandleSearch"
            >
              查询缴费
            </div>
          </div>
          <div class="vehicleMgt-list">
            <div class="vehicleMgt-title">
              <div>历史车辆</div>
              <!-- <image src="./static/images/icon5.png" class="vehicleMgt-title-img"/> -->
            </div>
            <div class="vehicleMgt-content" v-if="carList.length">
              <div
                class="item"
                v-for="(item, index) in carList"
                :key="index"
                @click="toHandleSearch(item, 1)"
                :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''"
              >
                {{ item | formatCarno }}
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <plate-number
      ref="plateKeyboard"
      :carType="carType"
      :active="active"
      :ind="ind"
      :numArr="numArr"
      @carnoArr="updateCarno"
    ></plate-number>
  </scroll-view>
</template>

<script>
import homeJs from '../../mixins/home';

export default {
  // ...homeJs,
  // mixins: [homeJs],
  ...homeJs,
  name: 'baseCom',
};
</script>

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

.color-scroll-Y {
  background: #e7e9ea;
}

.wrap {
  display: flex;
  flex-direction: column;
  width: 100%;

  .parkingFee {
    display: flex;
    flex-direction: column;

    .parkingFee-top {
      display: flex;
      flex-direction: column;
      background-size: 100% 30%;
      // height: 350px;
      // margin-bottom: 25px;

      .top_content {
        padding: 25px 35px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;

        span {
          font-size: 24px;
          color: #898989;
          text-align: left;
        }

        .title_box {
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 20px;

          .btn {
            padding: 0px 14px;
            box-sizing: border-box;
            border-radius: 20px;
            font-size: 30px;
            color: #000;
            text-align: center;
          }
        }

        .info {
          padding-left: 18px;
          font-size: 27px;
          width: 95%;
          color: #666;
          line-height: 45px;
        }

        .info_show {
          word-break: break-all;
          text-overflow: ellipsis;
          overflow: hidden;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
        }
      }

      .blue_top_content {
        .color_top_content('blue');
        background-position: 0 0;
        background-size: 100% 100%;
        background-repeat: no-repeat;
      }

      .green_top_content {
        .color_top_content('green');
      }

      .color_top_content(@value) {
        @color: 'color-@{value}';
        background-color: @@color;
        span {
          color: @color-white;
        }
        .title_box {
          .btn {
            color: @color-gold;
          }
        }
        .info {
          font-size: 24px;
        }
      }

      .top_down {
        width: 100%;
        text-align: center;
        color: #b0a9a9;
      }
    }

    .top_menu {
      margin-top: 10px;
      background: #fff;
      padding-top: 50px;
      box-sizing: border-box;
      display: flex;
      justify-content: space-between;
      border-radius: 15px;
      // position: absolute;
      // left: 50%;
      box-shadow: 0 0 5px #666;
      // transform: translateX(-50%);
      top: 160px;
      width: 700px;
      margin-left: 25px;
      height: 250px;

      .menu_item {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 33.3%;

        img {
          width: 100px;
          height: 100px;
        }

        span {
          font-size: 30px;
          margin-top: 10px;
        }
      }
    }

    .blue_top_menu {
      .color_top_menu('blue');
      background: @color-pink;
    }

    .green_top_menu {
      .color_top_menu('green');
      background: @color-light-green;
    }

    .color_top_menu(@value) {
      @color: 'color-@{value}';
      margin-top: 0;
      margin-left: 0;
      padding-top: 0;
      width: 100%;
      height: 211px;
      color: @@color;
      border-radius: 0;
      align-items: center;
      .menu_item {
        width: 25%;

        image {
          width: 83px;
          height: 83px;
        }

        span {
          font-size: 24px;
          margin-top: 20px;
        }
      }
    }

    .parkingFee-bottom {
      width: 100%;
      display: flex;
      flex-direction: column;
      padding: 14px 25px;
      box-sizing: border-box;
      padding-bottom: 65px;
      // 车牌号查询
      .parkingFee-search {
        width: 100%;
        display: flex;
        flex-direction: column;
        background: #fff;
        border-radius: 15px;
        padding: 26px 25px 20px;
        box-sizing: border-box;

        .search_tip {
          margin-bottom: 10px;
          width: 100%;
          margin-left: -1px;
          font-size: 24px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          font-size: 30px;

          .search_tip_pt {
            font-size: 28px;
            width: 470px;
            display: flex;
            justify-content: space-around;
            align-items: center;
            border: 1px solid #8d8d8d;
            height: 70px;
            color: #8d8d8d;
            overflow: hidden;
            border-radius: 50px;

            div {
              height: 100%;
              border-radius: 50px;
              line-height: 65px;
              text-align: center;
            }

            div:nth-child(1) {
              width: 37%;
            }

            div:nth-child(2) {
              width: 36%;
            }

            div:nth-child(3) {
              width: 37%;
            }

            .search_tip_pt_index {
              color: #fff;
              background-image: linear-gradient(to right, #7e4fa1, #433c7f);
            }
          }
        }

        // 车牌号 & 虚拟键盘
        .input-box {
          width: 100%;
          height: 100px;
          margin: auto;
          background: rgba(255, 255, 255, 1);
          border-radius: 0.4rem;
          margin: 1rem auto;
          display: flex;
          justify-content: center;

          .li {
            flex: 1;
            border: 1px solid rgba(206, 208, 210, 1);
            box-sizing: border-box;
            margin: 0 2px;
            font-size: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #703a98;

            image {
              width: 80%;
              height: 100%;
            }

            &.active {
              border-color: #3e67ff;
            }
          }

          .input_box_dian {
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 120px;
            color: #703a98;
          }
        }

        .search-btn {
          color: #fff;
          margin: 0 auto;
          height: 90px;
          width: 98%;
          line-height: 90px;
          border-radius: 80px;
          font-size: 34px;
          text-align: center;
          background-image: linear-gradient(to right, #7e4fa1, #433c7f);
        }

        .disabled-btn {
          background-color: #c1c1c1 !important;
          background-image: none !important;
        }
      }

      .vehicleMgt-list {
        display: flex;
        flex-direction: column;
        margin-bottom: 35px;
        margin-top: 20px;

        .vehicleMgt-title {
          width: 91%;
          display: flex;
          justify-content: space-between;
          margin-left: 4%;
          // padding-left: 30px;
          padding-top: 30px;
          box-sizing: border-box;
          border-top: 1px solid #f2f2f2;
          font-size: 30px;

          .vehicleMgt-title-img {
            width: 30px;
            height: 30px;
          }
        }

        .vehicleMgt-content {
          width: 94%;
          margin-left: 3%;
          display: flex;
          flex-wrap: wrap;
          // justify-content: space-around;
          border-radius: 15px;

          .item {
            width: 30%;
            height: 60px;
            margin-top: 30px;
            margin-left: 16px;
            text-align: center;
            box-sizing: border-box;
            border: 2px solid #dcdcdc;
            line-height: 60px;
            font-size: 26px;
            border-radius: 10px;
            color: #a5a5a5;
          }

          .vehicleMgt-content_cls {
            color: #703a98;
            border: 2px solid #703a98;
          }

          // .item::after {
          // 	content: '';
          // 	display: block;
          // 	height: 1px;
          // 	width: 92%;
          // 	position: absolute;
          // 	background-color: #F2F2F2;
          // 	bottom: 0px;
          // 	left: 4%;
          // }
          // .item:last-child::after {
          // 	display: none;
          // }
        }
      }

      .search-list {
        display: flex;
        flex-direction: column;
        background: #fff;
        padding: 0 30px;
        box-sizing: border-box;
        margin-top: 20px;
        border-radius: 15px;
        width: 100%;

        .list_item {
          padding: 38px 0;
          box-sizing: border-box;
          display: flex;
          align-items: center;
          justify-content: space-between;
          border-bottom: 1px solid #f2f2f2;

          span {
            font-size: 28px;
          }

          button {
            height: 60px;
            line-height: 60px;
            margin: 0;
          }
        }
      }
    }

    .blue-parkingFee-bottom {
      .color-parkingFee-bottom('blue');
    }

    .green-parkingFee-bottom {
      .color-parkingFee-bottom('green');
    }

    .color-parkingFee-bottom(@value) {
      @color: 'color-@{value}';
      width: auto;
      padding-bottom: 0;
      padding: 22px 20px 0 20px;
      .parkingFee-search {
        padding: 0 0 31px 0;

        .blueClassify {
          .colorClassify('blue');
        }

        .greenClassify {
          .colorClassify('green');
        }

        .input-box {
          width: 682px;

          .li {
            color: @@color;

            &.active {
              border-color: @@color;
            }
          }

          .input_box_dian {
            color: @@color;
          }
        }

        .search-btn {
          font-size: 34px;
          background-image: none;
          background-color: @@color;
        }
      }
      .vehicleMgt-list {
        background-color: @color-white;

        .vehicleMgt-title {
          padding-top: 0;
          padding: 23px;
          margin-left: 0;
        }

        .vehicleMgt-content {
          width: 100%;
          margin-left: 0;
          padding: 16px 35px 25px 35px;
          box-sizing: border-box;

          .item {
            font-size: 28px;
            margin-top: 0;
            margin-left: 0;
            margin-right: 30px;
            margin-top: 41px;

            &:nth-child(-n + 3) {
              margin-top: 0;
            }

            &:nth-child(3n) {
              margin-right: 0;
            }
          }

          .vehicleMgt-content_cls {
            color: @color-white;
            border: 0px;
            background-color: @@color;
          }
        }
      }
    }
  }
}

// 缴费说明
.payInstruct_wrap {
  width: 300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;

  .scroll {
    height: 600px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;

    .payInstruct_title {
      font-size: 30px;
      text-align: center;
      padding: 20px 0;
      box-sizing: border-box;
      border-bottom: 1px solid #f2f2f2;
    }

    .payInstruct_con {
      display: flex;
      width: 100%;
      padding: 20px 10px;
      box-sizing: border-box;

      span {
        font-size: 28px;
        color: #999;
      }
    }
  }
}

.class-van-button-small {
  min-width: 0;
  border-radius: 10px;
  margin: 10px 3px;
  box-shadow: 10px 10px 10px #aaa;
}

.class-plate-box {
  width: 100%;
  padding: 24px 0;
  box-sizing: border-box;
  position: relative;
}

.plate_number {
  width: 100%;
  display: flex;
  flex-direction: column;

  .plate_number_wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #eaf1f9;
    padding: 0 0 10px;
    box-sizing: border-box;

    .close-box {
      width: 100%;
      font-size: 24px;
      color: #3e67ff;
      text-align: right;
      margin-right: 1.25rem;

      div {
        padding: 10px;
      }
    }

    .plate_chinese_box {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;

      button {
        width: 9%;
        height: 2.5rem;
        line-height: 2.5rem;
        text-align: center;
        padding: 0;
        font-size: 28px;
        .class-van-button-small;
      }
    }
  }
}

.allBoard {
  width: 100%;
  display: flex;
  flex-direction: column;

  .allBoard_wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #eaf1f9;
    padding: 0 0 10px;
    box-sizing: border-box;
  }

  .close-box {
    padding-top: 22px;
    box-sizing: border-box;
    font-size: 24px;
    color: #3e67ff;
    text-align: right;
    margin-right: 1.25rem;
  }

  .plate_number_box {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    button {
      width: 9%;
      height: 2.5rem;
      line-height: 2.5rem;
      text-align: center;
      padding: 0;
      font-size: 28px;
      .class-van-button-small;
    }
  }
}

.delBtn {
  color: #fff;
  height: 38px;
  line-height: 38px;
  font-size: 20px;
  width: 124px;
  border-radius: 7px;
  text-align: center;
  padding: 4px;
  background-color: #c69c6d;
}

.payThe {
  background-color: #fff;
  width: 100%;

  .pay_index {
    text-align: center;
    width: 200px;
    padding-top: 10px;
    margin: 0px auto;
  }

  .pay_title {
    width: 500px;
    display: flex;
    align-items: center;
    margin-top: 30px;
  }

  .pay_title1 {
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
  }

  .pay_title_yhj {
    margin-left: 60px;
    font-size: 20px;
  }

  .pay_title_yhj1 {
    margin-left: 35px;
    font-size: 20px;
  }

  .payjf {
    font-size: 20px;
    margin-left: 30px;
  }

  .paySelect {
    color: rgba(16, 16, 16, 100);
    font-size: 20px;
    font-family: Arial;
    border: 1px solid rgba(187, 187, 187, 100);
    border-radius: 10px;
    margin-left: 80px;
    width: 260px;
    height: 80px;
  }

  .paySelect1 {
    color: rgba(16, 16, 16, 100);
    font-size: 20px;
    font-family: Arial;
    border: 1px solid rgba(187, 187, 187, 100);
    border-radius: 10px;
    margin-left: 80px;
    width: 260px;
    height: 80px;
    display: flex;
    align-items: center;
  }

  .pay-se {
    width: 120px;
    height: 100%;
    background-color: #d8dce6;

    .pay-se-l {
      height: 48%;
      text-align: center;
      font-size: 50px;
      line-height: 68px;
    }

    .pay-se-l1 {
      border-left: 1px solid rgba(187, 187, 187, 100);
      border-bottom: 1px solid rgba(187, 187, 187, 100);
    }

    .pay-se-l2 {
      border-left: 1px solid rgba(187, 187, 187, 100);
    }
  }

  .payjfzk {
    font-size: 20px;
    color: #8b8c8b;
    margin-top: 10px;
    margin-left: 210px;
  }

  .pay_time {
    font-size: 28px;
    margin-left: 180px;
    padding-bottom: 40px;
  }

  .pay_time1 {
    margin-top: 26px;
  }
}

.pay_jiaof {
  width: 97%;
  height: 60px;
  line-height: 60px;
  margin-left: 10px;
  background-color: #c69c6d;
  text-align: center;
  color: rgba(255, 255, 255, 100);
  font-size: 28px;
  font-family: Microsoft Yahei;
  border-radius: 10px;
  margin-top: 20px;
}

.sq_content {
  width: 700px;
  background-color: #fff;
  position: fixed;
  bottom: 25px;
  left: 25px;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 15px;
  font-size: 16px;
  color: #c69c6d;
  padding: 0px 30px;
  box-sizing: border-box;
}

.sq_content .btn {
  width: 180px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  color: #fff;
  background-color: #c69c6d;
  margin-top: -3px;
  border-radius: 25px;
}

// 停车券弹窗
.ticketPopup {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 999;

  .popup-title {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 42px;
    box-sizing: border-box;
    border-bottom: 1px solid #f2f2f2;
    position: relative;

    span {
      color: #999;
      font-size: 28px;
    }

    .useRule-text {
      position: absolute;
      right: 42px;
      color: rgb(58, 130, 248);
    }
  }

  .popup_scroll {
    height: 70vh;
    background: #f2f2f2;
  }

  .popup_content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    box-sizing: border-box;

    .item {
      display: flex;
      background: #fff;
      margin-bottom: 20px;
      border-radius: 10px;

      .item-left {
        flex: 1;
        display: flex;
        align-items: center;
        padding: 20px 0;
        box-sizing: border-box;
        position: relative;

        .item-type {
          position: absolute;
          top: 0;
          left: 0;
          background: #fff5f1;
          border-radius: 10px 0 10px 0;
          width: 205px;
          display: flex;
          justify-content: center;

          span {
            color: #999;
            font-size: 20px;
            text-align: center;
            line-height: 28px;
          }
        }

        .item-value {
          color: #c69c6d;
          font-size: 40px;
          padding: 10px 30px;
          box-sizing: border-box;
          width: 205px;
          display: flex;
          justify-content: center;

          .b {
            color: #c69c6d;
            font-weight: 600;
            font-size: 60px;
          }
        }

        .color_disabled {
          color: #999 !important;
        }
      }

      .item-right {
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0 8px 8px 0;
        position: relative;

        span {
          color: #c69c6d;
          font-size: 24px;
          padding: 0 20px;
          box-sizing: border-box;
        }

        .color_disabled {
          color: #999;
        }

        // 对勾
        .dot {
          position: absolute;
          top: 0;
          right: 0;
          width: 2.25rem;
          height: 2.375rem;
        }
      }
    }
  }
}

// 弹窗按钮
.popup_button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  box-sizing: border-box;

  span {
    height: 110px;
    line-height: 110px;
    text-align: center;
  }

  .cancel_btn {
    background: #fff;
    color: #ed1c24 !important;
  }

  .ok_btn {
    background: #c69c6d;
    color: #fff !important;
    width: 120px;
    height: 40px;
    line-height: 40px;
    border-radius: 40px;
  }
}
</style>
