news_detail.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="news_detail">
  3. <view class="title">
  4. {{detail.title}}
  5. </view>
  6. <view class="time">
  7. {{detail.created_at}}
  8. </view>
  9. <!-- <view class="img">
  10. <image :src="detail.cover_resource ? detail.cover_resource.url :'../../static/images/active_top.png'"></image>
  11. </view> -->
  12. <view class="top">
  13. <u-parse :html="detail.body"></u-parse>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data(){
  20. return{
  21. detail:''
  22. }
  23. },
  24. onShow() {
  25. console.log('pppppppppppp--------------------')
  26. },
  27. onLoad(options) {
  28. console.log(options,'jiezhumeiyou')
  29. let id=options.id
  30. this.getDetail(id)
  31. },
  32. methods:{
  33. getDetail(id){
  34. this.$u.get('/page/news/' + id).then(res=>{
  35. console.log(res,'ppppp')
  36. this.detail=res.data
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. page{
  44. padding: 16px 0;
  45. background-color: #fff;
  46. }
  47. .news_detail{
  48. padding: 16px;
  49. .title{
  50. font-size: 17px;
  51. font-weight: 500;
  52. line-height: 20px;
  53. color: #282828;
  54. line-height: 22px;
  55. opacity: 1;
  56. }
  57. .time{
  58. margin-top: 15px;
  59. font-weight: 400;
  60. line-height: 9px;
  61. font-size: 12px;
  62. color: #A2A2A2;
  63. opacity: 1;
  64. }
  65. .img{
  66. height: 133px;
  67. overflow: hidden;
  68. border-radius: 10px;
  69. margin-top: 20px;
  70. image{
  71. width: 100%;
  72. }
  73. }
  74. .top{
  75. margin-top: 20px;
  76. text-align: justify;
  77. }
  78. }
  79. </style>