<template>
  <div class="style">
    <div class="detail-body">
      <div class="detail-card top-tit-card">
        <div class="left">
          <i class="iconfont icon-laba"></i>
        </div>
        <div class="right">
          <div class="top" style="font-size: 6vw">
            {{ activityDetail.activityName }}
          </div>
          <div class="bottom">
            <span>{{ activityDetail.updatedAt }}</span>
            <span>园区管委会</span>
          </div>
        </div>
        <div></div>
      </div>
      <div class="detail-card info">
        <div class="card-title">详情</div>
        <div class="text" v-html="activityDetail.styleContent"></div>
      </div>
    </div>
    <div class="white-bottom"></div>
  </div>
</template>

<script>
import { getActivityById } from '@/service/api_activity'
import auth from '@/service/auth'

export default {
    data() {
        return {
            activityDetail: '',
            id: ''
        }
    },

    mounted() {
        this.id = this.$route.query.id
        this.getActivityById()
    },
    methods: {
        getActivityById() {
            const _this = this
            getActivityById(this.id, auth.currUser().id).then((res) => {
                if (res.data) {
                    _this.activityDetail = res.data
                    _this.activityDetail.updatedAt = this.$common.transServDate(
                        _this.activityDetail.updatedAt
                    )
                }
            })
        }
    }
}
</script>

<style lang="scss" type="text/scss">
.style {
  box-sizing: border-box;
  background-color: $bg2;
  padding: 20px 30px 140px;
  overflow-y: auto;
  .detail-body {
    .detail-card {
      padding: 20px 30px;
      border-radius: 10px;
      .left {
        width: 70px;
        i {
          font-size: 50px;
        }
      }
      .right {
        height: 100% !important;
        .top {
          color: $color4;
        }
      }
      &:first-child {
        margin-bottom: 20px;
      }
    }

    .info {
      padding: 0;
      .text {
        padding: 30px;
        word-break: break-all;
        font-size: 26px;
        color: $text3;
        line-height: 1.4;
        img{
          width: 86vw !important;
        }
      }
    }
  }
}
</style>
