teachD.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 v-html="synopsis" class="content">
  10. {{ synopsis }}
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import { details } from '@/api/product.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.content
  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. /deep/ .content{
  83. img{
  84. width: 100%;
  85. height: 100%;
  86. }
  87. }
  88. </style>