message.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="center">
  3. <view class="bg">
  4. <image :src="image" mode=""></image>
  5. </view>
  6. <view class="title">{{ title }}</view>
  7. <view class="time">{{ time }}</view>
  8. <view class="content" v-html="content">
  9. {{ content }}
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import { details } from '@/api/index.js';
  15. export default {
  16. data() {
  17. return {
  18. title:'',
  19. time:'',
  20. content:'',
  21. id:'',
  22. image:'',
  23. }
  24. },
  25. onLoad(option){
  26. this.id = option.id;
  27. this.loadData();
  28. },
  29. methods:{
  30. async loadData(){
  31. const obj = this;
  32. details({},obj.id).then(({data}) => {
  33. obj.title = data.title;
  34. obj.time = data.add_time;
  35. obj.content = data.content;
  36. obj.image = data.image_input[0];
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss">
  43. .center{
  44. height: 100%;
  45. }
  46. .bg{
  47. width: 100%;
  48. height: 474rpx;
  49. image{
  50. height: 100%;
  51. width: 100%;
  52. }
  53. }
  54. .title {
  55. width: 90%;
  56. margin: 0 auto;
  57. font-size: 40rpx;
  58. font-weight: 500;
  59. color: #171313;
  60. text-overflow: -o-ellipsis-lastline;
  61. overflow: hidden;
  62. text-overflow: ellipsis;
  63. display: -webkit-box;
  64. -webkit-line-clamp: 2;
  65. -webkit-box-orient: vertical;
  66. }
  67. .time {
  68. width: 90%;
  69. margin: 0 auto;
  70. margin-top: 16rpx;
  71. font-size: 24rpx;
  72. font-weight: 500;
  73. color: #656B6C;
  74. }
  75. .content {
  76. width: 90%;
  77. margin: 0 auto;
  78. margin-top: 20rpx;
  79. font-size: 32rpx;
  80. font-weight: 500;
  81. color: #777777;
  82. }
  83. </style>