class.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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">3</text>
  10. <text class="content">120</text>
  11. <text class="content">60</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. 学习进度:26/120
  24. </view>
  25. <view class="box_progress">
  26. <view style="width: 60%;"><u-line-progress active-color="#ff9900" :percent="70"></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">
  30. <view style="width: 60%;"><text style="color: #333333;white-space: nowrap;text-overflow: ellipsis;">这是一个考试标题</text></view>
  31. <view><u-button :plain="true" type="primary" size="mini" @click.stop="appointment(item)">预约考试</u-button></view>
  32. </view>
  33. <view class="box_progress" v-if="false">
  34. <view style="width: 60%;"><text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">【机电全科】2021年一建黄金A</text></view>
  35. <view><u-button type="primary" size="mini">进入刷题</u-button></view>
  36. </view>
  37. </view>
  38. </navigator>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. list: [1, 2, 3],
  46. goodsList: []
  47. };
  48. },
  49. onLoad(option) {
  50. this.courseGoodsList();
  51. },
  52. onShow() {},
  53. methods: {
  54. courseGoodsList() {
  55. let self = this;
  56. this.$api.courseGoodsList().then(res => {
  57. if (res.data.code == 200) {
  58. self.goodsList = res.data.rows;
  59. }
  60. });
  61. },
  62. studyIn() {
  63. this.$navTo.togo('/pages2/verify/input');
  64. },
  65. appointment(item) {
  66. var data = {
  67. goodsId: item.goodsId,
  68. gradeId: item.gradeId
  69. };
  70. this.$api.getApplysubscribe(data).then(res => {
  71. if (res.data.code === 500) {
  72. uni.showModal({
  73. showCancel: false,
  74. content: res.data.msg
  75. });
  76. }
  77. if (res.data.code === 200) {
  78. this.$navTo.togo('/pages2/appointment/index', {
  79. goodsId: item.goodsId,
  80. gradeId: item.gradeId
  81. });
  82. }
  83. });
  84. }
  85. }
  86. };
  87. </script>
  88. <style>
  89. page {
  90. background: #eaeef1;
  91. }
  92. </style>
  93. <style scope>
  94. .box_progress {
  95. display: flex;
  96. justify-content: space-between;
  97. align-items: center;
  98. margin-top: 20rpx;
  99. }
  100. .bottomBox {
  101. background: #ffffff;
  102. width: 94%;
  103. border-bottom-left-radius: 24rpx;
  104. border-bottom-right-radius: 24rpx;
  105. margin: 0 auto;
  106. padding: 20rpx;
  107. }
  108. .content_box {
  109. display: flex;
  110. align-items: center;
  111. color: #999999;
  112. margin-top: 8rpx;
  113. }
  114. .content {
  115. color: #000000;
  116. margin: 0 8rpx;
  117. }
  118. .wk_icon {
  119. width: 24rpx;
  120. height: 24rpx;
  121. margin-right: 8rpx;
  122. }
  123. .class_item {
  124. width: 100%;
  125. background: #ffffff;
  126. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  127. border-radius: 24rpx;
  128. padding: 20rpx;
  129. z-index: 999;
  130. position: relative;
  131. }
  132. </style>