<template>
  <!-- 轮播详情 -->
  <view class="ql-editor">
    <u-parse :html="dom"></u-parse>
  </view>
</template>

<script>
export default {
  data() {
    return {
      dom: ''
    };
  },
  onLoad(options) {
    const { id } = options;
    if (id) this.getDetails(id);
  },
  methods: {
    // 获取详情
    async getDetails(id) {
      const { code, data } = await this.$u.api.getIndexData();
      if (code === 200) {
        this.dom = (data?.advs || []).find((item) => item.id === id).content || '';
      }
    }
  }
};
</script>

<style>
page {
  padding: 24rpx;
}
</style>
