teaching-case.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="teaching_case" @click="gotoTeDetail">
  3. <view class="img cell-img">
  4. <!-- <slot name="img"></slot> -->
  5. <image :src="classList.img" v-if="!item.btn" mode="aspectFill"></image>
  6. <image :src="activeList.img" v-else mode="aspectFill"></image>
  7. </view>
  8. <view class="right">
  9. <view class="">
  10. <view class="title">
  11. <view v-if="!item.btn" class="tag bqZ-font">类型</view>
  12. <view v-else class="tag bqZ-font">类型</view>
  13. <text class="btn-font" v-if="!item.btn" style="">{{ classList.className }}</text>
  14. <text class="three-font" v-else>{{ activeList.className }}</text>
  15. </view>
  16. <view v-if="!item.btn" class="introduce fwb-font">
  17. {{ classList.intro }}
  18. </view>
  19. <view v-else class="introduce fwb-font">
  20. {{ activeList.intro }}
  21. </view>
  22. </view>
  23. <view class="operate" v-if="!item.btn">
  24. <view class="left">
  25. <view class="opr" style="padding-right: 25rpx;">
  26. <view class="icon">
  27. <image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke).png" style="width: 28rpx;height: 26rpx;"
  28. mode="aspectFill"></image>
  29. </view>
  30. <text class="fz-font">收藏</text>
  31. </view>
  32. <view class="opr">
  33. <view class="icon">
  34. <image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png" style="width: 22rpx;height: 26rpx;"
  35. mode="aspectFill"></image>
  36. </view>
  37. <text class="fz-font">订阅</text>
  38. </view>
  39. </view>
  40. <view class="">
  41. <button class="btn sBtn-font" disableEventPropagation="true" @click.stop="join">立即参与</button>
  42. </view>
  43. </view>
  44. <view class="operate" v-else>
  45. <view class="left">
  46. <view class="price num-font"><text class="three-font">¥</text> 188</view>
  47. <view class="pernum fz-font">已报名{{ activeList.count }}人</view>
  48. </view>
  49. <view class="">
  50. <button class="btn sBtn-font" @click.stop="actApply">立即报名</button>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- <view class="" style="height: 50rpx;width: 100%;background-color: #ffffff;"></view> -->
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. name: "teaching-case",
  60. props: {
  61. item: {
  62. type: Object,
  63. default () {
  64. return {
  65. btn: 0 //0教研列表 1活动列表
  66. }
  67. }
  68. },
  69. classList: {
  70. type: Object,
  71. default () {
  72. return []
  73. }
  74. },
  75. activeList: {
  76. type: Object,
  77. default () {
  78. return []
  79. }
  80. }
  81. },
  82. data() {
  83. return {
  84. };
  85. },
  86. methods: {
  87. gotoTeDetail() {
  88. if (this.item.btn) {
  89. uni.navigateTo({
  90. url: "/pages/activityDetail/activityDetail"
  91. })
  92. } else {
  93. uni.navigateTo({
  94. url: "/pages/teachingDetail/teachingDetail"
  95. })
  96. }
  97. },
  98. join() {
  99. uni.navigateTo({
  100. url: '/pages/jys/jys'
  101. })
  102. },
  103. actApply() {
  104. uni.navigateTo({
  105. url: '/pages/hd/hd'
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss">
  112. .teaching_case {
  113. display: flex;
  114. justify-content: space-between;
  115. // margin-bottom: 10px;
  116. background-color: #ffffff;
  117. padding: 20rpx 30rpx;
  118. // padding-bottom: 50rpx;
  119. .img {
  120. width: 160rpx;
  121. height: 160rpx;
  122. image {
  123. width: 100%;
  124. height: 100%;
  125. border-radius: 10rpx;
  126. }
  127. }
  128. .right {
  129. padding-left: 20rpx;
  130. flex: 1;
  131. // height: 300px;
  132. width: 100rpx;
  133. display: flex;
  134. flex-direction: column;
  135. // align-content: flex-end ;
  136. justify-content: space-between;
  137. // align-content: space-between;
  138. .title {
  139. display: flex;
  140. justify-content: flex-start;
  141. align-items: center;
  142. margin-bottom: 15rpx;
  143. // margin-bottom: 10rpx;
  144. .tag {
  145. border: 1px #00b2b6 solid;
  146. flex-shrink: 0;
  147. letter-spacing: 2rpx;
  148. width: 64rpx;
  149. height: 32rpx;
  150. display: flex;
  151. white-space: nowrap;
  152. justify-content: center;
  153. align-items: center;
  154. border-radius: 4rpx;
  155. margin-right: 10rpx;
  156. color: #00b2b6;
  157. line-height: 32rpx;
  158. // border: 1px #00b2b6 solid;
  159. // font-size: 20rpx;
  160. // width: 94rpx;
  161. // display: flex;
  162. // height: 36rpx;
  163. // white-space: nowrap;
  164. // justify-content: center;
  165. // align-items: center;
  166. // // padding: 4px 12px 4px 12px;
  167. // border-radius: 5rpx;
  168. // margin-right: 10rpx;
  169. // color: #00b2b6;
  170. }
  171. text {
  172. font-weight: bold;
  173. overflow: hidden;
  174. text-overflow: ellipsis;
  175. white-space: nowrap;
  176. }
  177. }
  178. .introduce {
  179. // font-size: 28rpx;
  180. color: #a7a7a7;
  181. // padding: 20rpx 0;
  182. // width: 560rpx;
  183. height: 40rpx;
  184. overflow: hidden;
  185. text-overflow: ellipsis;
  186. white-space: nowrap;
  187. }
  188. .operate {
  189. display: flex;
  190. justify-content: space-between;
  191. // align-items: baseline;
  192. align-items: flex-end;
  193. .left {
  194. display: flex;
  195. // justify-content: space-between;
  196. // align-items: center;
  197. align-items: baseline;
  198. // width: 200rpx;
  199. .opr {
  200. display: flex;
  201. align-items: center;
  202. .icon {
  203. width: 32rpx;
  204. height: 32rpx;
  205. display: flex;
  206. justify-content: center;
  207. align-items: center;
  208. }
  209. text {
  210. padding-left: 3rpx;
  211. color: #666666;
  212. }
  213. }
  214. .pernum {
  215. color: #666666;
  216. // font-size: 30rpx;
  217. }
  218. .price {
  219. // font-size: 40rpx;
  220. font-weight: bold;
  221. color: #f8a551;
  222. padding-right: 10rpx;
  223. }
  224. }
  225. .btn {
  226. z-index: 5;
  227. border: none;
  228. padding: 0;
  229. text-align: center;
  230. // padding: 8px, 24px, 8px, 24px;
  231. background-color: rgba(48, 129, 232, 1);
  232. color: #fff;
  233. border-radius: 100rpx;
  234. float: right;
  235. width: 144rpx;
  236. height: 48rpx;
  237. line-height: 48rpx;
  238. letter-spacing: 1px;
  239. }
  240. }
  241. }
  242. }
  243. </style>