<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, data } = await this.$u.api.adBannerModuleApi.getAdBannerDetailsApi({ id });
      if (code === 200) {
        this.detailsInfo = data;
      }
    }
  }
};
</script>

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