class.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. <<<<<<< HEAD
  43. export default {
  44. data() {
  45. return {
  46. list: [1, 2, 3],
  47. goodsList: []
  48. };
  49. },
  50. onLoad(option) {
  51. this.courseGoodsList();
  52. },
  53. onShow() {},
  54. methods: {
  55. courseGoodsList() {
  56. let self = this;
  57. this.$api.courseGoodsList().then(res => {
  58. if (res.data.code == 200) {
  59. self.goodsList = res.data.rows;
  60. }
  61. });
  62. =======
  63. export default {
  64. data() {
  65. return {
  66. goodsList:[]
  67. }
  68. },
  69. onLoad(option) {
  70. this.courseGoodsList()
  71. },
  72. onShow(){
  73. >>>>>>> 4a93964cbb34c8e446d0e60cb99d616e47507617
  74. },
  75. studyIn() {
  76. this.$navTo.togo('/pages2/verify/input');
  77. },
  78. appointment(item) {
  79. var data = {
  80. goodsId: item.goodsId,
  81. gradeId: item.gradeId
  82. };
  83. this.$api.getApplysubscribe(data).then(res => {
  84. if (res.data.code === 500) {
  85. uni.showModal({
  86. showCancel: false,
  87. content: res.data.msg
  88. });
  89. }
  90. if (res.data.code === 200) {
  91. this.$navTo.togo('/pages2/appointment/index', {
  92. goodsId: item.goodsId,
  93. gradeId: item.gradeId
  94. });
  95. }
  96. });
  97. }
  98. }
  99. };
  100. </script>
  101. <style>
  102. page {
  103. background: #eaeef1;
  104. }
  105. </style>
  106. <style scope>
  107. .box_progress {
  108. display: flex;
  109. justify-content: space-between;
  110. align-items: center;
  111. margin-top: 20rpx;
  112. }
  113. .bottomBox {
  114. background: #ffffff;
  115. width: 94%;
  116. border-bottom-left-radius: 24rpx;
  117. border-bottom-right-radius: 24rpx;
  118. margin: 0 auto;
  119. padding: 20rpx;
  120. }
  121. .content_box {
  122. display: flex;
  123. align-items: center;
  124. color: #999999;
  125. margin-top: 8rpx;
  126. }
  127. .content {
  128. color: #000000;
  129. margin: 0 8rpx;
  130. }
  131. .wk_icon {
  132. width: 24rpx;
  133. height: 24rpx;
  134. margin-right: 8rpx;
  135. }
  136. .class_item {
  137. width: 100%;
  138. background: #ffffff;
  139. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  140. border-radius: 24rpx;
  141. padding: 20rpx;
  142. z-index: 999;
  143. position: relative;
  144. }
  145. </style>