index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <app-view class="credit-statement">
  3. <template #header>
  4. <app-navbar title="资金流水">
  5. <template #right>
  6. <Button round @click="routerTo('bank-hisstatement')">更多</Button>
  7. </template>
  8. </app-navbar>
  9. </template>
  10. <app-pull-refresh class="credit-statement__container" v-model:pageIndex="pageIndex" :page-count="pageCount"
  11. :updateList="dataList" @refresh="onRefresh" @updated="onRefreshUpdated">
  12. <template #header>
  13. <ul class="list list-row" v-if="showHeader">
  14. <li class="list-column">
  15. <span>时间</span>
  16. </li>
  17. <li class="list-column">
  18. <span>操作类型</span>
  19. </li>
  20. <li class="list-column">
  21. <span>金额</span>
  22. </li>
  23. </ul>
  24. </template>
  25. <template #default="{ item }">
  26. <ul class="list list-row">
  27. <li class="list-column">
  28. <span>{{ formatDate(item.createtime, 'YYYY-MM-DD') }}</span>
  29. <span>{{ formatDate(item.createtime, 'HH:mm:ss') }}</span>
  30. </li>
  31. <li class="list-column">{{ getAccountBusinessCodeName(item.businesscode) }}</li>
  32. <li class="list-column">{{ item.amount }}</li>
  33. </ul>
  34. </template>
  35. </app-pull-refresh>
  36. </app-view>
  37. </template>
  38. <script lang="ts" setup>
  39. import { shallowRef } from 'vue'
  40. import { formatDate } from '@/filters'
  41. import { getAccountBusinessCodeName } from '@/constants/bank'
  42. import { useAmountStatementList } from '@/business/bank'
  43. import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
  44. import { useNavigation } from '@/hooks/navigation'
  45. import { Button } from 'vant'
  46. const { dataList, pageIndex, pageCount, getAccouuntInOutApplyList } = useAmountStatementList()
  47. const showHeader = shallowRef(false)
  48. const { routerTo } = useNavigation()
  49. const onRefresh = (callback: () => void) => {
  50. getAccouuntInOutApplyList().finally(() => callback())
  51. }
  52. const onRefreshUpdated = (data: Model.UserScoreLogRsp[]) => {
  53. showHeader.value = data.length > 0
  54. }
  55. </script>
  56. <style lang="less">
  57. .credit-statement {
  58. &__container {
  59. height: 100%;
  60. overflow-y: auto;
  61. .list {
  62. display: flex;
  63. align-items: center;
  64. background-color: #fff;
  65. &-row {
  66. font-size: .32rem;
  67. border-bottom: 1px solid #eee;
  68. padding: .12rem .32rem;
  69. }
  70. &-column {
  71. flex: 1;
  72. display: flex;
  73. flex-direction: column;
  74. text-align: center;
  75. &:first-child {
  76. text-align: left;
  77. }
  78. &:last-child {
  79. text-align: right;
  80. }
  81. span:last-child {
  82. color: #999;
  83. font-size: .24rem;
  84. }
  85. }
  86. }
  87. }
  88. }
  89. </style>