You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.0 KiB

4 months ago
  1. <template>
  2. <view class="content padding">
  3. <view class="banner">
  4. <image src="@/static/images/homebanner.png" mode=""></image>
  5. </view>
  6. <view class="tabs">
  7. <up-tabs :list="tabArr" @click="tabClick" lineColor="#DE3A26"> </up-tabs>
  8. </view>
  9. <view class="tags">
  10. <view class="tag" v-for="(item,index) in tagArr" :key="index" :class="{active: currentTag==item.id}" @click="tagClick(item)">{{ item.name }}</view>
  11. </view>
  12. <view class="ul">
  13. <view class="li">
  14. <view class="flex-b">
  15. <view class="name towRowText">说要两行显示说要两行显示说要两行显示说要两行显示说要两行显示说要两行显示说要两行显示</view>
  16. <view class="btn" @click="goVote(item)">我要投票</view>
  17. </view>
  18. <view class="text">
  19. <text>发起人张三</text>
  20. <text>截止时间2024-04-01 19:30</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script setup>
  27. import { reactive, ref } from 'vue';
  28. const tabArr = reactive([
  29. { name: '投票列表', id: 1 },
  30. { name: '我的投票', id: 2 },
  31. ]);
  32. const tagArr = reactive([
  33. { name: '全部', id: 1 },
  34. { name: '进行中', id: 2 },
  35. { name: '已结束', id: 3 },
  36. ]);
  37. // tab切换
  38. function tabClick(item) {
  39. console.log('item', item);
  40. }
  41. // 类型筛选
  42. let currentTag = ref(1)
  43. function tagClick(item) {
  44. currentTag.value = item.id
  45. }
  46. function goVote(item) {
  47. console.log(item)
  48. uni.navigateTo({
  49. url: '/pages/subPage/ballots/vote/vote'
  50. })
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. image {
  55. display: block;
  56. width: 100%;
  57. height: 100%;
  58. }
  59. .content {
  60. .banner {
  61. width: 100%;
  62. height: 174rpx;
  63. }
  64. .tabs {
  65. padding: 30rpx 0 10rpx 0;
  66. border-bottom: 1px solid #EFEFEF;
  67. }
  68. .tags {
  69. width: 100%;
  70. height: 110rpx;
  71. display: flex;
  72. align-items: center;
  73. border-bottom: 1px solid #EFEFEF;
  74. .tag {
  75. height: 50rpx;
  76. background: #EFEFEF;
  77. border-radius: 25rpx;
  78. border: 1px solid #F4F4F4;
  79. line-height: 50rpx;
  80. padding: 0 14rpx;
  81. font-size: 24rpx;
  82. margin-right: 30rpx;
  83. &.active {
  84. color: $themC;
  85. background: rgba(222,58,38,0.1);
  86. border-radius: 25rpx;
  87. border: 1px solid #DE3A26;
  88. }
  89. }
  90. }
  91. .ul {
  92. width: 100%;
  93. .li {
  94. width: 100%;
  95. padding: 30rpx 0;
  96. border-bottom: 1px solid #EFEFEF;
  97. &:last-child {
  98. border: none;
  99. }
  100. .flex-b {
  101. .name {
  102. font-size: 32rpx;
  103. color: #333333;
  104. flex: 1;
  105. width: 0;
  106. padding-right: 30rpx;
  107. }
  108. .btn {
  109. width: 132rpx;
  110. height: 44rpx;
  111. background: #DE3A26;
  112. border-radius: 22rpx;
  113. font-size: 24rpx;
  114. color: #fff;
  115. text-align: center;
  116. line-height: 44rpx;
  117. &.boder {
  118. border: 1px solid #DE3A26;
  119. color: $themC;
  120. }
  121. &.hui {
  122. opacity: 0.4;
  123. }
  124. }
  125. }
  126. .text {
  127. padding-top: 14rpx;
  128. text {
  129. font-size: 24rpx;
  130. color: #9C9C9C;
  131. margin-right: 40rpx;
  132. }
  133. }
  134. }
  135. }
  136. }
  137. </style>