activityPage.vue 3.9 KB

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