detail.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="main">
  3. <view class="content">
  4. <view class="title">{{ item.title }}</view>
  5. <view class="desc">
  6. <text class="time">发布于:{{ item.createTime }}</text>
  7. <button class="fx" open-type="share">
  8. <text class="icon">&#xe637;</text>
  9. <text>分享</text>
  10. </button>
  11. </view>
  12. <view class="con">
  13. <u-divider :dot="true"></u-divider>
  14. <u-parse :content="item.contents"></u-parse>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. item: {}
  24. };
  25. },
  26. onLoad(e) {
  27. this.http.request({
  28. url: '/app/notice/detail/' + e.id,
  29. success: (res) => {
  30. this.item = res.data.data;
  31. this.item.contents = res.data.data.contents.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
  32. }
  33. });
  34. },
  35. methods: {},
  36. //分享
  37. onShareAppMessage: function (res) {
  38. return {
  39. title: this.item.title,
  40. path: '/pages/notice/detail?id=' + this.item.id,
  41. success: (res) => {},
  42. fail: (res) => {}
  43. };
  44. }
  45. };
  46. </script>
  47. <style lang="scss">
  48. .main {
  49. padding: 0px 10px 10px 10px;
  50. }
  51. .content {
  52. padding: 15px;
  53. background-color: white;
  54. border-radius: 8px;
  55. .title {
  56. font-size: 18px;
  57. }
  58. .desc {
  59. padding-top: 15px;
  60. font-size: 13px;
  61. color: #7c8388;
  62. .time {
  63. padding-right: 25px;
  64. }
  65. .fx {
  66. background-color: white;
  67. float: right;
  68. font-size: 15px;
  69. margin-right: -14px;
  70. margin-top: -13px;
  71. color: $main-color;
  72. .icon{
  73. padding-right: 3px;
  74. }
  75. }
  76. }
  77. .con {
  78. font-size: 14px;
  79. line-height: 23px;
  80. image {
  81. border-radius: 5px !important;
  82. }
  83. }
  84. }
  85. </style>