<template>
  <section class="contentDetail">
    <AiDetail :detail="detail" :props="props"/>
    <u-gap height="16"/>
    <AiComment v-if="detail.id&&detail.isComment==1" :bid="detail.id"/>
  </section>
</template>

<script>

export default {
  name: "contentDetail",
  appName: "内容详情",
  data() {
    return {
      detail: {title: "内容详情"},
      props: {
        count: "viewCount"
      },
      id: "",
    }
  },
  onLoad({id}) {
    if (id) {
      this.id = id;
      this.getDetail(id);
    }
  },
  methods: {
    getDetail(id) {
      this.$instance.post(`/app/appcontentinfo/queryDetailById`, null, {
        params: {id}
      }).then(res => {
        if (res?.data) {
          this.detail = res.data
        }
      })
    },
  },
  onShareAppMessage() {
    return {
      title: this.detail.title,
      path: '/mods/AppContent/contentDetail?id=' + this.id
    };
  },
  onReachBottom() {
    uni.$emit("moreComments")
  }
}
</script>

<style lang="scss" scoped>
.contentDetail {
}
</style>
