detalis.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <view class="article">
  4. <view class="article-tit">
  5. {{detail.title}}
  6. </view>
  7. <view class="article-row">
  8. <view class="article-time">{{detail.createTime}}</view>
  9. <view class="article-see">
  10. <u-icon custom-prefix="custom-icon" name="eye-line"></u-icon>
  11. <span>321</span>
  12. </view>
  13. </view>
  14. <view class="article-con" v-html="detail.content">
  15. </view>
  16. <view class="article-foot">
  17. <view class="u-flex">
  18. <view class="article-btn">
  19. <u-icon custom-prefix="custom-icon" name="zoom-in-line"></u-icon>
  20. <span>放大</span>
  21. </view>
  22. <view class="article-btn">
  23. <u-icon custom-prefix="custom-icon" name="zoom-out-line"></u-icon>
  24. <span>缩小</span>
  25. </view>
  26. </view>
  27. <view class="article-btn">
  28. <u-icon custom-prefix="custom-icon" name="align-top"></u-icon>
  29. <span>回顶</span>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import * as API from '@/apis/news.js'
  37. export default {
  38. data() {
  39. return {
  40. pageTitle: '文章详情',
  41. isLoading: false,
  42. id: '',
  43. detail: {},
  44. }
  45. },
  46. onLoad(op) {
  47. this.id =op.id;
  48. this.getDetail();
  49. },
  50. methods: {
  51. getDetail() {
  52. API.newsdetail({id:this.id}).then(response => {
  53. this.isLoading = false;
  54. this.detail = response.data;
  55. }).catch(error => {
  56. this.isLoading = false;
  57. mui.toast(error);
  58. })
  59. },
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .article{
  65. padding: 15px;
  66. .article-tit{
  67. font-size: 20px;
  68. margin-bottom:10px;
  69. }
  70. .article-row{
  71. display: flex;
  72. justify-content: space-between;
  73. align-items: center;
  74. color: #888;
  75. font-size: 12px;
  76. border-bottom: 1px solid #F1F1F1;
  77. padding-bottom: 15px;
  78. .article-time{}
  79. .article-see{
  80. span{
  81. margin-left:3px;
  82. }
  83. }
  84. }
  85. .article-con{
  86. padding: 15px 0 35px;
  87. font-size: 14px;
  88. line-height: 28px;
  89. img{
  90. width: 100%;
  91. margin: 10px 0;
  92. }
  93. }
  94. .article-foot{
  95. height: 50px;
  96. position:fixed;
  97. left: 0;
  98. right: 0;
  99. bottom: 0;
  100. background-color: #fff;
  101. border-top: 1px solid #f7f7f7;
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. padding:0 15px;
  106. .article-btn{
  107. background: #E5E7EA;
  108. padding:6px 10px;
  109. color: #606875;
  110. border-radius: 8px;
  111. span{
  112. margin-left: 3px;
  113. }
  114. }
  115. .u-flex .article-btn{
  116. margin-right: 10px;
  117. }
  118. }
  119. }
  120. </style>