detail.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view>
  3. <!--文章标题-->
  4. <view class="text-black text-bold title" style="font-size: 40rpx;">{{dataDetail.title}}</view>
  5. <view class="text-gray " style="padding: 0 0 30rpx 30rpx;">
  6. <text class="cuIcon-time padding-right-10"></text>
  7. <text>{{dataDetail.createTime}}</text>
  8. </view>
  9. <view class="content-view-box">
  10. <view class="font-view">
  11. <editor id="editor" read-only="true" class="ql-container" @ready="onEditorReady(dataDetail.notice)"></editor>
  12. <!-- <u-parse :html="dataDetail.content"></u-parse> -->
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. var app=getApp()
  19. export default {
  20. components: {
  21. },
  22. data() {
  23. return {
  24. dataDetail:{},
  25. }
  26. },
  27. onShow() {
  28. this.dataDetail=app.globalData.noticeDetail
  29. },
  30. onLoad(options) {
  31. },
  32. methods: {
  33. onEditorReady(notice) {
  34. uni.createSelectorQuery().select('#editor').context((res) => {
  35. this.editorCtx = res.context
  36. this.editorCtx.setContents({
  37. html: notice
  38. })
  39. }).exec()
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. page {
  46. background: #FFFFFF;
  47. }
  48. .title {
  49. margin: 36.36rpx 27.27rpx;
  50. }
  51. .content-view-box {
  52. position: relative;
  53. .font-view {
  54. padding: 27.27rpx;
  55. line-height: 1.9;
  56. }
  57. image {
  58. width: 100%;
  59. }
  60. }
  61. </style>