teaching-case.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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"
  28. style="width: 28rpx;height: 26rpx;" 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"
  35. style="width: 22rpx;height: 26rpx;" 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. const value = uni.getStorageSync('login');
  90. if (value==0) {
  91. uni.navigateTo({
  92. url: "/pages/login/login"
  93. })
  94. } else {
  95. uni.navigateTo({
  96. url: "/pages/activityDetail/activityDetail"
  97. })
  98. }
  99. } else {
  100. const value = uni.getStorageSync('login');
  101. if (value==0) {
  102. uni.navigateTo({
  103. url: "/pages/login/login"
  104. })
  105. } else {
  106. uni.navigateTo({
  107. url: "/pages/teachingDetail/teachingDetail"
  108. })
  109. }
  110. }
  111. },
  112. join() {
  113. const value = uni.getStorageSync('login');
  114. if (value==0) {
  115. uni.navigateTo({
  116. url: "/pages/login/login"
  117. })
  118. return 1
  119. } else {
  120. uni.navigateTo({
  121. url: '/pages/jys/jys'
  122. })
  123. }
  124. },
  125. actApply() {
  126. const value = uni.getStorageSync('login');
  127. if (value==0) {
  128. uni.navigateTo({
  129. url: "/pages/login/login"
  130. })
  131. return 1
  132. } else {
  133. uni.navigateTo({
  134. url: '/pages/hd/hd'
  135. })
  136. }
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss">
  142. .teaching_case {
  143. display: flex;
  144. justify-content: space-between;
  145. // margin-bottom: 10px;
  146. background-color: #ffffff;
  147. padding: 20rpx 30rpx;
  148. // padding-bottom: 50rpx;
  149. .img {
  150. width: 160rpx;
  151. height: 160rpx;
  152. image {
  153. width: 100%;
  154. height: 100%;
  155. border-radius: 10rpx;
  156. }
  157. }
  158. .right {
  159. padding-left: 20rpx;
  160. flex: 1;
  161. // height: 300px;
  162. width: 100rpx;
  163. display: flex;
  164. flex-direction: column;
  165. // align-content: flex-end ;
  166. justify-content: space-between;
  167. // align-content: space-between;
  168. .title {
  169. display: flex;
  170. justify-content: flex-start;
  171. align-items: center;
  172. margin-bottom: 15rpx;
  173. // margin-bottom: 10rpx;
  174. .tag {
  175. border: 1px #00b2b6 solid;
  176. flex-shrink: 0;
  177. letter-spacing: 2rpx;
  178. width: 64rpx;
  179. height: 32rpx;
  180. display: flex;
  181. white-space: nowrap;
  182. justify-content: center;
  183. align-items: center;
  184. border-radius: 4rpx;
  185. margin-right: 10rpx;
  186. color: #00b2b6;
  187. line-height: 32rpx;
  188. // border: 1px #00b2b6 solid;
  189. // font-size: 20rpx;
  190. // width: 94rpx;
  191. // display: flex;
  192. // height: 36rpx;
  193. // white-space: nowrap;
  194. // justify-content: center;
  195. // align-items: center;
  196. // // padding: 4px 12px 4px 12px;
  197. // border-radius: 5rpx;
  198. // margin-right: 10rpx;
  199. // color: #00b2b6;
  200. }
  201. text {
  202. font-weight: bold;
  203. overflow: hidden;
  204. text-overflow: ellipsis;
  205. white-space: nowrap;
  206. }
  207. }
  208. .introduce {
  209. // font-size: 28rpx;
  210. color: #a7a7a7;
  211. // padding: 20rpx 0;
  212. // width: 560rpx;
  213. height: 40rpx;
  214. overflow: hidden;
  215. text-overflow: ellipsis;
  216. white-space: nowrap;
  217. }
  218. .operate {
  219. display: flex;
  220. justify-content: space-between;
  221. // align-items: baseline;
  222. align-items: flex-end;
  223. .left {
  224. display: flex;
  225. // justify-content: space-between;
  226. // align-items: center;
  227. align-items: baseline;
  228. // width: 200rpx;
  229. .opr {
  230. display: flex;
  231. align-items: center;
  232. .icon {
  233. width: 32rpx;
  234. height: 32rpx;
  235. display: flex;
  236. justify-content: center;
  237. align-items: center;
  238. }
  239. text {
  240. padding-left: 3rpx;
  241. color: #666666;
  242. }
  243. }
  244. .pernum {
  245. color: #666666;
  246. // font-size: 30rpx;
  247. }
  248. .price {
  249. // font-size: 40rpx;
  250. font-weight: bold;
  251. color: #f8a551;
  252. padding-right: 10rpx;
  253. }
  254. }
  255. .btn {
  256. z-index: 5;
  257. border: none;
  258. padding: 0;
  259. text-align: center;
  260. // padding: 8px, 24px, 8px, 24px;
  261. background-color: rgba(48, 129, 232, 1);
  262. color: #fff;
  263. border-radius: 100rpx;
  264. float: right;
  265. width: 144rpx;
  266. height: 48rpx;
  267. line-height: 48rpx;
  268. letter-spacing: 1px;
  269. }
  270. }
  271. }
  272. }
  273. </style>