messageDetail.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="content">
  3. <view class="title">
  4. <image src="../../static/img/detailImg.jpg" mode=""></image>
  5. </view>
  6. <view class="contentt">
  7. {{list.content}}
  8. </view>
  9. <view class="time">
  10. {{time}}
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import {messageDetail} from '@/api/index.js'
  16. import {getTime} from '@/utils/rocessor.js'
  17. export default {
  18. data() {
  19. return {
  20. id:'',
  21. list:[],
  22. time:'',
  23. isLook:false
  24. };
  25. },
  26. onLoad(options){
  27. this.id =options.id
  28. console.log(this.id,'打印');
  29. this.get()
  30. },
  31. onShow() {
  32. this.get()
  33. },
  34. methods: {
  35. get(){
  36. messageDetail({},this.id).then(res=>{
  37. console.log(res,'rees');
  38. this.list = res.data
  39. this.time = getTime(res.data.add_time)
  40. })
  41. }
  42. },
  43. }
  44. </script>
  45. <style lang="scss">
  46. .content{
  47. padding: 30rpx;
  48. }
  49. .title{
  50. width: 690rpx;
  51. height: 300rpx;
  52. border-radius: 20rpx;
  53. overflow: hidden;
  54. image{
  55. width: 100%;
  56. height: 100%;
  57. }
  58. }
  59. .contentt{
  60. margin-top: 20rpx;
  61. font-size: 34rpx;
  62. font-weight: 500;
  63. }
  64. .time{
  65. margin-top: 40rpx;
  66. display: flex;
  67. justify-content: flex-end;
  68. color: coral;
  69. }
  70. </style>