1
0

detail.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="detail">
  3. <view class="title">{{ item.title }}</view>
  4. <view class="desc">
  5. <text class="time">发布于:{{ item.createTime }}</text>
  6. <button class="fx" open-type="share">
  7. <text class="icon">&#xe637;</text>
  8. <text>分享</text>
  9. </button>
  10. </view>
  11. <view class="con">
  12. <u-divider :dot="true"></u-divider>
  13. <u-parse :content="item.content"></u-parse>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. item: {}
  22. };
  23. },
  24. onLoad(e) {
  25. this.http.request({
  26. url: '/app/knowledge/detail/' + e.id,
  27. success: (res) => {
  28. this.item = res.data.data;
  29. this.item.content = res.data.data.content.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
  30. }
  31. });
  32. },
  33. methods: {},
  34. //分享
  35. onShareAppMessage: function (res) {
  36. return {
  37. title: this.item.title,
  38. path: '/pages/knowledge/detail?id=' + this.item.id,
  39. success: (res) => {},
  40. fail: (res) => {}
  41. };
  42. }
  43. };
  44. </script>
  45. <style lang="scss">
  46. page {
  47. background-color: white;
  48. }
  49. </style>