jhzh
2024-09-19 e3097587828362e34352cf4f378c8f5a260ea700
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
  <div style="height: 100vh">
    <van-nav-bar
      :placeholder="true"
      :safe-area-inset-top="true"
      :title="$t('劃轉记录')"
      left-arrow
      @click-left="$router.go(-1)"
    >
    </van-nav-bar>
    <div>
      <van-list
        v-model="loading"
        :finished="finished"
        :loading-text="$t('hj430')"
        @load="onLoad"
      >
        <van-cell v-for="item in list" :key="item.id">
          <div class="item">
            <div>
              <div>
                {{ $t(item.descs.split("/")[0]) }}
                > {{ $t(item.descs.split("/")[1]) }}
              </div>
            </div>
            <div>{{ Math.abs(Number(item.amount)) }} {{ item.symbol }}</div>
          </div>
        </van-cell>
      </van-list>
    </div>
  </div>
</template>
 
<script>
import { getMoenyLog } from "@/axios/api";
export default {
  data() {
    return {
      list: [],
      loading: false,
      finished: false,
    };
  },
  created() {
    this.getMoenyLogs();
  },
  methods: {
    async getMoenyLogs() {
      const res = await getMoenyLog({ type: "TRANSFER" });
      const arr = res.data.filter((item) => Number(item.amount) < 0);
      this.list = arr.reverse();
      // 加载状态结束
      this.loading = false;
      this.finished = true;
    },
    onLoad() {
      // 异步更新数据
      // setTimeout 仅做示例,真实场景中一般为 ajax 请求
    },
  },
};
</script>
 
<style lang="less" scoped>
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  line-height: 38px;
}
/deep/ .van-nav-bar__content {
  height: 65px;
}
/deep/ .van-nav-bar__title {
  font-family: "DINPro";
  width: 100%;
  height: 1.17333rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-style: normal;
  font-weight: 500;
  font-size: 0.48rem;
  color: #14181f;
}
</style>