detail.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="cmain">
  3. <view class="title">{{ item.title }}</view>
  4. <view class="desc">
  5. <text class="source">{{ item.source }}</text>
  6. <text>{{ item.createTime }}</text>
  7. <view class="read">
  8. <text class="icon">&#xe639;</text>
  9. <text>{{ item.readCount }}</text>
  10. </view>
  11. </view>
  12. <u-divider :dot="true"></u-divider>
  13. <u-parse :content="item.content"></u-parse>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. item: {}
  21. };
  22. },
  23. onLoad(e) {
  24. if (e.id) {
  25. this.http.request({
  26. url: '/level-one-server/app/TbPortNews/getById?id=' + e.id,
  27. success: res => {
  28. this.item = res.data.data;
  29. this.item.content = this.item.content.replace(/\<img/gi, '<img style="border-radius: 5px;"');
  30. }
  31. });
  32. }
  33. }
  34. };
  35. </script>
  36. <style lang="scss">
  37. .cmain{
  38. padding: 20px 16px 15px 16px;
  39. .title {
  40. font-weight: bold;
  41. color: #192b20;
  42. line-height: 32px;
  43. font-size: 22px;
  44. }
  45. .desc {
  46. margin-top: 10px;
  47. overflow: hidden;
  48. color: #a0a2a6;
  49. text {
  50. float: left;
  51. }
  52. .source {
  53. color: #0081ff;
  54. margin-right: 10px;
  55. }
  56. margin-right: 10px;
  57. .read {
  58. float: right;
  59. margin-top: -2px;
  60. .icon{
  61. padding-right: 3px;
  62. float: left;
  63. margin-top: 2px;
  64. }
  65. }
  66. }
  67. }
  68. </style>