school.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <My_listbox ref="List" @getlist="getList">
  3. <view class="box">
  4. <navigator class="nav-box" v-for="item in list" :key="item.sat_courseware_classid"
  5. :url="'/packageA/course/index?id=' + item.sat_courseware_classid + '&classname=' + item.classname"
  6. hover-class="navigator-hover">
  7. <image v-if="item.cover" class="image" :src="item.cover" mode="aspectFill" lazy-load="false" />
  8. <text v-else>{{ item.classname }}</text>
  9. </navigator>
  10. </view>
  11. </My_listbox>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. list: []
  18. }
  19. },
  20. created() {
  21. this.getList()
  22. },
  23. methods: {
  24. getList() {
  25. this.$Http.basic({
  26. "id": "20221102143302",
  27. "content": {
  28. "parentid": 0,
  29. pageSize: 9999,
  30. "where": {
  31. "isenable": 1
  32. }
  33. }
  34. }).then(res => {
  35. console.log("课程分类", res)
  36. this.$refs.List.RefreshToComplete()
  37. if (this.cutoff(res.msg)) return;
  38. this.list = res.data.map(v => {
  39. v.cover = this.getSpecifiedImage(v.attinfos[0] || {})
  40. return v
  41. });
  42. })
  43. }
  44. },
  45. }
  46. </script>
  47. <style lang="scss">
  48. .box {
  49. padding: 0 10px;
  50. box-sizing: border-box;
  51. display: flex;
  52. justify-content: space-between;
  53. flex-wrap: wrap;
  54. .nav-box {
  55. width: 172.5px;
  56. height: 92px;
  57. flex-shrink: 0;
  58. margin-top: 10px;
  59. .image {
  60. width: 100%;
  61. height: 100%;
  62. }
  63. }
  64. }
  65. </style>