hourlist.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="hour">
  3. <view v-for="(item,index ) in list" :key="index" class="hour-item">
  4. <view class="hour-item-title">
  5. <view class="hour-item-title-left">
  6. <view class="hour-item-title-left-text">
  7. {{item.title}}
  8. </view>
  9. <view class="hour-item-title-left-schedule">
  10. 3 / 7 课时
  11. </view>
  12. </view>
  13. <view @click="open(item)" class="hour-item-title-right">
  14. <uni-icons v-if="item.show" color="#999" type="bottom" size="18"></uni-icons>
  15. <uni-icons v-else color="#999" type="top" size="18"></uni-icons>
  16. </view>
  17. </view>
  18. <uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :show="item.show">
  19. <view v-for="(item1,index1) in item.fileList" :key="index1" class="hour-data">
  20. <view class="hour-data-left">
  21. <view class="hour-data-left-index">
  22. {{index1 + 1}}.
  23. </view>
  24. <view class="">
  25. {{item1.title}}
  26. </view>
  27. </view>
  28. <view class="hour-data-right">
  29. <view :key="index2" :style="`background-color:${index2 == 2 ? '#05CCA1':''} ;`" v-for="(item2,index2) in [1,3,4,5,6,7]"
  30. class="hour-data-right-item">
  31. </view>
  32. </view>
  33. </view>
  34. </uni-transition>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: "hourlist",
  41. props: {
  42. list: {
  43. type: Array,
  44. default: () => []
  45. }
  46. },
  47. data() {
  48. return {
  49. modeClass: ''
  50. };
  51. },
  52. methods: {
  53. open(item) {
  54. item.show = !item.show
  55. this.modeClass = ['fade', 'zoom-in']
  56. this.$emit('update:list', this.list)
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .hour {
  63. width: 100%;
  64. font-family: 'PingFang';
  65. }
  66. .hour-item {
  67. padding: 24rpx;
  68. background-color: #fff;
  69. border-radius: 5.33px;
  70. box-shadow: 0px 0px 8px 0px rgba(147, 147, 147, 0.20);
  71. margin-bottom: 32rpx;
  72. .hour-data {
  73. height: 66rpx;
  74. border-bottom: 1px solid #f2f2f2;
  75. display: flex;
  76. align-items: center;
  77. font-size: 24rpx;
  78. display: flex;
  79. justify-content: space-between;
  80. .hour-data-right {
  81. display: flex;
  82. align-items: center;
  83. .hour-data-right-item {
  84. width: 16rpx;
  85. height: 16rpx;
  86. margin-right: 10rpx;
  87. border-radius: 8rpx;
  88. background-color: #dedede;
  89. }
  90. }
  91. .hour-data-left {
  92. display: flex;
  93. .hour-data-left-index {
  94. margin-right: 12rpx;
  95. }
  96. }
  97. }
  98. .hour-item-title {
  99. width: 100%;
  100. padding-bottom: 24rpx;
  101. border-bottom: 1px solid #f2f2f2;
  102. display: flex;
  103. justify-content: space-between;
  104. .hour-item-title-left {
  105. display: flex;
  106. .hour-item-title-left-text {
  107. font-size: 28rpx;
  108. font-weight: 700;
  109. color: #333;
  110. margin-right: 32rpx;
  111. }
  112. .hour-item-title-left-schedule {
  113. background: #e4fff9;
  114. color: #05cca1;
  115. padding: 0 24rpx;
  116. height: 46rpx;
  117. line-height: 46rpx;
  118. border-radius: 23rpx;
  119. }
  120. }
  121. }
  122. }
  123. </style>