placeActivityList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <van-nav-bar
  3. fixed
  4. title="场所活动"
  5. left-text=""
  6. right-text="上报"
  7. left-arrow
  8. @click-left="onClickLeft"
  9. @click-right="onClickRight"
  10. />
  11. <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" />
  12. <van-list
  13. v-model:loading="loading"
  14. :finished="finished"
  15. finished-text="没有更多了"
  16. @load="onLoad"
  17. >
  18. <!-- tab切换 -->
  19. <div class="nav_tab">
  20. <div class="tab active">未审核</div>
  21. <div class="tab">已审核</div>
  22. </div>
  23. <van-swipe-cell v-for="item in list" :key="item">
  24. <div class="list_item">
  25. <div class="item-left">
  26. <p style="color: #c4c4c4">{{ item.activityTime }}</p>
  27. <p style="color: red">待审核</p>
  28. </div>
  29. <van-cell is-link to="placeActivityInfo">
  30. <template #title>
  31. {{ item.portname }}申请于{{ item.place }}举办{{ item.activity }}活动
  32. </template>
  33. <template #label>
  34. {{ item.activityPlace + " " + item.address }}
  35. </template>
  36. </van-cell>
  37. </div>
  38. <template #right>
  39. <van-button square type="danger" text="删除" class="button" />
  40. <van-button square type="primary" text="修改" class="button" />
  41. </template>
  42. </van-swipe-cell>
  43. </van-list>
  44. </template>
  45. <script>
  46. import { reactive, ref } from "vue";
  47. import router from "@/router";
  48. export default {
  49. name: "placeActivityList",
  50. setup() {
  51. // 返回
  52. const onClickLeft = () => {
  53. history.back();
  54. };
  55. // 上报
  56. const onClickRight = () => {
  57. router.push("placeActivity");
  58. };
  59. // 列表
  60. const list = reactive([
  61. {
  62. activity: "测试",
  63. place: "基督教",
  64. activityTime: "2023-03-28 13:00",
  65. countPerson: "100",
  66. list: "11,22,33",
  67. portname: "张三",
  68. area: "",
  69. activityPlace: "盐都区/张庄街道",
  70. address: "1111",
  71. money: "",
  72. activityName: "李四",
  73. tel: "",
  74. file: "",
  75. into: "1111",
  76. },
  77. ]);
  78. const loading = ref(false);
  79. const finished = ref(false);
  80. const onLoad = () => {
  81. // 异步更新数据
  82. // setTimeout 仅做示例,真实场景中一般为 ajax 请求
  83. // setTimeout(() => {
  84. // for (let i = 0; i < 10; i++) {
  85. // list.value.push(list.value.length + 1);
  86. // }
  87. // 加载状态结束
  88. loading.value = false;
  89. // 数据全部加载完成
  90. // if (list.value.length >= 10) {
  91. // finished.value = true;
  92. // }
  93. // }, 1000);
  94. };
  95. // 搜索
  96. let value = ref("");
  97. return {
  98. onClickLeft,
  99. list,
  100. onLoad,
  101. loading,
  102. finished,
  103. value,
  104. onClickRight,
  105. };
  106. },
  107. };
  108. </script>
  109. <style>
  110. body {
  111. background: #f5f5f5;
  112. }
  113. .nav_tab {
  114. width: 100vw;
  115. display: flex;
  116. text-align: center;
  117. background: #fff;
  118. margin: 10px 0;
  119. }
  120. .tab {
  121. flex: 1;
  122. line-height: 40px;
  123. font-size: 14px;
  124. }
  125. .active {
  126. background: #36a7f3;
  127. color: #fff;
  128. }
  129. .van-list {
  130. height: 80%;
  131. margin-top: 5px;
  132. }
  133. .list_item {
  134. display: flex;
  135. background: #fff;
  136. }
  137. .item-left {
  138. text-align: center;
  139. width: 30%;
  140. font-size: 12px;
  141. border-right: 1px solid #eee;
  142. }
  143. .button {
  144. height: 100%;
  145. }
  146. </style>