index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <script setup>
  2. const router = useRouter();
  3. function cellClick(xm_id) {
  4. router.push({ path: "/sanZhongYiDa/projectApply/detail", query: { xm_id } });
  5. }
  6. const listMyApplyFor = ref([]);
  7. const loadingMyApplyFor = ref(false);
  8. const finishedMyApplyFor = ref(false);
  9. let pageMyApplyFor = 1;
  10. const param = $ref({
  11. keyword: "",
  12. });
  13. function onLoadMyApplyFor() {
  14. loadingMyApplyFor.value = true;
  15. request({
  16. url: "/jdbg/xmlxsb_xmsq/index",
  17. data: {
  18. page: pageMyApplyFor,
  19. limit: 20,
  20. xm_status: 5,
  21. ...param,
  22. },
  23. }).then((res) => {
  24. const data = res.data;
  25. listMyApplyFor.value = [...listMyApplyFor.value, ...data.page_data];
  26. finishedMyApplyFor.value = data.total_page === pageMyApplyFor;
  27. pageMyApplyFor++;
  28. loadingMyApplyFor.value = false;
  29. });
  30. }
  31. function onClickSearch() {
  32. reGetList();
  33. }
  34. function reGetList() {
  35. pageMyApplyFor = 1;
  36. listMyApplyFor.value = [];
  37. finishedMyApplyFor.value = false;
  38. onLoadMyApplyFor();
  39. }
  40. </script>
  41. <template>
  42. <van-search
  43. v-model="param.keyword"
  44. :clearable="false"
  45. show-action
  46. placeholder="请输入搜索关键词"
  47. @search="onClickSearch"
  48. >
  49. <template #action>
  50. <div @click="onClickSearch">搜索</div>
  51. </template>
  52. </van-search>
  53. <van-list
  54. v-model:loading="loadingMyApplyFor"
  55. :finished="finishedMyApplyFor"
  56. finished-text="没有更多了"
  57. @load="onLoadMyApplyFor"
  58. >
  59. <van-cell
  60. v-for="(item, index) in listMyApplyFor"
  61. :key="item"
  62. :title="`${index + 1}.\u00A0\u00A0${item.xm_name}`"
  63. @click="cellClick(item.xm_id)"
  64. />
  65. </van-list>
  66. </template>