activityPage.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="activity">
  3. <statusBar :item="navBarData"></statusBar>
  4. <viewX-Case class="mid">
  5. <template #title>
  6. <view class="title">活动直播</view>
  7. </template>
  8. <template #lookMore>
  9. <view class="lookMore">
  10. 查看更多
  11. </view>
  12. </template>
  13. <template #activeBlock>
  14. <view class="activeData" v-for="i in 4" :key="i">
  15. <image src="../../static/activity/bg1.png" mode="aspectFill"></image>
  16. <view class="liveBroadcast">
  17. <view class="title">
  18. <view class="tag">类型</view>
  19. <text>直播活动标题标题标题标题标题标题标题</text>
  20. </view>
  21. <view class="operate">
  22. <view class="left">
  23. <image src="../../static/logo.png"></image>
  24. <view class="user">用户名</view>
  25. <view class="collection">收藏</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. </viewX-Case>
  32. <viewX-Case style="margin-top: 10px;">
  33. <template #title>
  34. <view class="title">活动推荐</view>
  35. </template>
  36. <template #lookMore>
  37. <view class="lookMore" @click="lookMore">查看更多</view>
  38. </template>
  39. <template #activeBlock>
  40. <!-- <activity-case v-for="i in 10" :key="i"></activity-case> -->
  41. <teaching-case v-for="i in 10" :item="actData" :key="i"></teaching-case>
  42. </template>
  43. </viewX-Case>
  44. <uni-fab ref="fab"
  45. :pattern="pattern"
  46. :horizontal="horizontal"
  47. :vertical="vertical"
  48. :direction="direction"
  49. @fabClick="fabClick" />
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. navBarData:{
  57. title:'活动', //导航栏标题
  58. btn:0 //是否显示返回按钮 0不显示 1 显示
  59. },
  60. actData:{
  61. btn:1
  62. },
  63. title: 'uni-fab',
  64. directionStr: '垂直',
  65. horizontal: 'right',
  66. vertical: 'bottom',
  67. direction: 'horizontal',
  68. pattern: {
  69. color: '#7A7E83',
  70. backgroundColor: '#fff',
  71. selectedColor: '#007AFF',
  72. buttonColor: '#007AFF',
  73. iconColor: '#fff'
  74. },
  75. };
  76. },
  77. methods:{
  78. lookMore(){
  79. uni.navigateTo({
  80. url:'/pages/activityList/activityList'
  81. })
  82. },
  83. fabClick(){
  84. // console.log(111);
  85. uni.navigateTo({
  86. url:'/pages/publish/publish'
  87. })
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. .activity{
  94. .mid{
  95. // margin:20px 0;
  96. .activeData{
  97. width: 460rpx;
  98. display: inline-block;
  99. margin-right: 20px;
  100. image{
  101. width: 100%;
  102. height: 120px;
  103. border-radius: 10px;
  104. margin-bottom: 10px;
  105. }
  106. .liveBroadcast{
  107. flex: 1;
  108. width: 460rpx;
  109. display: flex;
  110. flex-direction: column;
  111. align-content: flex-end ;
  112. .title{
  113. display: flex;
  114. margin-bottom: 5px;
  115. .tag{
  116. border: 1px #00b2b6 solid;
  117. font-size: 12px;
  118. display: flex;
  119. white-space: nowrap;
  120. justify-content: center;
  121. align-items: center;
  122. padding: 2px 4px;
  123. border-radius: 3px;
  124. margin-right: 10rpx;
  125. color: #00b2b6;
  126. }
  127. text{
  128. // display: -webkit-box;//对象作为弹性伸缩盒子模型显示
  129. // overflow: hidden;//溢出隐藏
  130. // -webkit-box-orient: vertical;//设置伸缩盒子对象的子元素的排列方式
  131. // -webkit-line-clamp: 2;//设置 块元素包含的文本行数
  132. overflow: hidden;
  133. text-overflow:ellipsis;
  134. white-space: nowrap;
  135. }
  136. }
  137. .operate{
  138. .left{
  139. image{
  140. float: left;
  141. width:30px;
  142. height:30px;
  143. border-radius: 50%;
  144. }
  145. .user{
  146. float: left;
  147. padding-top: 10px;
  148. padding-left: 10px;
  149. }
  150. .collection{
  151. float: right;
  152. padding-top: 10px;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. .activeData:nth-child(1){
  159. margin-left: 15px;
  160. }
  161. }
  162. .title{
  163. font-weight: bold;
  164. // color: #999999;
  165. }
  166. .lookMore{
  167. color: #999999;
  168. font-size: 14px;
  169. }
  170. }
  171. </style>