course.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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(item)">进入学习</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(item){
  57. this.$navTo.togo('/pages2/class/detail', {
  58. id: item.courseId
  59. });
  60. // this.$navTo.togo('/pages2/verify/input');
  61. },
  62. appointment(){
  63. this.$navTo.togo('/pages2/appointment/index');
  64. }
  65. },
  66. }
  67. </script>
  68. <style >
  69. page {
  70. background: #EAEEF1;
  71. }
  72. </style>
  73. <style scope>
  74. .box_progress{
  75. display: flex;
  76. justify-content:space-between;
  77. align-items: center;
  78. margin-top: 20rpx;
  79. }
  80. .bottomBox{
  81. background: #FFFFFF;
  82. width: 94%;
  83. border-bottom-left-radius: 24rpx;
  84. border-bottom-right-radius: 24rpx;
  85. margin: 0 auto;
  86. padding: 20rpx;
  87. }
  88. .content_box{
  89. display: flex;
  90. align-items: center;
  91. color: #999999;
  92. margin-top: 8rpx;
  93. }
  94. .content{
  95. color: #000000;
  96. margin: 0 8rpx;
  97. }
  98. .wk_icon{
  99. width: 24rpx;
  100. height: 24rpx;
  101. margin-right: 8rpx;
  102. }
  103. .class_item{
  104. width: 100%;
  105. background: #FFFFFF;
  106. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  107. border-radius: 24rpx;
  108. padding: 20rpx;
  109. z-index: 999;
  110. position: relative;
  111. }
  112. </style>