<template>
  <div class="bylaws">
    <div class="title">{{ currTitle }}</div>
    <div class="top-tip">中国国际经济技术合作促进会科技项目转化工作委员会</div>
    <div class="top-tip-2" v-if="isCloud">{{title2}}</div>
    <div class="constitution" v-html="article.content"></div>
  </div>
</template>

<script>
import { article_info } from "../../request/api";

export default {
  name: "Bylaws",
  data() {
    return {
      currTitle: "促进会章程",
      BContent: "",
      article: "",
      title2: "",
      isCloud: false
    };
  },
  created() {
    this.getBylawsContent();
  },
  methods: {
    getBylawsContent() {
      article_info({}, 56).then(({ data }) => {
        this.article = data.data;
        console.log(this.article.title)
        if(this.article.title.indexOf('（章程）')){
          this.isCloud = true
          this.article.title = this.article.title.replace(/（章程）/,'')
          this.title2 = '（章程）'
          console.log(this.article.content)
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.title {
  color: #96311c;
  text-align: center;
  font-size: 20px;
  margin: 45px auto;
  font-weight: bold;
  position: relative;
  &::before {
    background: url("../../assets/divbefore.png") no-repeat;
    left: 265px;
  }
  &::after {
    background: url("../../assets/divafter.png") no-repeat;
    left: 474px;
  }

  &::before,
  &::after {
    width: 93px;
    height: 5px;
    content: "";
    position: absolute;
    top: 37%;
    margin-top: -2px;
    display: inline-block;
    margin: 0 10px;
  }
}
.top-tip, .top-tip-2 {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #ff0000;
    margin-bottom: 10px;
}
.top-tip-2 {
    margin-bottom: 30px;
}
</style>