<template>
  <div class="choosecar">
    <img
      class="banner"
      src="https://www.idea-sf.com/dockPic/choosecar/banner.png"
      alt=""
    />
    <div class="carlist">
      <div class="list-row1" @click="jummPage(item)" v-for="item in list">
        <img
          src="https://www.idea-sf.com/dockPic/choosecar/car1.png"
          class="carimg"
          alt=""
        />
        <div style="margin-left: 28rpx">
          <div class="row-title">{{ item.label }}</div>
          <div class="row-tip">适用{{ item.label }}预约</div>
        </div>
        <img
          src="https://www.idea-sf.com/dockPic/choosecar/jiantou.png"
          alt=""
          class="jiantou"
        />
      </div>
      <!-- <div class="list-row1" @click="jummPage()">
        <img src="https://www.idea-sf.com/dockPic/choosecar/car2.png" class="carimg" alt="" />
        <div style="margin-left: 28rpx">
          <div class="row-title">大型箱车</div>
          <div class="row-tip">适用普通车辆预约 工作时间为 8:30~16:30</div>
        </div>
        <img src="https://www.idea-sf.com/dockPic/choosecar/jiantou.png" alt="" class="jiantou" />
      </div>
      <div class="list-row1" @click="jummPage()">
        <img src="https://www.idea-sf.com/dockPic/choosecar/car3.png" class="carimg" alt="" />
        <div style="margin-left: 28rpx">
          <div class="row-title">集装箱车辆</div>
          <div class="row-tip">适用集装箱车辆预约 工作时间为 8:00~17:00</div>
        </div>
        <img src="https://www.idea-sf.com/dockPic/choosecar/jiantou.png" alt="" class="jiantou" />
      </div>
      <div class="list-row1" @click="jummPage()">
        <img src="https://www.idea-sf.com/dockPic/choosecar/car4.png" class="carimg" alt="" />
        <div style="margin-left: 28rpx">
          <div class="row-title">航空箱</div>
          <div class="row-tip">适用普通车辆预约 工作时间为 8：30~16：30</div>
        </div>
        <img src="https://www.idea-sf.com/dockPic/choosecar/jiantou.png" alt="" class="jiantou" />
      </div>
      <div class="list-row1" @click="jummPage()">
        <img src="https://www.idea-sf.com/dockPic/choosecar/car5.png" class="carimg" alt="" />
        <div style="margin-left: 28rpx">
          <div class="row-title">海运柜</div>
          <div class="row-tip">适用普通车辆预约 工作时间为 8:30~16:30</div>
        </div>
        <img src="https://www.idea-sf.com/dockPic/choosecar/jiantou.png" alt="" class="jiantou" />
      </div> -->
    </div>
  </div>
</template>

<script>
import { getDockCarType } from "@/js_sdk/chooseCarApi.js";
import { getUserLocalStorageInfo } from "@/js_sdk/localUserInfo.js";
import qs from "qs";
export default {
  data() {
    return {
      list: [],
      zxtype: "",
    };
  },
  onLoad(e) {
    console.log(e);
    this.getDockCarType();
    this.zxtype = e.zxtype;
    // getDockCarType({})
  },
  methods: {
    async getDockCarType() {
      let { data } = await getDockCarType();
      this.list = data;
      console.log(data);
    },
    selectCarType(e) {
      console.log(e);
    },
    jummPage(item) {
      console.log(
        `zxtype=${this.zxtype}&carTypeId=${item.value}&carTypeLabel=${item.label}`
      );
      if (getUserLocalStorageInfo().biz) {
        uni.navigateTo({
          url: `/pages/subPackages/qy_yy/index?zxtype=${this.zxtype}&carTypeId=${item.value}&carTypeLabel=${item.label}`,
        });
      } else {
        uni.navigateTo({
          url: `/pages/subPackages/sj_yy/index?zxtype=${this.zxtype}&carTypeId=${item.value}&carTypeLabel=${item.label}`,
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
page {
  background: #ffffff;
}

.choosecar {
  position: relative;

  .banner {
    width: 100vw;
    height: 300rpx;
  }

  .carlist {
    position: absolute;
    z-index: 2;
    width: 100vw;
    top: 250rpx;

    .row-tip {
      font-weight: 400;
      font-size: 24rpx;
      color: #666666;
      margin-top: 30rpx;
    }

    .jiantou {
      margin-left: auto;
      height: 48rpx;
      width: 24rpx;
    }

    .list-row1 {
      margin: 0 auto;
      margin-top: 24rpx;
      display: flex;
      align-items: center;
      width: 694rpx;
      height: 160rpx;
      background: #f5f7fa;
      border-radius: 16rpx 16rpx 16rpx 16rpx;
      padding: 34rpx 30rpx;
      box-sizing: border-box;

      .row-title {
        font-weight: bold;
        font-size: 32rpx;
        color: #333333;
      }

      .carimg {
        height: 104rpx;
        width: 104rpx;
      }
    }
  }
}
</style>
