teaching-case.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="teaching_case" @click="gotoTeDetail">
  3. <view class="img">
  4. <!-- <slot name="img"></slot> -->
  5. <image src="../../static/yym/Rectangle23.png" mode="aspectFill"></image>
  6. </view>
  7. <view class="right">
  8. <view class="title">
  9. <view class="tag">类型</view>
  10. <text v-if="!item.btn">这是教研标题这是教研标题这是教研标题</text>
  11. <text v-else>这是活动活动活动活动活动活动活动活动活动</text>
  12. </view>
  13. <view class="introduce">
  14. 查看详情查看详情查看详情查看详情查看详情查看详情查看详情查看详情查看详情查看详情
  15. </view>
  16. <view class="operate" v-if="!item.btn">
  17. <view class="left">
  18. <view class="opr" style="padding-right: 25rpx;">
  19. <uni-icons type="star" size="22"></uni-icons>
  20. <text>收藏</text>
  21. </view>
  22. <view class="opr">
  23. <uni-icons type="cloud-download" size="22"></uni-icons>
  24. <!-- <image src="../../static/yym/Vector (Stroke).png" style="width: 30rpx;height: 30rpx;" mode="aspectFill"></image> -->
  25. <text>订阅</text>
  26. </view>
  27. </view>
  28. <button class="btn" disableEventPropagation="true" @click.stop="join">立即参与</button>
  29. </view>
  30. <view class="operate" v-else>
  31. <view class="left">
  32. <view class="price">¥188</view>
  33. <view class="pernum">已报名123人</view>
  34. </view>
  35. <button class="btn" @click.stop="actApply">立即报名</button>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. name:"teaching-case",
  43. props:{
  44. item:{
  45. type:Object,
  46. default (){
  47. return{
  48. btn:0 //0教研列表 1活动列表
  49. }
  50. }
  51. }
  52. },
  53. data() {
  54. return {
  55. };
  56. },
  57. methods:{
  58. gotoTeDetail(){
  59. if(this.item.btn){
  60. uni.navigateTo({
  61. url:"/pages/activityDetail/activityDetail"
  62. })
  63. }else{
  64. uni.navigateTo({
  65. url:"/pages/teachingDetail/teachingDetail"
  66. })
  67. }
  68. },
  69. join(){
  70. uni.navigateTo({
  71. url:'/pages/jys/jys'
  72. })
  73. },
  74. actApply(){
  75. uni.navigateTo({
  76. url:'/pages/hd/hd'
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. .teaching_case{
  84. display: flex;
  85. justify-content: space-between;
  86. margin-bottom: 10px;
  87. background-color: #ffffff;
  88. padding: 20rpx 30rpx;
  89. // padding-bottom: 20rpx;
  90. .img{
  91. width: 180rpx;
  92. height: 180rpx;
  93. image{
  94. width: 100%;
  95. height:100%;
  96. }
  97. }
  98. .right{
  99. padding-left: 15px;
  100. flex: 1;
  101. // height: 300px;
  102. width: 100rpx;
  103. display: flex;
  104. flex-direction: column;
  105. align-content: flex-end ;
  106. // align-content: space-between;
  107. .title{
  108. display: flex;
  109. margin-bottom: 5px;
  110. .tag{
  111. border: 1px #00b2b6 solid;
  112. font-size: 12px;
  113. display: flex;
  114. white-space: nowrap;
  115. justify-content: center;
  116. align-items: center;
  117. padding: 2px 4px;
  118. border-radius: 3px;
  119. margin-right: 10rpx;
  120. color: #00b2b6;
  121. }
  122. text{
  123. font-weight: bold;
  124. overflow: hidden;
  125. text-overflow:ellipsis;
  126. white-space: nowrap;
  127. }
  128. }
  129. .introduce{
  130. font-size: 16px;
  131. color: #a7a7a7;
  132. // padding: 20rpx 0;
  133. overflow: hidden;
  134. text-overflow:ellipsis;
  135. white-space: nowrap;
  136. }
  137. .operate{
  138. display: flex;
  139. justify-content: space-between;
  140. align-items: flex-end;
  141. flex-grow: 1;
  142. .left{
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. // width: 200rpx;
  147. .opr{
  148. display: flex;
  149. align-items: center;
  150. text{
  151. padding-left: 10rpx;
  152. }
  153. }
  154. .pernum{
  155. color: #666666;
  156. font-size: 14px;
  157. }
  158. .price{
  159. font-size: 18px;
  160. font-weight: bold;
  161. color: #f8a551;
  162. padding-right: 10rpx;
  163. }
  164. }
  165. .btn{
  166. z-index: 5;
  167. font-size: 12px;
  168. background-color: #3081e8;
  169. color: #fff;
  170. border-radius: 30px;
  171. margin: 0;
  172. float: right;
  173. height: 28px;
  174. line-height: 28px;
  175. // margin-top: 10px;
  176. // padding: 0 15rpx;
  177. letter-spacing:1px;
  178. }
  179. }
  180. }
  181. }
  182. </style>