<template>
  <div style="background-color: #f4f7ff">
    <scroll-view class="wrap-box">
      <div class="parkingFee" ref="parkingFee">
        <div class="parkingFee-top bg">
          <div
            :class="{
              top_menu: true
            }"
          >
            <div class="menu_item" @click="doRouter">
              <img
                :src="require(`../../static/images/icon-order.png`)"
                alt="缴费记录"
              />
              <span>缴费记录</span>
            </div>
            <div class="menu_item" @click="doRouter1">
              <img
                :src="require(`../../static/images/icon-ticket.png`)"
                alt="停车开票"
              />
              <span>停车开票</span>
            </div>
            <div class="menu_item" @click="doRouter2">
              <img
                :src="require(`../../static/images/icon-car.png`)"
                alt="车辆管理"
              />
              <span>车辆管理</span>
            </div>
          </div>
        </div>
        <div
          :class="{
            'parkingFee-bottom': true,
             pb65: carList.length < 1,
          }"
        >
          <div class="parkingFee-search">
            <div class="search_tip">
              <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="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>
            <button
              class="search-btn"
              :class="disabledBtn ? 'disabled-btn' : ''"
              :disabled="disabledBtn"
              @click="preHandleSearch"
            >
              查询缴费
            </button>
          </div>
          <div class="vehicleMgt-list">
            <div class="vehicleMgt-title">
              <div>历史车辆</div>
            </div>
            <div class="vehicleMgt-content" v-if="carList.length">
              <div
                class="item"
                v-for="(item, index) in carList"
                :key="index"
                @click="toHandleSearch(item)"
                :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''"
              >
                {{ item | formatCarno }}
              </div>
            </div>
          </div>
        </div>
        <div
          :class="{
            top_content: true,
          }"
        >
          <div class="title_box">
            <span class="title">缴费说明</span>
          </div>
          <div class="info" :class="!init_ch ? 'info_show' : ''">
            <span>{{ description }}</span>
          </div>
          <div
            class="top_down"
            @click="top_display"
            v-if="
              !init_ch &&
              description &&
              description.length > 60
            "
          >
            <van-icon name="arrow-down" />
          </div>
          <div class="top_down" @click="top_display" v-else>
            <van-icon name="arrow-up" />
          </div>
        </div>
      </div>
    </scroll-view>
    <plate-number
      ref="plateKeyboard"
      :carType="carType"
      :active="active"
      :ind="ind"
      :numArr="numArr"
      @carnoArr="updateCarno"
    ></plate-number>
  </div>
</template>

<script>
import parkingFeeJs from '../../mixins/parkingFee';

export default {
  mixins: [parkingFeeJs],
  name: 'officeBlueCom',
};
</script>

<style lang="less" scoped>
page {
  background-color: #f4f7ff;
}

.scroll-Y {
  width: 100%;
  // display: flex;
  // flex-direction: column;
  height: 100vh;
}

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

.wrap-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-size: 14px;

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

    .parkingFee-top {
      display: flex;
      flex-direction: column;
      background-size: 100% 30%;
      // height: 350px;
      margin-bottom: 20px;
      background: #fafbff;
      border: 1px solid #d8dae0;
      border-top: none;
      .top_down {
        width: 100%;
        text-align: center;
        color: #b0a9a9;
      }
    }

    .top_menu {
      background: #fafbff;
      padding: 50px 40px 30px;
      box-sizing: border-box;
      display: flex;
      justify-content: space-between;
      width: 100%;

      .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;
        }
      }
    }

    .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: 33.33333%;

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

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

    .parkingFee-bottom {
      width: 100%;
      display: flex;
      flex-direction: column;
      //padding: 14px 25px;
      background: #fafbff;
      border: 1px solid #d8dae0;
      box-sizing: border-box;
      // padding-bottom: 65px;
      margin-bottom: 24px;

      &.pb65 {
        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;

          &:first-child {
            font-size: 36px;
            font-weight: 500;
            color: #333333;
            line-height: 50px;
          }

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

            div {
              height: 100%;
              border-radius: 50px;
              line-height: 54px;
              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);
              //background-image: linear-gradient(to right, #7e4fa1, #433c7f);
              background-color: #064c8a;
            }
          }
        }

        // 车牌号 & 虚拟键盘
        .input-box {
          width: 100%;
          height: 100px;
          //margin: auto;
          background: #f4f7ff;
          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 18px;
            font-size: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #000000;

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

            &.active {
              border-color: #064c8a;
            }
          }

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

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

        .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: 28px;
            border-radius: 30px;
            color: #666666;
            background-color: #f4f7ff;
          }

          .vehicleMgt-content_cls {
            // color: #f4f7ff;
            border: 2px solid #064c8a;
          }

          // .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;
          }
        }
      }
    }

    .top_content {
      padding: 30px 30px;
      margin-bottom: constant(safe-area-inset-bottom); // 兼容 IOS<11.2
      margin-bottom: env(safe-area-inset-bottom); // 兼容 IOS>=11.2
      box-sizing: border-box;
      display: flex;
      flex-direction: column;

      //width: 750px;
      //height: 280px;
      background: #fafbff;
      border: 1px solid #d8dae0;

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

      .title_box {
        display: flex;
        align-items: center;
        justify-content: space-between;

        // margin-bottom: 20px;
        .title {
          // padding: 0px 14px;
          box-sizing: border-box;
          border-radius: 20px;
          font-size: 36px;
          color: #000;
          font-weight: 500;
          text-align: left;
          line-height: 50px;
        }
      }

      .info {
        // padding-left: 18px;
        white-space: break-spaces;
        font-size: 30px;
        width: 100%;
        color: #999999;
        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;
      }

      .top_down {
        margin-top: 20px;
        width: 100%;
        // font-size: 20PX;
        line-height: 20px;
        text-align: center;
        color: #999999;
      }
    }
  }
}

// 缴费说明
.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: 0 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: 0 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>
