index.vue 3.2 KB

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