course.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. };
  28. },
  29. onLoad(option) {
  30. this.goodsId = Number(option.id);
  31. // uni.setStorageSync('courseGoodsId', this.goodsId);
  32. this.courseCourseList();
  33. },
  34. onShow() {},
  35. methods: {
  36. jump(item) {
  37. this.$navTo.togo('/pages2/class/detail', {
  38. id: item.courseId,
  39. goodsId: this.goodsId
  40. });
  41. },
  42. studyIn(item) {
  43. this.$navTo.togo('/pages2/class/detail', {
  44. id: item.courseId,
  45. goodsId: this.goodsId
  46. });
  47. // this.$navTo.togo('/pages2/verify/input');
  48. },
  49. courseCourseList() {
  50. let self = this;
  51. this.$api.courseCourseList({ goodsId: this.goodsId }).then(res => {
  52. if (res.data.code == 200) {
  53. self.courseList = res.data.rows;
  54. }
  55. });
  56. },
  57. appointment() {
  58. this.$navTo.togo('/pages2/appointment/index');
  59. }
  60. }
  61. };
  62. </script>
  63. <style>
  64. page {
  65. background: #eaeef1;
  66. }
  67. </style>
  68. <style scope>
  69. .box_progress {
  70. display: flex;
  71. justify-content: space-between;
  72. align-items: center;
  73. margin-top: 20rpx;
  74. }
  75. .bottomBox {
  76. background: #ffffff;
  77. width: 94%;
  78. border-bottom-left-radius: 24rpx;
  79. border-bottom-right-radius: 24rpx;
  80. margin: 0 auto;
  81. padding: 20rpx;
  82. }
  83. .content_box {
  84. display: flex;
  85. align-items: center;
  86. color: #999999;
  87. margin-top: 8rpx;
  88. }
  89. .content {
  90. color: #000000;
  91. margin: 0 8rpx;
  92. }
  93. .wk_icon {
  94. width: 24rpx;
  95. height: 24rpx;
  96. margin-right: 8rpx;
  97. }
  98. .class_item {
  99. width: 100%;
  100. background: #ffffff;
  101. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  102. border-radius: 24rpx;
  103. padding: 20rpx;
  104. z-index: 999;
  105. position: relative;
  106. }
  107. </style>