adBannerDetails.vue 799 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="details ql-editor">
  3. <u-parse v-if="detailsInfo && detailsInfo.content" :html="detailsInfo.content" />
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. detailsInfo: {}
  11. };
  12. },
  13. onLoad(options) {
  14. const { id } = options;
  15. if (id) {
  16. this.getBannerDetails(id);
  17. }
  18. },
  19. methods: {
  20. /**
  21. * @description: 获取广告详情
  22. * @param {*} id
  23. * @return {*}
  24. */
  25. async getBannerDetails(id) {
  26. const { code, rows } = await this.$u.api.adBannerModuleApi.getAdBannerListApi({ pageNum: 1, pageSize: 10 });
  27. if (code === 200) {
  28. this.detailsInfo = rows.find(item => String(item.id) === id);
  29. console.log(this.detailsInfo)
  30. }
  31. }
  32. }
  33. };
  34. </script>
  35. <style lang="scss" scoped></style>