doum
2026-06-17 ea689dd91eaa72425dc01759042c3b4eb2186512
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
<template>
  <view class="cu-page">
    <view class="cu-filters">
      <picker :range="statusOptions" range-key="label" @change="onStatusChange">
        <view class="cu-filter">{{ statusLabel }} ▾</view>
      </picker>
      <picker mode="date" fields="month" @change="onMonthChange">
        <view class="cu-filter">{{ month || '充值月份' }} ▾</view>
      </picker>
    </view>
 
    <view class="cu-list-header">
      <text class="cu-list-header__count">共 {{ list.length }} 条记录</text>
    </view>
 
    <view class="cu-list-wrap">
      <view v-for="item in list" :key="item.id" class="cu-list-card">
        <view class="cu-list-card__head">
          <view class="cu-list-card__icon cu-list-card__icon--record">📋</view>
          <view class="cu-list-card__main">
            <view class="cu-list-card__title-row">
              <text class="cu-list-card__title">{{ item.deviceInfo || item.name || '充值记录' }}</text>
              <text :class="['cu-status', statusClass(item.status)]">{{ item.statusText }}</text>
            </view>
            <text class="cu-list-card__sub" v-if="item.address">户号 {{ item.address }}</text>
          </view>
        </view>
 
        <view class="cu-info-grid">
          <view class="cu-info-cell">
            <text class="cu-info-cell__label">充值金额</text>
            <text class="cu-info-cell__value cu-info-cell__value--primary">¥{{ item.money }}</text>
          </view>
          <view class="cu-info-cell">
            <text class="cu-info-cell__label">充后余额</text>
            <text class="cu-info-cell__value">{{ item.balanceAfter }}</text>
          </view>
          <view class="cu-info-cell cu-info-cell--full">
            <text class="cu-info-cell__label">充值时间</text>
            <text class="cu-info-cell__value">{{ item.createDate }}</text>
          </view>
        </view>
      </view>
      <u-empty v-if="!list.length" text="暂无记录" margin-top="80" />
    </view>
  </view>
</template>
 
<script>
import { customerRechargeRecordPage } from '@/api'
export default {
  data () {
    return {
      list: [],
      month: '',
      statusIdx: 0,
      statusOptions: [
        { label: '全部状态', value: null },
        { label: '充值成功', value: 1 },
        { label: '充值失败', value: 2 },
        { label: '充值中', value: 0 }
      ]
    }
  },
  computed: { statusLabel () { return this.statusOptions[this.statusIdx].label } },
  onShow () { this.load() },
  methods: {
    load () {
      customerRechargeRecordPage({
        page: 1,
        capacity: 50,
        model: { status: this.statusOptions[this.statusIdx].value, month: this.month || null }
      }).then(res => { this.list = (res.data && res.data.records) || [] })
    },
    onStatusChange (e) { this.statusIdx = Number(e.detail.value); this.load() },
    onMonthChange (e) { this.month = e.detail.value; this.load() },
    statusClass (s) {
      if (s === 1) return 'cu-status--ok'
      if (s === 2) return 'cu-status--bad'
      return 'cu-status--warn'
    }
  }
}
</script>