activityContent.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view>
  3. <view class="box">
  4. <p class="title">{{ list.title }}</p>
  5. <u-parse :content="content" :lazy-load="true" :show-with-animation="true"></u-parse>
  6. <!-- <div v-html="content"></div> -->
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import actApi from '@/api/home/index.js';
  12. export default {
  13. data() {
  14. return {
  15. primary:this.$theme.primary,
  16. list: '',
  17. content: '',
  18. settingFile:getApp().globalData.siteinfo
  19. };
  20. },
  21. onLoad(option) {
  22. actApi.Campaign({ id: option.id }).then(res => {
  23. if (res.status == 200) {
  24. this.list = res.data.artical;
  25. // this.content =res.data.artical.content
  26. this.content = res.data.artical.content.replace(/\<img src="/gi, `<img style='width:100%;display:block' src="${this.settingFile.root_rich_img}`);
  27. }
  28. });
  29. }
  30. };
  31. </script>
  32. <style lang="scss">
  33. page {
  34. background: #ffffff;
  35. padding-bottom: 140rpx;
  36. }
  37. .box {
  38. width: 100%;
  39. background-color: #ffffff;
  40. padding: 20rpx;
  41. box-sizing: border-box;
  42. .title {
  43. padding: 0 10rpx;
  44. height: 70rpx;
  45. line-height: 40rpx;
  46. font-size: 32rpx;
  47. text-align: center;
  48. font-weight: 700;
  49. }
  50. }
  51. </style>