activityPage.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="activity">
  3. <statusBar :item="navBarData"></statusBar>
  4. <viewX-Case class="mid">
  5. <template #title>
  6. <view class="title three-font">活动直播</view>
  7. </template>
  8. <template #lookMore>
  9. <view class="lookMore fz-font">
  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 bqZ-font">类型</view>
  19. <text three-font>直播活动标题标题标题标题标题标题标题</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 fwb-font">用户名</view>
  27. </view>
  28. <view class="collection">
  29. <uni-icons type="star" size="20"></uni-icons>
  30. <text class="fz-font">收藏</text>
  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 three-font">活动推荐</view>
  40. </template>
  41. <template #lookMore>
  42. <view class="lookMore fz-font" @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. width: 64rpx;
  124. height: 38rpx;
  125. display: flex;
  126. white-space: nowrap;
  127. justify-content: center;
  128. align-items: center;
  129. // padding: 2px 4px;
  130. padding: 1rpx 4rpx;
  131. border-radius: 3px;
  132. margin-right: 10rpx;
  133. color: #00b2b6;
  134. }
  135. text{
  136. // display: -webkit-box;//对象作为弹性伸缩盒子模型显示
  137. // overflow: hidden;//溢出隐藏
  138. // -webkit-box-orient: vertical;//设置伸缩盒子对象的子元素的排列方式
  139. // -webkit-line-clamp: 2;//设置 块元素包含的文本行数
  140. overflow: hidden;
  141. text-overflow:ellipsis;
  142. white-space: nowrap;
  143. }
  144. }
  145. .operate{
  146. display: flex;
  147. justify-content: space-between;
  148. align-items: center;
  149. padding: 20rpx 0;
  150. color: #666666;
  151. // margin-bottom: 20rpx;
  152. // padding-bottom: 20rpx;
  153. .left{
  154. display: flex;
  155. // justify-content: flex-start;
  156. align-items: center;
  157. .img{
  158. width:30px;
  159. height:30px;
  160. // padding-right: 20rpx;
  161. margin-right: 20rpx;
  162. image{
  163. width: 100%;
  164. height: 100%;
  165. border-radius: 50%;
  166. }
  167. }
  168. .user{
  169. // font-size: 16px;
  170. // padding-left: 15rpx;
  171. }
  172. }
  173. .collection{
  174. // float: right;
  175. // font-size: 14px;
  176. // padding-top: 10px;
  177. }
  178. }
  179. }
  180. }
  181. .activeData:nth-child(1){
  182. margin-left: 15px;
  183. }
  184. }
  185. .title{
  186. font-weight: bold;
  187. // color: #999999;
  188. }
  189. .lookMore{
  190. color: #666666;
  191. // font-size: 14px;
  192. }
  193. }
  194. </style>