course-item.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="course-item" @click="onJumpDetail">
  3. <view class="b-cover">
  4. <image style="width: 100%; height: 100%" :src="item.cover_url" mode="aspectFill"></image>
  5. </view>
  6. <view class="b-main">
  7. <text class="text_23">{{ item.name }}</text>
  8. <view class="b-price">
  9. <view class="aa" style="display: flex; margin-top: 70rpx; width: 150rpx">
  10. <view lines="1" class="text_25">会员价</view>
  11. <view lines="1" class="text_26">¥{{ item.price }}</view>
  12. </view>
  13. <!-- <view class="s-vip-price" v-if="item.card_price > 0 && !iphonePlatform">会员价 ¥{{ item.card_price }}</view> -->
  14. <button bindtap="onClick" class="button_6">
  15. <text lines="1" class="text_27">立即报名</text>
  16. </button>
  17. </view>
  18. <!-- <view class="b-info">
  19. <view class="s-category">{{ item.category_name }}</view>
  20. <view class="b-counter">
  21. <view class="s-learn">{{ item.count_user }}人学习</view>
  22. </view>
  23. </view> -->
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. // import mixinsGoods from '@/mixins/goods.js';
  29. export default {
  30. name: 'course-item',
  31. // mixins: [mixinsGoods],
  32. props: {
  33. item: {
  34. type: Object,
  35. default: null
  36. }
  37. },
  38. data() {
  39. return {};
  40. },
  41. methods: {
  42. onJumpDetail() {
  43. console.log(11);
  44. console.log(this.item, 565656);
  45. uni.navigateTo({
  46. url: '/pages/course/detail?cid=' + this.item.id
  47. });
  48. }
  49. }
  50. };
  51. </script>
  52. <style>
  53. .button_6 {
  54. background-color: rgba(202, 86, 66, 1);
  55. border-radius: 10rpx;
  56. height: 44rpx;
  57. display: flex;
  58. flex-direction: column;
  59. width: 129rpx;
  60. margin: 70rpx 18rpx 0 82rpx;
  61. }
  62. .text_23 {
  63. width: 110rpx;
  64. height: 26rpx;
  65. overflow-wrap: break-word;
  66. color: rgba(49, 37, 32, 1);
  67. font-size: 28rpx;
  68. font-family: SourceHanSansCN-Regular;
  69. font-weight: normal;
  70. text-align: left;
  71. white-space: nowrap;
  72. line-height: 28rpx;
  73. margin-left: 1rpx;
  74. }
  75. .text_25 {
  76. width: 60rpx;
  77. height: 20rpx;
  78. overflow-wrap: break-word;
  79. color: rgba(202, 86, 66, 1);
  80. font-size: 20rpx;
  81. font-family: SourceHanSansCN-Regular;
  82. font-weight: normal;
  83. text-align: left;
  84. white-space: nowrap;
  85. line-height: 20rpx;
  86. margin-top: 2rpx;
  87. }
  88. .text_26 {
  89. width: 56rpx;
  90. height: 22rpx;
  91. overflow-wrap: break-word;
  92. color: rgba(202, 86, 66, 1);
  93. font-size: 28rpx;
  94. font-family: SourceHanSansCN-Bold;
  95. font-weight: 700;
  96. text-align: left;
  97. white-space: nowrap;
  98. line-height: 28rpx;
  99. }
  100. .text_27 {
  101. color: rgba(248, 226, 175, 1);
  102. font-size: 24rpx;
  103. white-space: nowrap;
  104. line-height: 45rpx;
  105. margin-left: -10rpx;
  106. }
  107. .course-item {
  108. padding: 30upx;
  109. /* background: #fff; */
  110. display: flex;
  111. align-items: center;
  112. }
  113. .course-item:last-child {
  114. margin-bottom: 0;
  115. }
  116. .course-item .b-cover {
  117. width: 307rpx;
  118. height: 171rpx;
  119. }
  120. .course-item .b-cover image {
  121. width: 100%;
  122. height: 100%;
  123. }
  124. .course-item .b-main {
  125. flex: 1;
  126. height: 170rpx;
  127. margin-left: 20upx;
  128. }
  129. .course-item .b-main .b-title {
  130. font-size: 30upx;
  131. color: #333;
  132. max-width: 530upx;
  133. display: inline-block;
  134. }
  135. .course-item .b-main .b-price {
  136. margin-top: 16upx;
  137. display: flex;
  138. align-items: center;
  139. }
  140. .course-item .b-main .b-price .s-payment {
  141. margin-right: 20upx;
  142. font-size: 36upx;
  143. font-weight: bold;
  144. color: #dd524d;
  145. }
  146. .course-item .b-main .b-price .s-payment.f-small {
  147. font-size: 28upx;
  148. }
  149. .course-item .b-main .b-price .s-vip-price {
  150. margin-right: 20upx;
  151. font-size: 26upx;
  152. color: #f0ad4e;
  153. }
  154. .course-item .b-main .b-price .s-vip-free {
  155. margin-right: 20upx;
  156. padding: 6upx 10upx;
  157. font-size: 24upx;
  158. color: #555;
  159. background: #f0ad4e;
  160. border-radius: 5upx;
  161. }
  162. .course-item .b-main .b-info {
  163. margin-top: 16upx;
  164. display: flex;
  165. align-items: center;
  166. justify-content: space-between;
  167. }
  168. .course-item .b-main .b-info .s-category {
  169. font-size: 26upx;
  170. color: #666;
  171. }
  172. .course-item .b-main .b-info .b-counter {
  173. display: flex;
  174. align-items: center;
  175. }
  176. .course-item .b-main .b-info .b-counter .s-like {
  177. font-size: 24upx;
  178. color: #999;
  179. }
  180. .course-item .b-main .b-info .b-counter .s-learn {
  181. margin-left: 30upx;
  182. font-size: 24upx;
  183. color: #999;
  184. }
  185. </style>