<template>
  <div class="app-container">
    <div style="width: 1280px;margin: 0 auto">
      <el-row :gutter="24">
        <el-col v-for="item in partnerData" :span="8">
          <div class="item">
            <img :src="baseUrl + item.image" alt="">
            <div class="title">{{ item.title }}</div>
            <p>{{ item.description }}</p>
            <el-button type="primary" link @click="openPage(item)">查看官网
              <el-icon>
                <ArrowRight/>
              </el-icon>
            </el-button>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup name="partnershipList">
import { partnerList } from '@/api/home.js'

const baseUrl = import.meta.env.VITE_APP_BASE_API

const partnerData = ref([])

function getPartnerList () {
  partnerList().then(res => {
    console.log(res)
    partnerData.value = res.data
  })
}

getPartnerList()

function openPage (data) {
  window.open(data.url)
}
</script>
<style scoped lang="scss">
.app-container {
  min-height: 100%;
  padding-top: 30px;
  background-color: #F7F8F9;
}

.item {
  height: 354px;
  background: #FBFCFE;
  border-radius: 4px;
  border: 1px solid #D8D9DB;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
  background: url("@/assets/images/partnership-bg.png");

  img {
    width: 150px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    background-color: #FFFFFF;
  }

  .title {
    font-weight: bold;
    font-size: 20px;
    color: #303233;
  }

  p {
    font-weight: 400;
    font-size: 16px;
    color: #626566;
    line-height: 24px;
    margin-top: 5px;
    margin-bottom: 40px;
    height: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
  }
}
</style>
