<template>
  <div class="technology-card">
    <div class="card-wrapper" v-if="toolList&&toolList.length">
      <el-card v-for="item in toolList" :key="item.id" style="margin-bottom: 15px">
        <el-row>
          <el-col :span="4">
            <img :src="item.photoUrl" alt="tool-img" class="pull-left technology-img">
          </el-col>
          <el-col :span="17" class="technology-detail">
            <div class="technology-title">
              {{item.name}}
            </div>
            <div>简介：{{item.description}}</div>

            <div class="technology-info">
              <div>开发：{{item.owner}}</div>
            </div>
          </el-col>
          <el-col :span="3">
            <div @click="gotoDetail(item)">
              <span style="font-size: 14px">查看详情</span>
              <i class="el-icon-arrow-right get-info-btn"></i>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <div v-else>
      暂无内容
    </div>
  </div>
</template>

<script>
  import Http from '@/js/http.js'

  export default {
    name: 'CrowdTool',
    props: ['toolList'],
    methods: {
      gotoDetail(item) {
        window.open(item.linkUrl);
      }
    }
  }
</script>

<style scoped lang="less">
  .technology-card {
    .card-wrapper {
      .technology-img {
        width: 100%;
        height: 130px;
      }

      .technology-detail {
        padding-left: 15px;
        height: 130px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .technology-title {
          cursor: pointer;
          font-size: 22px;
          font-family: Source Han Sans CN;
          font-weight: 500;
          color: rgba(0, 0, 0, 1);
        }

        .technology-info {
          font-size: 16px;
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: rgba(0, 0, 0, 1);
          div {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }
      }

      .get-info-btn {
        display: inline-block;
        color: white;
        background-color: #0076cb;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        margin-left: 5px;
        font-size: 16px;

        i {
          margin: 1px;
        }
      }
    }
  }
</style>
