index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <app-view class="logoff">
  3. <template #header>
  4. <app-navbar ref="navbarRef" title="积分流水" />
  5. </template>
  6. <app-pull-refresh v-model:dataList="tableList" v-model:loading="loading" :total="total" @refresh="onRefresh">
  7. <template #header>
  8. <Sticky :offset-top="50">
  9. <ul class="tablelist">
  10. <li class="tablelist-cell">时间</li>
  11. <li class="tablelist-cell">操作类型</li>
  12. <li class="tablelist-cell">金额</li>
  13. </ul>
  14. </Sticky>
  15. </template>
  16. <template #default="{ item }">
  17. <ul class="tablelist">
  18. <li class="tablelist-cell">{{ item.createtime }}</li>
  19. <li class="tablelist-cell">{{ item.scoreconfigtype }}</li>
  20. <li class="tablelist-cell">{{ item.score }}</li>
  21. </ul>
  22. </template>
  23. </app-pull-refresh>
  24. </app-view>
  25. </template>
  26. <script lang="ts" setup>
  27. import { reactive } from 'vue'
  28. import { Sticky } from 'vant'
  29. import { useCreditList } from '@/business/credit'
  30. import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
  31. const { dataList, loading, total, getCreditList } = useCreditList()
  32. const tableList = reactive<Model.UserScoreLogRsp[]>([])
  33. const onRefresh = (resolve: (data: Model.UserScoreLogRsp[]) => void) => {
  34. getCreditList().then(() => {
  35. resolve(dataList.value)
  36. })
  37. }
  38. </script>
  39. <style lang="less">
  40. .tablelist {
  41. display: flex;
  42. &-cell {
  43. flex: 1;
  44. background-color: #fff;
  45. }
  46. }
  47. </style>