activityPage.vue 4.4 KB

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