my-set.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="content">
  3. <!-- 状态栏分段器区域 -->
  4. <view class="status">
  5. <view class="status_box" :class="{ active: currentIndex == index }" v-for="(item, index) in statusList" :key="index" @click="changeIndex(index)">
  6. {{ item }}
  7. </view>
  8. </view>
  9. <!-- 列表区域 -->
  10. <view class="list">
  11. <!-- 每一个活动区域 -->
  12. <view class="list_box" v-for="item in dataList" :key="item.id" @click="clickItem(item.id)">
  13. <view class="box_top">
  14. <img v-if="item.poster" class="img" :src="item.poster" mode="aspectFill" />
  15. <img v-else class="img" src="@/static/images/3.png" mode="aspectFill" />
  16. <view class="top_msg">
  17. <view class="msg_title">{{ item.theme }}</view>
  18. <view class="msg_name">{{ item.orgName }}</view>
  19. <view class="">{{ item.startTime }} 至 {{ item.endTime }}</view>
  20. </view>
  21. </view>
  22. <view class="box_bottom">
  23. <view class="bottom_left">
  24. 审批意见:
  25. <text v-if="item.passName == '待审核'" class="ing">审核中...</text>
  26. <text v-if="item.passName == '已通过'" class="pass">审核通过</text>
  27. <text v-if="item.passName == '已拒绝'" class="reject">信息违规,请重新提交。</text>
  28. </view>
  29. <view v-if="item.passName == '待审核'" class="bottom_right ing_btn">审核中...</view>
  30. <view v-if="item.passName == '已通过'" class="bottom_right pass_btn">审批通过</view>
  31. <view v-if="item.passName == '已拒绝'" class="bottom_right reject_btn">驳回</view>
  32. </view>
  33. </view>
  34. <!-- 没有数据时展示的页面 -->
  35. <noData v-if="!dataList.length"></noData>
  36. </view>
  37. </view>
  38. </template>
  39. <script setup>
  40. import { onReachBottom } from '@dcloudio/uni-app'
  41. import { ref, onMounted } from 'vue'
  42. import { getMyActivityPages } from '@/api/index.js'
  43. // 状态栏数组
  44. const statusList = ['全部', '审核中', '审核通过', '驳回']
  45. // 状态栏当前索引
  46. const currentIndex = ref(0)
  47. // 当前页
  48. const currentPage = ref(1)
  49. // 每页多少条
  50. const pageCount = ref(6)
  51. // 总条数
  52. const total = ref(0)
  53. // 列表数据
  54. const dataList = ref([])
  55. onMounted(() => {
  56. // 获取我发起的活动分页数据
  57. getData()
  58. })
  59. // 页面触底时触发的回调
  60. onReachBottom(() => {
  61. if (total.value > dataList.value.length) {
  62. currentPage.value++
  63. getData()
  64. } else {
  65. uni.showToast({
  66. title: '没有更多数据了~~',
  67. icon: 'none'
  68. })
  69. }
  70. })
  71. // 获取我发起的活动分页数据
  72. const getData = async () => {
  73. let data = {
  74. currentPage: currentPage.value,
  75. pageCount: pageCount.value,
  76. isPass: currentIndex.value
  77. }
  78. const res = await getMyActivityPages(data)
  79. // console.log(res)
  80. dataList.value = [...dataList.value, ...res.data.list]
  81. total.value = res.data.totalCount
  82. }
  83. // 状态栏切换时的回调
  84. const changeIndex = (e) => {
  85. if (currentIndex.value != e) {
  86. currentIndex.value = e
  87. currentPage.value = 1
  88. dataList.value = []
  89. getData()
  90. }
  91. }
  92. // 点击每一个活动的回调
  93. const clickItem = (id) => {
  94. uni.navigateTo({
  95. url: `/pages/act_detail/act_detail?id=${id}`
  96. })
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .content {
  101. .status {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-around;
  105. margin-top: 20rpx;
  106. width: 712rpx;
  107. height: 90rpx;
  108. font-size: 28rpx;
  109. border-radius: 8rpx;
  110. background-color: #f2f7ff;
  111. .status_box {
  112. display: flex;
  113. align-items: center;
  114. justify-content: center;
  115. width: 211rpx;
  116. height: 71rpx;
  117. border-radius: 8rpx;
  118. }
  119. .active {
  120. font-size: 30rpx;
  121. color: #0061ff;
  122. border: 2rpx solid #0061ff;
  123. background-color: rgba(0, 97, 255, 0.1);
  124. }
  125. }
  126. .list {
  127. margin-top: 20rpx;
  128. .list_box {
  129. display: flex;
  130. flex-direction: column;
  131. justify-content: space-between;
  132. padding: 30rpx 25rpx;
  133. margin-bottom: 20rpx;
  134. width: 714rpx;
  135. height: 344rpx;
  136. border-radius: 28rpx;
  137. box-shadow: 0 4rpx 35rpx #d3d3d3;
  138. background-color: #fff;
  139. .box_top {
  140. display: flex;
  141. justify-content: space-between;
  142. padding-bottom: 40rpx;
  143. border-bottom: 2rpx solid #e5e5e5;
  144. .img {
  145. margin-right: 24rpx;
  146. width: 249rpx;
  147. height: 168rpx;
  148. border-radius: 8rpx;
  149. }
  150. .top_msg {
  151. display: flex;
  152. flex-direction: column;
  153. justify-content: space-between;
  154. flex: 1;
  155. font-size: 24rpx;
  156. color: #808080;
  157. overflow: hidden;
  158. .msg_title {
  159. font-size: 28rpx;
  160. font-weight: bold;
  161. color: #000;
  162. display: -webkit-box;
  163. -webkit-box-orient: vertical;
  164. -webkit-line-clamp: 2;
  165. overflow: hidden;
  166. }
  167. .msg_name {
  168. white-space: nowrap;
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. }
  172. }
  173. }
  174. .box_bottom {
  175. display: flex;
  176. justify-content: space-between;
  177. align-items: center;
  178. margin-top: 18rpx;
  179. height: 104rpx;
  180. font-size: 28rpx;
  181. .bottom_left {
  182. display: flex;
  183. flex: 1;
  184. padding-right: 20rpx;
  185. white-space: nowrap;
  186. overflow: hidden;
  187. .pass {
  188. color: #007aff;
  189. }
  190. .ing {
  191. color: #ff5733;
  192. }
  193. .reject {
  194. color: #d43030;
  195. white-space: nowrap;
  196. text-overflow: ellipsis;
  197. overflow: hidden;
  198. }
  199. }
  200. .bottom_right {
  201. display: flex;
  202. justify-content: center;
  203. align-items: center;
  204. width: 157rpx;
  205. height: 55rpx;
  206. color: #fff;
  207. font-size: 28rpx;
  208. border-radius: 70rpx 40rpx 0 70rpx;
  209. }
  210. .pass_btn {
  211. background: linear-gradient(90deg, #366fff 0%, #5da0fc 100%);
  212. }
  213. .ing_btn {
  214. background: linear-gradient(90deg, #ff7045 0%, #f7a172 100%);
  215. }
  216. .reject_btn {
  217. background: linear-gradient(90deg, #d43030 0%, #f56c6c 100%);
  218. }
  219. }
  220. }
  221. }
  222. }
  223. </style>