informationDetails.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="center">
  3. <view class="bg">
  4. <image :src="src" mode=""></image>
  5. </view>
  6. <view class="title">
  7. {{ title }}
  8. </view>
  9. <view class="content">
  10. {{ synopsis }}
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import { details } from '@/api/index.js';
  16. export default {
  17. data(){
  18. return{
  19. src: '',
  20. title: '',
  21. synopsis:'',
  22. time:'',
  23. }
  24. },
  25. onLoad(option) {
  26. this.loadData(option.id);
  27. },
  28. methods: {
  29. async loadData(id){
  30. let obj = this;
  31. details({},id).then(e =>{
  32. console.log(e);
  33. obj.src = e.data.image_input[0];
  34. obj.title = e.data.title;
  35. obj.synopsis = e.data.synopsis;
  36. obj.time = e.data.add_time;
  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. width: 100%;
  51. height: 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. display: -webkit-box;
  63. -webkit-line-clamp: 2;
  64. -webkit-box-orient: vertical;
  65. }
  66. .time {
  67. width: 90%;
  68. margin: 0 auto;
  69. margin-top: 16rpx;
  70. font-size: 24rpx;
  71. font-weight: 500;
  72. color: #656b6c;
  73. }
  74. .content{
  75. width: 90%;
  76. margin:0 auto;
  77. margin-top: 20rpx;
  78. font-size: 32rpx;
  79. font-weight: 500;
  80. color:#777777;
  81. }
  82. </style>