school.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <My_listbox ref="List" @getlist="getList" :isShowEmpty="false" :bottomHeight="70">
  3. <slideshow ref="slideshow" empty />
  4. <view class="box">
  5. <view class="head" />
  6. <navigator class="nav-box" v-for="item in list" :key="item.sat_courseware_classid"
  7. :url="'/packageA/course/index?id=' + item.sat_courseware_classid + '&classname=' + item.classname"
  8. hover-class="navigator-hover">
  9. <view class="classname u-line-1">
  10. {{ item.classname }}
  11. </view>
  12. <view class="remarks u-line-1">
  13. {{ item.remarks }}
  14. </view>
  15. <view class="line" :style="{ background: item.color }" />
  16. </navigator>
  17. <navigator class="nav-box" v-for="item in appList" :key="item.name" :url="item.path"
  18. hover-class="navigator-hover">
  19. <view class="classname u-line-1">
  20. {{ item.classname }}
  21. </view>
  22. <view class="remarks u-line-1">
  23. {{ item.remarks }}
  24. </view>
  25. <view class="line" :style="{ background: item.color }" />
  26. </navigator>
  27. </view>
  28. </My_listbox>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. updatePage: true,
  35. list: [],
  36. appList: [],
  37. colors: ['#FFE6E7', '#EAEAFF', '#DDF3FD'],
  38. "content": {
  39. "parentid": 0,
  40. "where": {
  41. "isenable": 1
  42. }
  43. }
  44. }
  45. },
  46. methods: {
  47. init(callBack) {
  48. try {
  49. this.appList = this.dye(this.getApps('商学院').map(v => {
  50. v.classname = v.remark;
  51. switch (v.name) {
  52. case "exam":
  53. v.remarks = 'TEST'
  54. break;
  55. }
  56. return v
  57. }), this.colors)
  58. } catch (error) {
  59. console.log("未获取到授权信息")
  60. }
  61. Promise.all([this.getList(true), this.$refs.slideshow.getBanners(['courseTop'])]).then(res => {
  62. callBack()
  63. this.updatePage = false;
  64. })
  65. },
  66. getList(init = false) {
  67. return new Promise((resolve, reject) => {
  68. if (this.paging(this.content, init)) return resolve();
  69. this.$Http.basic({
  70. "id": "20221102143302",
  71. content: this.content
  72. }).then(res => {
  73. console.log("课程分类", res)
  74. this.$refs.List.RefreshToComplete()
  75. resolve()
  76. if (this.cutoff(res.msg)) return;
  77. this.list = this.dye(res.pageNumber == 1 ? res.data : this.list.concat(res.data), this.colors);
  78. this.content = this.$refs.List.paging(this.content, res)
  79. })
  80. })
  81. }
  82. },
  83. }
  84. </script>
  85. <style lang="scss">
  86. .box {
  87. position: relative;
  88. padding: 0 10px;
  89. box-sizing: border-box;
  90. display: flex;
  91. justify-content: space-between;
  92. flex-wrap: wrap;
  93. .head {
  94. position: absolute;
  95. height: 10px;
  96. width: 100vw;
  97. border-radius: 8px 8px 0 0;
  98. background: #F7F7F7;
  99. top: -10px;
  100. left: 0;
  101. z-index: 1;
  102. }
  103. .nav-box {
  104. width: 172.5px;
  105. height: 92px;
  106. flex-shrink: 0;
  107. margin-bottom: 10px;
  108. background: #fff;
  109. padding: 15px;
  110. border-radius: 8px;
  111. box-sizing: border-box;
  112. .classname {
  113. line-height: 24px;
  114. font-family: Source Han Sans SC, Source Han Sans SC;
  115. font-weight: bold;
  116. font-size: 16px;
  117. color: #333333;
  118. }
  119. .remarks {
  120. line-height: 15px;
  121. font-family: Source Han Sans SC, Source Han Sans SC;
  122. font-size: 10px;
  123. color: #999999;
  124. margin-top: 10px;
  125. }
  126. .line {
  127. width: 32px;
  128. height: 3px;
  129. margin-top: 10px;
  130. }
  131. }
  132. }
  133. </style>