class.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view style="padding: 30rpx;">
  3. <navigator :url="'/pages2/wd/course?id=' + item.goodsId" v-for="(item, index) in goodsList" :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.goodsName }}</view>
  7. <view class=".content_box">
  8. <image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  9. <text class="content">{{item.courseNum}}</text>
  10. <text class="content">{{ item.secAllNum }}</text>
  11. <text class="content">{{ item.classHours }}</text>
  12. 学时
  13. </view>
  14. <view class=".content_box">
  15. <image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
  16. 学习有效期:
  17. <text class="content">{{ $method.timestampToTime(item.validityStartTime) }} - {{ $method.timestampToTime(item.validityEndTime) }}</text>
  18. </view>
  19. </view>
  20. <view class="bottomBox">
  21. <view class=".content_box">
  22. <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  23. 学习进度:{{ item.stuAllNum }}/{{ item.secAllNum }}
  24. </view>
  25. <view class="box_progress">
  26. <view style="width: 60%;"><u-line-progress :showText="false" active-color="#ff9900" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
  27. <view><u-button type="warning" size="mini" @click.stop="studyIn">进入学习</u-button></view>
  28. </view>
  29. <view class="box_progress" v-if="item.applyStatus === 1">
  30. <view style="width: 60%;">
  31. <text style="color: #333333;white-space: nowrap;text-overflow: ellipsis;">{{ item.applyName }}</text>
  32. </view>
  33. <view><u-button :plain="true" type="primary" size="mini" @click.stop="appointment(item)">预约考试</u-button></view>
  34. </view>
  35. <view class="box_progress" v-if="item.beforeStatus === 1">
  36. <view style="width: 60%;">
  37. <text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">{{ item.beforeName }}</text>
  38. </view>
  39. <view><u-button type="primary" size="mini">进入刷题</u-button></view>
  40. </view>
  41. </view>
  42. </navigator>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. list: [1, 2, 3],
  50. goodsList: []
  51. };
  52. },
  53. onLoad(option) {
  54. this.courseGoodsList();
  55. },
  56. onShow() {},
  57. methods: {
  58. courseGoodsList() {
  59. let self = this;
  60. this.$api.courseGoodsList().then(res => {
  61. if (res.data.code == 200) {
  62. self.goodsList = res.data.rows;
  63. }
  64. });
  65. },
  66. studyIn() {
  67. this.$navTo.togo('/pages2/verify/input');
  68. },
  69. appointment(item) {
  70. var data = {
  71. goodsId: item.goodsId,
  72. gradeId: item.gradeId
  73. };
  74. this.$api.getApplysubscribe(data).then(res => {
  75. if (res.data.code === 500) {
  76. uni.showModal({
  77. showCancel: false,
  78. content: res.data.msg
  79. });
  80. }
  81. if (res.data.code === 200) {
  82. this.$navTo.togo('/pages2/appointment/index', {
  83. goodsId: item.goodsId,
  84. gradeId: item.gradeId
  85. });
  86. }
  87. });
  88. }
  89. }
  90. };
  91. </script>
  92. <style>
  93. page {
  94. background: #eaeef1;
  95. }
  96. </style>
  97. <style scope>
  98. .box_progress {
  99. display: flex;
  100. justify-content: space-between;
  101. align-items: center;
  102. margin-top: 20rpx;
  103. }
  104. .bottomBox {
  105. background: #ffffff;
  106. width: 94%;
  107. border-bottom-left-radius: 24rpx;
  108. border-bottom-right-radius: 24rpx;
  109. margin: 0 auto;
  110. padding: 20rpx;
  111. }
  112. .content_box {
  113. display: flex;
  114. align-items: center;
  115. color: #999999;
  116. margin-top: 8rpx;
  117. }
  118. .content {
  119. color: #000000;
  120. margin: 0 8rpx;
  121. }
  122. .wk_icon {
  123. width: 24rpx;
  124. height: 24rpx;
  125. margin-right: 8rpx;
  126. }
  127. .class_item {
  128. width: 100%;
  129. background: #ffffff;
  130. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  131. border-radius: 24rpx;
  132. padding: 20rpx;
  133. z-index: 999;
  134. position: relative;
  135. }
  136. </style>