teachingList.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="teaching">
  3. <view @click="itemClick(item,index)" class="teaching-item" v-for="(item,index) in list" :key="index">
  4. <view class="teaching-item-title">
  5. {{item.title}}
  6. </view>
  7. <view class="teaching-item-img">
  8. <view v-for="(item1,index1) in item.fileList" :key="index1" class="teaching-item-img-item">
  9. <view class="teaching-item-img-item-top">
  10. <image style="width: 100%;height: 100%;" :src="item1.img" mode=""></image>
  11. </view>
  12. <view class="teaching-item-img-item-bottom">
  13. {{item1.title}}
  14. </view>
  15. <view v-if="show" class="teaching-item-img-item-text">
  16. <view @click.stop='upload(item1)' style="margin-left: 20rpx;" class="">
  17. 下载
  18. </view>
  19. <view @click.stop='preview(item1)' style="margin-right: 20rpx;" class="">
  20. 预览
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="teaching-item-text">
  26. <view class="teaching-item-text-left">
  27. 上传者 {{item.user}}
  28. </view>
  29. <view class="teaching-item-text-right">
  30. 上传时间 {{ item.date}}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. name: "teachingList",
  39. props: {
  40. list: {
  41. default: () => [],
  42. type: Array
  43. },
  44. show: {
  45. type: Boolean,
  46. default: () => false,
  47. }
  48. },
  49. data() {
  50. return {
  51. };
  52. },
  53. methods: {
  54. itemClick(item, index) {
  55. this.$emit('itemClick', item)
  56. },
  57. upload(item) {
  58. this.$emit('upload', item)
  59. },
  60. preview(item){
  61. this.$emit('preview', item)
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .teaching {
  68. width: 100%;
  69. .teaching-item {
  70. padding: 32rpx;
  71. background-color: #fff;
  72. border-radius: 5.33px;
  73. box-shadow: 0px 0px 6.67px 0px rgba(147, 147, 147, 0.20);
  74. box-sizing: border-box;
  75. margin-bottom: 32rpx;
  76. .teaching-item-title {
  77. font-size: 32rpx;
  78. color: #333;
  79. border-bottom: 1px solid #f2f2f2;
  80. padding-bottom: 20rpx;
  81. }
  82. .teaching-item-text {
  83. color: #999;
  84. display: flex;
  85. justify-content: space-between;
  86. }
  87. .teaching-item-img {
  88. display: flex;
  89. flex-wrap: wrap;
  90. margin: 32rpx 0;
  91. .teaching-item-img-item {
  92. width: 25%;
  93. display: flex;
  94. flex-direction: column;
  95. justify-content: center;
  96. align-items: center;
  97. .teaching-item-img-item-top {
  98. width: 66rpx;
  99. height: 74rpx;
  100. margin-bottom: 10rpx;
  101. }
  102. .teaching-item-img-item-text {
  103. display: flex;
  104. justify-content: space-between;
  105. width: 100%;
  106. color: #05CCA1;
  107. font-size: 24rpx;
  108. text-decoration: underline;
  109. }
  110. }
  111. }
  112. }
  113. }
  114. </style>