newsDetail.vue 908 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="container" v-if="info !== null">
  3. <!-- 标题区域 -->
  4. <view class="title">{{ info.title }}</view>
  5. <!-- 发布时间区域 -->
  6. <view class="time">{{ info.update_time }}</view>
  7. <!-- 内容区域 -->
  8. <mp-html :content="info.content" />
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. info: null
  16. }
  17. },
  18. onLoad(options) {
  19. this.info = JSON.parse(decodeURIComponent(options.info))
  20. // this.info.content = this.info.content.replace(/data-src/g, 'src')
  21. // this.info.content = this.info.content.replace(/iframe/g, 'video')
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. .container {
  27. padding: 0 30rpx;
  28. min-height: 100vh;
  29. background-color: #fff;
  30. .title {
  31. padding-top: 30rpx;
  32. text-align: center;
  33. font-size: 32rpx;
  34. font-weight: bold;
  35. }
  36. .time {
  37. margin-top: 20rpx;
  38. text-align: center;
  39. color: #666666;
  40. font-size: 24rpx;
  41. }
  42. }
  43. </style>