course.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. /* this.$navTo.togo('/pages2/class/detail', {
  54. id: item.courseId,
  55. goodsId: this.goodsId,
  56. }); */
  57. this.$navTo.togo('/pages3/polyv/detail', {
  58. id: item.courseId,
  59. goodsId: this.goodsId,
  60. });
  61. },
  62. studyIn(item) {
  63. this.$navTo.togo('/pages3/polyv/detail', {
  64. id: item.courseId,
  65. goodsId: this.goodsId
  66. });
  67. // this.$navTo.togo('/pages2/verify/input');
  68. },
  69. courseCourseList() {
  70. let self = this;
  71. this.param.goodsId =this.goodsId
  72. this.param.gradeId = this.gradeId
  73. this.$api.courseCourseList(this.param).then(res => {
  74. if (res.data.code == 200) {
  75. self.courseList.push.apply(self.courseList, res.data.rows);
  76. self.param.total = res.data.total;
  77. }
  78. });
  79. },
  80. appointment() {
  81. this.$navTo.togo('/pages2/appointment/index');
  82. }
  83. }
  84. };
  85. </script>
  86. <style>
  87. page {
  88. background: #eaeef1;
  89. }
  90. </style>
  91. <style scope>
  92. .box_progress {
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. margin-top: 20rpx;
  97. }
  98. .bottomBox {
  99. background: #ffffff;
  100. width: 94%;
  101. border-bottom-left-radius: 24rpx;
  102. border-bottom-right-radius: 24rpx;
  103. margin: 0 auto;
  104. padding: 20rpx;
  105. }
  106. .content_box {
  107. display: flex;
  108. align-items: center;
  109. color: #999999;
  110. margin-top: 8rpx;
  111. }
  112. .content {
  113. color: #000000;
  114. margin: 0 8rpx;
  115. }
  116. .wk_icon {
  117. width: 24rpx;
  118. height: 24rpx;
  119. margin-right: 8rpx;
  120. }
  121. .class_item {
  122. width: 100%;
  123. background: #ffffff;
  124. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  125. border-radius: 24rpx;
  126. padding: 20rpx;
  127. z-index: 999;
  128. position: relative;
  129. }
  130. </style>