detail.vue 921 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view>
  3. <video v-if="detail.type == 'VIDEO_TEXT'" class="works-video" @error="videoError" :src="detail.videoUrl"></video>
  4. <!-- <image v-else class="works-video" @click="$util.preview(detail.imageUrl)" :src="detail.imageUrl" mode="widthFix"></image> -->
  5. <view style="padding: 30rpx;">
  6. <u-parse :html="content" ></u-parse>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. content: '',
  15. detail: ''
  16. }
  17. },
  18. onLoad(options) {
  19. this.fetchDetail(options.id)
  20. },
  21. methods: {
  22. fetchDetail(id) {
  23. this.$api.activity.getStudyDetail({id: id}).then(res => {
  24. this.content = decodeURIComponent(res.data.data.content)
  25. this.detail = res.data.data
  26. uni.setNavigationBarTitle({
  27. title: this.detail.title
  28. })
  29. })
  30. }
  31. }
  32. }
  33. </script>
  34. <style>
  35. page {
  36. background-color: #FFFFFF;
  37. }
  38. .works-video {
  39. width: 100vw;
  40. height: 422rpx;
  41. }
  42. </style>