index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="content">
  3. <statusBar :item="navBarData"></statusBar>
  4. <view class="top">
  5. <!-- <image src="../../static/logo.png" mode="aspectFill"></image> -->
  6. <image src="../../static/yym/Rectangle25.png" mode="aspectFill"></image>
  7. </view>
  8. <viewX-Case class="mid">
  9. <template #title>
  10. <view class="title">精选活动</view>
  11. </template>
  12. <template #lookMore>
  13. <view class="lookMore" @click="gotoActivity">查看更多</view>
  14. </template>
  15. <template #activeBlock>
  16. <view class="activeData" @click="gotoActivityDetail" v-for="i in 5" :key="i">
  17. <image src="../../static/resource/jqr.png" mode="aspectFill"></image>
  18. <view class="activeTit">
  19. 查看更多查看更多查看更多查看更多查看更多查看更多查看更多看更多查看更多查看更多查看更多查看更多看更多查看更多查看更多查看更多查看更多
  20. <!-- <slot name="activeTit"></slot> -->
  21. </view>
  22. <view class="numData">
  23. <view class="proNum">74 人报名</view>
  24. <view class="price">¥299</view>
  25. </view>
  26. <button class="btn" @click.stop="gotoHd">立即报名</button>
  27. </view>
  28. </template>
  29. </viewX-Case>
  30. <viewX-Case>
  31. <template #title>
  32. <view class="title">教研室活动</view>
  33. </template>
  34. <template #lookMore>
  35. <view class="lookMore" @click="teachmore">查看更多</view>
  36. </template>
  37. <template #teaching>
  38. <teaching-case v-for="i in 10" :key="i"></teaching-case>
  39. </template>
  40. </viewX-Case>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. title: 'Hello',
  48. navBarData:{
  49. title:'首页', //导航栏标题
  50. btn:0 //是否显示返回按钮 0不显示 1 显示
  51. }
  52. }
  53. },
  54. onLoad() {
  55. },
  56. methods: {
  57. teachmore(){
  58. uni.navigateTo({
  59. url:"/pages/teachingList/teachingList"
  60. })
  61. },
  62. gotoTeDetail(){
  63. uni.navigateTo({
  64. url:"/pages/teachingDetail/teachingDetail"
  65. })
  66. },
  67. gotoActivity(){
  68. uni.navigateTo({
  69. url:"/pages/activityList/activityList"
  70. })
  71. },
  72. gotoActivityDetail(){
  73. uni.navigateTo({
  74. url:'/pages/activityDetail/activityDetail'
  75. })
  76. },
  77. gotoHd(){
  78. uni.navigateTo({
  79. url:'/pages/hd/hd'
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .content {
  87. // background-color: ;
  88. // background-color: #f0f2f5;
  89. .top{
  90. width: 750rpx;
  91. height: 150px;
  92. display: flex;
  93. align-items: center;
  94. background-color: #fff;
  95. justify-content: center;
  96. image{
  97. height: 130px;
  98. width: 700rpx;
  99. border-radius: 10px;
  100. }
  101. }
  102. .mid{
  103. margin: 10px 0;
  104. .activeData{
  105. width: 290rpx;
  106. display: inline-block;
  107. padding-right: 20rpx;
  108. image{
  109. width: 100%;
  110. height: 80px;
  111. border-radius: 10px;
  112. margin-bottom: 10rpx;
  113. }
  114. .activeTit{
  115. // width: 100rpx;
  116. // overflow:hidden;
  117. // text-overflow:ellipsis;
  118. font-weight: 600;
  119. white-space:normal;
  120. /*隐藏溢出*/
  121. /*当文本溢出包含元素时显示省略符号来代表被修剪的文本*/
  122. /*规定段落中的文本不进行换行*/
  123. display: -webkit-box;
  124. word-break: break-all;
  125. text-overflow: ellipsis;
  126. overflow: hidden;
  127. -webkit-box-orient: vertical;
  128. -webkit-line-clamp:2;/*设置 需要显示的行数*/
  129. }
  130. .numData{
  131. display: flex;
  132. justify-content: space-between;
  133. align-items: flex-end;
  134. padding: 10rpx 0;
  135. .proNum{
  136. color: #999999;
  137. font-size: 14px;
  138. }
  139. .price{
  140. color: #f68717;
  141. font-size: 18px;
  142. }
  143. }
  144. .btn{
  145. font-size: 12px;
  146. background-color: #3081e8;
  147. color: #fff;
  148. float: left;
  149. height: 28px;
  150. line-height: 28px;
  151. border-radius: 30px;
  152. margin: 15px 0;
  153. margin-top: 10px;
  154. }
  155. }
  156. .activeData:nth-child(1){
  157. margin-left: 15px;
  158. }
  159. }
  160. .title{
  161. font-weight: bold;
  162. }
  163. .lookMore{
  164. color: #ccc;
  165. font-size: 14px;
  166. }
  167. }
  168. </style>