index.vue 3.5 KB

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