<template>
  <view class="details ql-editor">
    <u-parse v-if="detailsInfo && detailsInfo.content" :html="detailsInfo.content" />
  </view>
</template>

<script>
export default {
  data() {
    return {
      detailsInfo: {}
    };
  },
  onLoad(options) {
    const { id } = options;
    if (id) {
      this.getBannerDetails(id);
    }
  },
  methods: {
    /**
     * @description: 获取广告详情
     * @param {*} id
     * @return {*}
     */
    async getBannerDetails(id) {
      const { code, rows } = await this.$u.api.adBannerModuleApi.getAdBannerListApi({ pageNum: 1, pageSize: 10 });
      if (code === 200) {
        this.detailsInfo = rows.find(item => String(item.id) === id);
				console.log(this.detailsInfo)
      }
    }
  }
};
</script>

<style lang="scss" scoped></style>
