detail.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="contents">
  3. <view class="title">
  4. <text>{{ item.title }}</text>
  5. </view>
  6. <view class="ly">
  7. <text>{{ item.author }}</text>
  8. <text class="day">{{item.createTime}}</text>
  9. </view>
  10. <view>
  11. <view class="fwb"><u-parse :html="item.content"></u-parse></view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. ip: this.$http.urls.ip,
  20. item: {}
  21. };
  22. },
  23. onLoad(e) {
  24. this.$http.request({
  25. url: this.$http.urls.getContentInfo + e.id,
  26. success: res => {
  27. this.item = res.data.data.info;
  28. this.item.content = res.data.data.info.content.replace(new RegExp('/prod-api/profile/upload','g'),this.ip+'/profile/upload');
  29. this.item.createTime = this.$u.timeFrom(new Date(this.item.createTime.replace(/\-/g, '/')).getTime());
  30. }
  31. });
  32. },
  33. methods: {}
  34. };
  35. </script>
  36. <style lang="scss">
  37. .contents {
  38. padding: 20px;
  39. .ly {
  40. font-size: 14px;
  41. margin-bottom: 15px;
  42. color: #2196f3;
  43. .day {
  44. color: #818184;
  45. padding-left: 10px;
  46. }
  47. }
  48. .title {
  49. font-size: 23px;
  50. font-weight: 400;
  51. margin-bottom: 20px;
  52. }
  53. .pic {
  54. width: 100%;
  55. border-radius: 3px;
  56. margin-top: 3px;
  57. }
  58. .fwb {
  59. margin-top: 15px;
  60. color: #909090;
  61. }
  62. }
  63. ._p{
  64. color: #404040;
  65. line-height: 23px;
  66. margin-top: 13px;
  67. font-size: 16px;
  68. }
  69. </style>