<template>
  <u-navbar
      :title="title"
      :auto-back="true"
      left-icon-size="40rpx"
      :safe-area-inset-top="true"
      :placeholder="true"
      bgColor="#ffffff"
  ></u-navbar>
  <u-row :custom-style="{padding:'38rpx 66rpx'}">
    <u-col :span="12">
      <view class="content">
        <u-parse :content="content"></u-parse>
      </view>
    </u-col>
  </u-row>
</template>

<script>
import {
  imghost
} from '@/config/host.js'
import MzSubsection from '@/components/MzSubsection/Index.vue';
import api from '@/utils/functions.js';
import {newDetail} from "@/api/other";

export default {
  components: {
    MzSubsection
  },
  data() {
    return {
      title: '资讯详情',
      loading: true,
      staticImage: {
        bg: imghost + '/static/image/BG.png',
        newIcon: imghost + '/static/image/new-icon.png',
      },
      isTop: false,
      content:''
    }
  },
  onLoad(option) {
    this.getDetail(option.id);
  },
  computed: {
    api() {
      return api
    },
  },
  methods: {
    getDetail(id){
      newDetail({id:id}).then(res => {
        this.title = res.data.info.title;
        this.content = res.data.info.content;
      })
    }
  },
  onPageScroll(res) {
    if (res.scrollTop <= 20) {
      uni.$emit('isTop', true);
    } else {
      uni.$emit('isTop', false);
    }
  },
  created() {

  }
}
</script>

<style lang="scss">
@import './components/detail.scss';
</style>