activityPage.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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">查看更多</view>
  38. </template>
  39. <template #activeBlock>
  40. <activity-case v-for="i in 10" :key="i"></activity-case>
  41. </template>
  42. </viewX-Case>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. navBarData:{
  50. title:'活动', //导航栏标题
  51. btn:0 //是否显示返回按钮 0不显示 1 显示
  52. }
  53. };
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. .activity{
  59. .mid{
  60. margin:20px 0;
  61. .activeData{
  62. width: 460rpx;
  63. display: inline-block;
  64. margin-right: 20px;
  65. image{
  66. width: 100%;
  67. height: 120px;
  68. border-radius: 10px;
  69. margin-bottom: 10px;
  70. }
  71. .liveBroadcast{
  72. flex: 1;
  73. width: 460rpx;
  74. display: flex;
  75. flex-direction: column;
  76. align-content: flex-end ;
  77. .title{
  78. display: flex;
  79. margin-bottom: 5px;
  80. .tag{
  81. border: 1px #00b2b6 solid;
  82. font-size: 12px;
  83. display: flex;
  84. white-space: nowrap;
  85. justify-content: center;
  86. align-items: center;
  87. padding: 2px 4px;
  88. border-radius: 3px;
  89. margin-right: 10rpx;
  90. color: #00b2b6;
  91. }
  92. text{
  93. // display: -webkit-box;//对象作为弹性伸缩盒子模型显示
  94. // overflow: hidden;//溢出隐藏
  95. // -webkit-box-orient: vertical;//设置伸缩盒子对象的子元素的排列方式
  96. // -webkit-line-clamp: 2;//设置 块元素包含的文本行数
  97. overflow: hidden;
  98. text-overflow:ellipsis;
  99. white-space: nowrap;
  100. }
  101. }
  102. .operate{
  103. .left{
  104. image{
  105. float: left;
  106. width:30px;
  107. height:30px;
  108. border-radius: 50%;
  109. }
  110. .user{
  111. float: left;
  112. padding-top: 10px;
  113. padding-left: 10px;
  114. }
  115. .collection{
  116. float: right;
  117. padding-top: 10px;
  118. }
  119. }
  120. }
  121. }
  122. }
  123. .activeData:nth-child(1){
  124. margin-left: 15px;
  125. }
  126. }
  127. .title{
  128. font-weight: bold;
  129. }
  130. .lookMore{
  131. color: #ccc;
  132. font-size: 14px;
  133. }
  134. }
  135. </style>