course.vue 2.8 KB

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