<template>
  <div class="bg-F5">
    <div class="container ">
      <div class="info">
        <div class="left">
          <div>
            <el-carousel class="marquee" arrow="never">
              <el-carousel-item
                v-for="item in (this.shopInfo.propagandaImgUrl + ``).split(`,`)"
                :key="item"
              >
                <div class="img">
                  <img :src="`${$basePath}${item}`" alt="" />
                </div>
              </el-carousel-item>
            </el-carousel>
          </div>
          <div class="details">
            <span>{{ shopInfo.companyName }}</span>
            <p>
              {{ $t("page.views.shops.details.profile.companyType") }}：{{
                companyType
              }}
            </p>
            <p>
              {{
                $t("page.views.shops.details.profile.unifiedSocialCreditCode")
              }}：{{ shopInfo.unifiedSocialCreditCode }}
            </p>
            <p>
              {{ $t("page.views.shops.details.profile.legalPerson") }}：{{
                shopInfo.legalPerson
              }}
            </p>
            <p>
              {{ $t("page.views.shops.details.profile.detailAddress") }}：{{
                shopInfo.detailAddress
              }}
            </p>
            <p>
              {{ $t("page.views.shops.details.profile.primaryBusiness") }}：{{
                shopInfo.primaryBusiness
              }}
            </p>
          </div>
        </div>
        <div class="right">
          <div class="title">
            {{ $t("page.views.shops.details.profile.companyIntroduction") }}
          </div>
          <p>
            {{ shopInfo.companyIntroduce }}
          </p>
        </div>
      </div>
      <div class="x-title">
        {{ $t("page.views.shops.details.profile.businessLicense") }}
      </div>
      <img v-for="(img, index) in imgs" :key="index" :src="img" />
    </div>
  </div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
import dict from "@/store/modules/dict";
@Component
export default class extends Vue {
  @Prop() private shopInfo!: IAny;

  get companyType() {
    const x = dict.companyType.find(
      ({ value }) => value === this.shopInfo.companyType
    );
    return x && x.key;
  }
  get imgs() {
    return (this.shopInfo.businessLicenseUrl as string)
      .split(",")
      .map(img => `${this.$basePath}${img}`);
  }
}
</script>
<style lang="scss" scoped>
.container {
  padding: 20px 0;
  .info {
    height: 255px;
    background: #fff;
    border-radius: 4px;
    padding: 15px 20px;
    box-sizing: border-box;
    > div {
      width: 50%;
      box-sizing: border-box;
      display: inline-block;
      height: 100%;
      vertical-align: top;
    }
    .left {
      border-right: 1px dashed #e3e3e3;
      > div {
        width: 40%;
        box-sizing: border-box;
        // display: inline-block;
        height: 100%;
        float: left;
        .img {
          height: 100%;

          position: relative;
          img {
            max-width: 100%;
            max-height: 100%;
            border-radius: 4px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
          }
        }

        &.details {
          width: 60%;
          padding: 10px 15px;
          span {
            margin-bottom: 20px;
            display: inline-block;
            font-size: 16px;
            color: rgb(51, 51, 51);
          }
          p {
            font-size: 12px;
            color: rgb(102, 102, 102);
            margin-bottom: 5px;
            word-break: break-all;
          }
        }
      }
    }
    .right {
      padding: 20px 40px;
      .title {
        color: rgb(253, 85, 34);
        margin-bottom: 20px;
        font-size: 16px;
      }
      p {
        font-size: 12px;
        color: rgb(102, 102, 102);
      }
    }
  }
  .x-title {
    margin-top: 30px;
    margin-bottom: 20px;
  }
  > img {
    max-width: 80%;
    margin-left: 20px;
  }
}
</style>
