<template>
  <div class="com-main com-width-1400 com-margin-auto">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">Home</el-breadcrumb-item>
      <el-breadcrumb-item>Contacts</el-breadcrumb-item>
    </el-breadcrumb>
    <p class="title">Key contacts at Promocollection</p>
    <div class="line"></div>
    <div class="description">
      <p>General contact info</p>
      <p>Email: info@promocollection.uk</p>
      <p>Phone: (+44) 203 916 5098</p>
      <p>Address:&nbsp;&nbsp;&nbsp;3 Brunel Court Severalls, Colchester, CO4 9XP Essex United Kingdom</p>
    </div>
    <div class="content">
      <ul class="item">
        <li v-for="item in accountManagersList" :key="item.id">
          <div class="item-img">
            <img
              :src="
                $mediaRegExp.test(item.image)
                  ? item.image
                  : 'https://www.promocollection.uk/' + item.image
              "
              alt=""
            />
          </div>
          <div class="item-info">
            <div class="name">{{ item.name }}</div>
            <div class="position" :title="item.position" v-if="item.position">
              {{ item.position }}
            </div>
            <div class="introduction" :title="item.introduction" v-if="item.introduction">
              {{ item.introduction }}
            </div>
            <div class="email">
              <img src="@/assets/img/home/e-mail.png" alt="" />
              <span :title="item.email">{{ item.email }}</span>
            </div>
            <div class="phone" v-if="item.phone?.length">
              <img src="@/assets/img/home/phone.png" alt="" />
              <span :title="item.phone">{{ item.phone }}</span>
            </div>
            <div class="Landline" v-if="item.tel?.length">
              <img src="@/assets/img/home/Landline.png" alt="" />
              <span :title="item.tel">{{ item.tel }}</span>
            </div>
          </div>
        </li>
      </ul>
       <ul class="item">
        <li v-for="item in financeTeamList" :key="item.id">
          <div class="item-img">
            <img
              :src="
                $mediaRegExp.test(item.image)
                  ? item.image
                  : 'https://www.promocollection.uk/' + item.image
              "
              alt=""
            />
          </div>
          <div class="item-info">
            <div class="name">{{ item.name }}</div>
            <div class="position">
              {{ item.position }}
            </div>
            <div class="introduction" :title="item.introduction">
              {{ item.introduction }}
            </div>
            <div class="email">
              <img src="@/assets/img/home/e-mail.png" alt="" />
              <span>{{ item.email }}</span>
            </div>
            <div class="phone" v-if="item.phone?.length">
              <img src="@/assets/img/home/phone.png" alt="" />
              <span>{{ item.phone }}</span>
            </div>
            <div class="Landline" v-if="item.tel?.length">
              <img src="@/assets/img/home/Landline.png" alt="" />
              <span>{{ item.tel }}</span>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // total: 0,
      // listQuery: {
      //   page: 1,
      //   limit: 20,
      // },
      accountManagersList: [],
      financeTeamList: [],
    };
  },
  async created() {
    await this.getInfoList();
  },
  methods: {
    getInfoList() {
      this.$axios
        .get(
          "/uk-api/others/contact/list"
          // ,{
          //   page: this.listQuery.page,
          //   limit: this.listQuery.limit,
          // }
        )
        .then((res) => {
          if (res.code == 1) {
            res.result.data.forEach((item) => {
              if (item.id === 3) {
                this.accountManagersList = item.contact;
              } else if (item.id == 4) {
                this.financeTeamList = item.contact;
              }
            });
          }
        })
        .catch(() => {});
    },
  },
};
</script>

<style lang="scss" scoped>
.title {
  height: 50px;
  font-size: 35px;
  font-family: Proxima Nova;
  font-weight: bold;
  color: #00213b;
  text-align: center;
  line-height: 50px;
}
.line {
  width: 99px;
  height: 4px;
  background: #e90000;
  margin: 15px auto 0px;
}
.description {
  font-family: Proxima Nova;
  margin: 48px auto;
  width: 712px;
  height: 180px;
  font-size: 18px;
  background: #ffffff;
  color: #00213b;
  border: 1px solid #f2f2f2;
  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.15);
  p {
    font-weight: 400;
    line-height: 24px;
    margin: 0px 40px 5px;
  }
  p:nth-of-type(1) {
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    margin: 26px auto;
  }
}
.content {
  padding: 0px 50px;
  .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    li {
      display: flex;
      justify-content: flex-start;
      margin-bottom: 31px;
      .item-img {
        width: 234px;
        height: 348px;
        img {
          width: 234px;
          height: 348px;
          object-fit: cover;
        }
      }
      .item-info {
        width: 380px;
        font-family: Proxima Nova;
        margin-left: 20px;
        div {
          height: 24px;
          font-size: 16px;
          font-family: Proxima Nova;
          font-weight: 400;
          line-height: 24px;
          margin-bottom: 15px;
          color: #00213B;
          text-align: center;
          padding: 0 5px;
        }
        .name {
          font-size: 24px;
          font-weight: 600;
          margin-top: 10px;
        }
        .position {
          font-size: 18px;
        }
        .introduction {
          height: 100px;
          font-size: 16px;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 4;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        .email,
        .phone,
        .Landline {
          text-align: left;
          img {
            vertical-align: middle;
            margin-right: 12px;
          }
        }
      }
      &:hover {
        box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.15);
      }
    }
  }
}

:deep(.el-pagination.is-background) {
  .el-pager {
    li.number {
      background-color: #f8f8f8;
      border-radius: 50%;
      color: #a7a7a7;
    }
    li:not(.disabled).active {
      background-color: #00213b;
      color: #d4d7da;
    }
  }
  .btn-prev,
  .btn-next {
    border-radius: 50%;
    background-color: #fff;
    .el-icon-arrow-left:before {
      content: "";
    }
    .el-icon-arrow-right:before {
      content: "";
    }
  }
}
</style>
