course.vue 2.4 KB

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