course.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view style="padding: 30rpx;">
  3. <view v-if="!courseList.length">
  4. <u-empty text="暂无课程" mode="list"></u-empty>
  5. </view>
  6. <view v-else @click="jump(item)" v-for="(item, index) in courseList" :key="index" style="margin-bottom: 30rpx;">
  7. <view class="class_item">
  8. <image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
  9. <view style="color: #333333;font-weight: bold;font-size: 32rpx;">{{ item.courseName }}</view>
  10. </view>
  11. <view class="bottomBox">
  12. <view class=".content_box">
  13. <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  14. 学习进度:{{ item.stuAllNum }}/{{ item.secAllNum }}
  15. </view>
  16. <view class="box_progress">
  17. <view style="width: 60%;"><u-line-progress height="22" :show-percent="false" active-color="#ff9900" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
  18. <view><u-button type="warning" size="mini" @click.stop="studyIn(item)">进入学习</u-button></view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. goodsId: 0,
  29. gradeId:0,
  30. courseList: [],
  31. param:{
  32. pageNum: 1,
  33. pageSize: 10,
  34. total: 0
  35. },
  36. };
  37. },
  38. onLoad(option) {
  39. this.goodsId = Number(option.id);
  40. this.gradeId = Number(option.gid)
  41. // uni.setStorageSync('courseGoodsId', this.goodsId);
  42. this.courseCourseList();
  43. this.$store.getters.dictObj
  44. },
  45. onReachBottom() {
  46. if (this.courseList.length < this.param.total) {
  47. this.param.pageNum++;
  48. this.courseCourseList();
  49. }
  50. },
  51. methods: {
  52. jump(item) {
  53. if(item.rebuild === 0) { //未重修
  54. this.$navTo.togo('/pages2/learn/details', {
  55. id: item.courseId,
  56. gradeId:item.gradeId,
  57. goodsId: this.goodsId
  58. });
  59. return;
  60. }
  61. this.$navTo.togo('/pages3/polyv/detail', {
  62. id: item.courseId,
  63. goodsId: this.goodsId,
  64. });
  65. },
  66. studyIn(item) {
  67. if(item.rebuild === 0) { //未重修
  68. this.$navTo.togo('/pages2/learn/details', {
  69. id: item.courseId,
  70. gradeId:item.gradeId,
  71. goodsId: this.goodsId
  72. });
  73. return;
  74. }
  75. this.$navTo.togo('/pages3/polyv/detail', {
  76. id: item.courseId,
  77. goodsId: this.goodsId
  78. });
  79. // this.$navTo.togo('/pages2/verify/input');
  80. },
  81. courseCourseList() {
  82. let self = this;
  83. this.param.goodsId =this.goodsId
  84. this.param.gradeId = this.gradeId
  85. this.$api.courseCourseList(this.param).then(res => {
  86. if (res.data.code == 200) {
  87. self.courseList.push.apply(self.courseList, res.data.rows);
  88. self.param.total = res.data.total;
  89. }
  90. });
  91. },
  92. appointment() {
  93. this.$navTo.togo('/pages2/appointment/index');
  94. }
  95. }
  96. };
  97. </script>
  98. <style>
  99. page {
  100. background: #eaeef1;
  101. }
  102. </style>
  103. <style scope>
  104. .box_progress {
  105. display: flex;
  106. justify-content: space-between;
  107. align-items: center;
  108. margin-top: 20rpx;
  109. }
  110. .bottomBox {
  111. background: #ffffff;
  112. width: 94%;
  113. border-bottom-left-radius: 24rpx;
  114. border-bottom-right-radius: 24rpx;
  115. margin: 0 auto;
  116. padding: 20rpx;
  117. }
  118. .content_box {
  119. display: flex;
  120. align-items: center;
  121. color: #999999;
  122. margin-top: 8rpx;
  123. }
  124. .content {
  125. color: #000000;
  126. margin: 0 8rpx;
  127. }
  128. .wk_icon {
  129. width: 24rpx;
  130. height: 24rpx;
  131. margin-right: 8rpx;
  132. }
  133. .class_item {
  134. width: 100%;
  135. background: #ffffff;
  136. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  137. border-radius: 24rpx;
  138. padding: 20rpx;
  139. z-index: 999;
  140. position: relative;
  141. }
  142. </style>