<template>
  <div class="com_cell">
    <div class="com_cell_up" @click="goUrl(cellData.id)">
      <div class="com_cell_up_img_init">
        <img :src="cellData.cover" class="com_cell_up_img" />
      </div>
      <div class="com_cell_up_right">
        <div class="up_title">
          <div class="up_tit_name_in">
            <span class="up_tit_name" :title="cellData.name">
              {{ cellData.name }}
            </span>
          </div>
          <span
            v-if="cellData.data_service_type1 == 6"
            class="tags map_service"
          >
            mapService
          </span>
          <span v-if="cellData.openness == 1" class="tags shared">共享</span>
          <span v-else-if="cellData.openness == 2" class="tags restricted">
            受限
          </span>
          <span v-else class="tags sensitive">敏感</span>
        </div>
        <div class="up_rate">
          <el-rate
            v-model="cellData.score"
            disabled
            show-score
            text-color="#ea7d19"
            score-template="{value}"
          ></el-rate>
          <p class="get_num">
            获取次数：
            <span class="com_cell_right_time">
              {{ cellData.apply_num }}
            </span>
            <span class="ci"> 次</span>
          </p>
        </div>
      </div>
      <div class="get_detail">
        <img src="@/assets/imgs/shop_ic_enter.png" />
      </div>
    </div>
    <div class="com_cell_down">
      <p class="com_detail">
        {{ cellData.descript }}
      </p>
      <el-row :gutter="16">
        <el-col :span="14" class="com_other">
          <span class="name_title">服务类型：</span>
          {{ cellData.data_service_type1_name }}
          &nbsp;&nbsp;{{ cellData.data_service_type2_name }} &nbsp;&nbsp;{{
            cellData.data_service_type3_name
          }}
        </el-col>
        <el-col :span="10" class="com_other">
          <span class="name_title">服务领域：</span>
          {{ cellData.sectors_name }}
        </el-col>
        <el-col :span="14" class="com_other">
          <span class="name_title">更新时间：</span>
          {{ helper.dateStringTransform(cellData.update_date) }}
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import helper from "@/services/helper.js";
// if you meet date which like 2020-06-05T00:00:00+08:00, use helper.dateStringTransform()
export default {
  components: {},
  props: {
    url: { type: String, default: "" },
    cellData: { type: Object, default: {} },
  },
  data: () => ({ helper: helper }),
  computed: {},
  watch: {},
  methods: {
    goUrl(parame) {
      if (this.url != "") {
        this.$router.push(this.url + "/" + parame);
      }
    },
  },
  mounted() {},
};
</script>

<style scoped>
.com_cell {
  width: 496px;
  height: 208px;
  background-color: #ffffff;
  box-shadow: 0px 3px 6px 0px rgba(15, 19, 65, 0.04);
  border-radius: 12px 12px 8px 8px;
  border: solid 1px #e3e4ef;
  margin-bottom: 24px;
}
.com_cell_up {
  height: 88px;
  background-color: #f9fafc;
  border-radius: 12px 12px 0px 0px;
  padding: 16px;
  display: flex;
  position: relative;
  cursor: pointer;
}
.com_cell_up_img_init {
  width: 56px;
  height: 56px;
  margin-right: 16px;
  flex: 0 0 auto;
}
.com_cell_up_img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}
.com_cell_up_right {
  flex: 1 1 auto;
}
.up_title {
  font-size: 16px;
  margin-top: 4px;
  display: flex;
  align-items: center;
}
.up_tit_name_in {
  max-width: calc(100% - 150px);
  display: inline-block;
}
.up_tit_name {
  width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.up_tit_name:hover {
  text-decoration: underline;
}
.up_rate {
  margin-top: 12px;
  display: flex;
}
.get_num {
  margin-left: 40px;
  font-size: 14px;
  color: #58617a;
}
.com_cell_right_time {
  color: #ea7d19;
}
.ci {
  color: #242c43;
}
.get_detail {
  position: absolute;
  top: 26px;
  right: 16px;
}
.tags {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 12px;
  border-radius: 4px;
  position: relative;
  top: 1px;
}
.map_service {
  background-color: #626de9;
  border: solid 1px #626de9;
  color: #fff;
}
.shared {
  background-color: #e7fdfc;
  border: solid 1px #8bd6d0;
  color: #25bdb1;
}
.restricted {
  background-color: #fffee8;
  border: solid 1px #e4c884;
  color: #ef9433;
}
.sensitive {
  background-color: #ffefef;
  border: solid 1px #d7a4a9;
  color: #e15260;
}
.com_cell_down {
  padding: 12px 16px 0 16px;
}
.com_detail {
  color: #8890a7;
  font-size: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: 42px;
  margin-bottom: 8px;
}
.com_other {
  color: #58617a;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.name_title {
  color: #8890a7;
}
</style>
<style>
.com_cell .el-rate__item .el-rate__icon {
  font-size: 20px;
  margin-right: 0;
}
.com_cell .el-rate__text {
  margin-left: 4px;
  position: relative;
  top: 1px;
}
</style>