index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view>
  3. <view style="height: 10px;">
  4. </view>
  5. <My_listbox ref="List" @getlist="getList" boxBackground="#fff">
  6. <view class="list-box">
  7. <navigator class="item" v-for="item in list" :key="item.sat_coursewareid"
  8. :url="'/packageA/course/list?id=' + item.sat_coursewareid">
  9. <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
  10. <view class="text">
  11. <view class="title u-line-1">{{ item.title || '--' }}</view>
  12. <view class="teacher u-line-1">讲师:{{ item.teacher || '--' }}</view>
  13. <view class="count u-line-1">共{{ item.courseware_count || 0 }}个课件 | {{ item.study_count || 0 }}人已学习
  14. </view>
  15. </view>
  16. </navigator>
  17. </view>
  18. </My_listbox>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. crumbs: [],
  26. types: [],
  27. list: [],
  28. "content": {
  29. "where": {
  30. "condition": "",
  31. "sat_courseware_classids": [[]]
  32. }
  33. }
  34. }
  35. },
  36. onLoad(options) {
  37. this.crumbs = [{
  38. classname: "商学院"
  39. }, {
  40. classname: options.classname,
  41. parentid: options.id
  42. }, {
  43. classname: "全部",
  44. parentid: ''
  45. },]
  46. this.getType()
  47. this.getList(true)
  48. },
  49. methods: {
  50. getType() {
  51. this.$Http.basic({
  52. "id": "20221102143302",
  53. content: {
  54. pageSize: 9999,
  55. parentid: this.crumbs[1].parentid,
  56. "where": {
  57. "isenable": 1
  58. }
  59. }
  60. }).then(res => {
  61. console.log("获取二级列表", res)
  62. if (this.cutoff(res.msg)) return;
  63. this.types = res.pageNumber == 1 ? res.data : this.types.concat(res.data);
  64. })
  65. },
  66. getList(init = false) {
  67. if (this.paging(this.content, init)) return;
  68. this.content.where.sat_courseware_classids = [
  69. [
  70. this.crumbs[1].parentid,
  71. this.crumbs[2].parentid,
  72. ].filter(v => v)
  73. ]
  74. this.$Http.basic({
  75. "id": 20240318101802,
  76. content: this.content
  77. }).then(res => {
  78. this.$refs.List.RefreshToComplete()
  79. console.log("获取课程列表", res)
  80. if (this.cutoff(res.msg)) return;
  81. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  82. this.content = this.$refs.List.paging(this.content, res)
  83. })
  84. },
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .list-box {
  90. padding: 10px;
  91. width: 100vw;
  92. box-sizing: border-box;
  93. .item {
  94. display: flex;
  95. width: 100%;
  96. border-radius: 5px;
  97. overflow: hidden;
  98. margin-top: 10px;
  99. .image {
  100. width: 120px;
  101. height: 74px;
  102. margin-right: 10px;
  103. border-radius: 5px;
  104. flex-shrink: 0;
  105. }
  106. .text {
  107. flex: 1;
  108. font-family: Source Han Sans SC, Source Han Sans SC;
  109. .title {
  110. font-weight: bold;
  111. font-size: 16px;
  112. color: #000000;
  113. line-height: 24px;
  114. }
  115. .teacher {
  116. font-size: 14px;
  117. color: #999999;
  118. line-height: 20px;
  119. margin-top: 4px;
  120. }
  121. .count {
  122. font-size: 12px;
  123. color: #666666;
  124. line-height: 17px;
  125. margin-top: 8px;
  126. }
  127. }
  128. }
  129. }
  130. </style>