detail.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="detail_con">
  3. <view class="title">{{info.title}}</view>
  4. <view class="infobox">
  5. <view class="staff" v-if="info.staff">
  6. <image :src="info.staff.img" class="staffimg" mode=""></image>
  7. <view class="staffname">{{info.staff.name}}</view>
  8. </view>
  9. <view class="time">{{info.createtime}}</view>
  10. </view>
  11. <view class="content" v-html="info.content"></view>
  12. </view>
  13. </template>
  14. <script>
  15. import { netArticleDetail, netArticleNumber } from '@/api/api.js'
  16. export default{
  17. data() {
  18. return{
  19. id:'',
  20. info:{},
  21. comList:[],
  22. content:''
  23. }
  24. },
  25. onLoad(options) {
  26. this.id = options.id
  27. this.getDetail()
  28. //文章点击次数
  29. this.getAddNumber()
  30. },
  31. methods:{
  32. getAddNumber() {
  33. netArticleNumber({id:this.id}).then(res=>{})
  34. },
  35. getDetail() {
  36. netArticleDetail({id:this.id}).then(res=>{
  37. this.info = res.data
  38. })
  39. },
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .detail_con{
  45. padding:24rpx;
  46. .title{
  47. font-size:34rpx;
  48. color:#333333;
  49. margin-bottom:35rpx;
  50. }
  51. .infobox{
  52. display: flex;
  53. justify-content: flex-start;
  54. align-items: center;
  55. margin-bottom:24rpx;
  56. .staff{
  57. display: flex;
  58. justify-content: flex-start;
  59. align-items: center;
  60. .staffimg{
  61. width:50rpx;
  62. height:50rpx;
  63. border-radius: 50%;
  64. margin-right:24rpx;
  65. }
  66. .staffname{
  67. font-size:26rpx;
  68. color:#999999;
  69. }
  70. }
  71. .time{
  72. font-size:26rpx;
  73. color:#999999;
  74. }
  75. }
  76. .content{
  77. font-size:30rpx;
  78. }
  79. }
  80. </style>