index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 three-font" >精选活动</view>
  11. </template>
  12. <template #lookMore>
  13. <view class="lookMore fz-font" @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 sBtn-font">
  19. 这里是活动标题这里是活动标题这里是活动标题这里是活动标题
  20. <!-- <slot name="ac这里是活动标题这里是活动标题这里是活动标题tiveTit"></slot> -->
  21. </view>
  22. <view class="numData">
  23. <view class="proNum bqZ-font">74 人报名</view>
  24. <view class="price num-font"> <text class="fz-font">¥</text>299</view>
  25. </view>
  26. <button class="btn sBtn-font" @click.stop="gotoHd">立即报名</button>
  27. </view>
  28. </template>
  29. </viewX-Case>
  30. <viewX-Case>
  31. <template #title>
  32. <view class="title three-font">教研室活动</view>
  33. </template>
  34. <template #lookMore>
  35. <view class="lookMore fz-font" @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. margin-bottom: 20rpx;
  94. align-items: center;
  95. background-color: #fff;
  96. justify-content: center;
  97. image{
  98. height: 130px;
  99. width: 700rpx;
  100. border-radius: 10px;
  101. }
  102. }
  103. .mid{
  104. margin: 10px 0;
  105. .activeData{
  106. width: 290rpx;
  107. display: inline-block;
  108. padding-right: 20rpx;
  109. image{
  110. width: 100%;
  111. height: 80px;
  112. border-radius: 10px;
  113. margin-bottom: 10rpx;
  114. }
  115. .activeTit{
  116. // width: 100rpx;
  117. // overflow:hidden;
  118. // text-overflow:ellipsis;
  119. font-weight: 600;
  120. // font-size: 30rpx;
  121. white-space:normal;
  122. /*隐藏溢出*/
  123. /*当文本溢出包含元素时显示省略符号来代表被修剪的文本*/
  124. /*规定段落中的文本不进行换行*/
  125. letter-spacing: 2rpx;
  126. display: -webkit-box;
  127. word-break: break-all;
  128. text-overflow: ellipsis;
  129. overflow: hidden;
  130. -webkit-box-orient: vertical;
  131. -webkit-line-clamp:2;/*设置 需要显示的行数*/
  132. }
  133. .numData{
  134. display: flex;
  135. justify-content: space-between;
  136. align-items: baseline;
  137. padding: 10rpx 0;
  138. .proNum{
  139. color: #999999;
  140. // font-size: 14px;
  141. }
  142. .price{
  143. color: #f68717;
  144. // font-size: 18px;
  145. }
  146. }
  147. .btn{
  148. // font-size: 12px;
  149. background-color: #3081e8;
  150. color: #fff;
  151. float: left;
  152. height: 28px;
  153. line-height: 28px;
  154. border-radius: 30px;
  155. margin: 15rpx 0;
  156. margin-bottom: 30rpx;
  157. // margin-top: 0px;
  158. }
  159. }
  160. .activeData:nth-child(1){
  161. margin-left: 15px;
  162. }
  163. }
  164. .title{
  165. font-weight: bold;
  166. }
  167. .lookMore{
  168. color: #666666;
  169. // font-size: 14px;
  170. }
  171. }
  172. </style>