Jacob
2026-10-13 65dae1e7905c917bd61510db54af342e878ebf1a
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<template>
   <view class="container">
       <!-- 明细列表 -->
       <scroll-view class="list" scroll-y>
           <view class="item" v-for="(item, index) in list" :key="index">
               <view class="time">{{ item.createTime }}</view>
               <view class="row">
                   <view class="desc">{{ item.actionName.includes('兑换')?item.actionName:'兑换'+item.actionName }}</view>
                   <view class="count green">
                       -{{ item.careNumber }}
                   </view>
               </view>
           </view>
           <view class="loadingTips">{{loadTitle}}</view>
       </scroll-view>
   </view>
</template>
 
<script>
   import {
       getConsumeRecord
   } from '../../api/store.js'
   export default {
       data() {
           return {
               limit: 20,
               page: 1,
               loadend: false,
               loadTitle: '',
               list: [],
               zoneId:null
           };
       },
       onLoad(options) {
           uni.setNavigationBarTitle({
               title: '消耗明细'
           });
           this.zoneId=options.zoneId
           this.getConsumeRecord()
       },
       onReachBottom() {
           this.getConsumeRecord();
       },
       methods: {
           getConsumeRecord() {
               if (this.loadend) return
               let that = this
               let where = {
                   limit: this.limit,
                   page: this.page,
                   zoneId:this.zoneId
               }
               uni.showLoading();
               getConsumeRecord(where).then(res => {
                   let list = res.data.list;
                   if (res.data.page < res.data.totalPage) {
                       that.loadend = false;
                   } else {
                       that.loadend = true;
                   }
                   that.loadTitle = that.loadend ? '已全部加载' : '加载更多';
                   if (res.data.page == 1) {
                       that.$set(that, 'list', list);
                   } else {
                       that.$set(that, 'goodList', that.list.concat(list));
                   }
                   uni.hideLoading()
               }).catch(err => {
                   that.loadTitle = '加载更多';
                   uni.hideLoading()
               });
           }
       }
   };
</script>
 
<style scoped lang="scss">
   .container {
       min-height: 100vh;
       background-color: #f5f5f5;
       overflow: hidden;
   }
 
   .nav-bar {
       display: flex;
       align-items: center;
       justify-content: space-between;
       padding: 20rpx 30rpx;
       background-color: #f5f5f5;
   }
 
   .back-btn {
       font-size: 40rpx;
       width: 80rpx;
   }
 
   .title {
       font-size: 36rpx;
       font-weight: bold;
   }
 
   .nav-right {
       display: flex;
   }
 
   .circle-btn {
       width: 80rpx;
       height: 60rpx;
       border: 1rpx solid #333;
       border-radius: 30rpx;
       display: flex;
       align-items: center;
       justify-content: center;
       margin-left: 10rpx;
   }
 
   .list {
       padding: 20rpx;
       box-sizing: border-box;
   }
 
   .item {
       background-color: #fff;
       border-radius: 20rpx;
       padding: 30rpx;
       margin-bottom: 20rpx;
   }
 
   .time {
       font-size: 26rpx;
       color: #999;
       margin-bottom: 20rpx;
   }
 
   .row {
       display: flex;
       justify-content: space-between;
       align-items: center;
   }
 
   .desc {
       font-size: 30rpx;
   }
 
   .count {
       font-size: 30rpx;
       font-weight: bold;
       color: #333;
   }
 
   .count.green {
       color: #00c853;
   }
 
   .loadingTips {
       width: max-content;
       padding: 3vw 0 3vw 60rpx;
       font-size: 27rpx;
       line-height: 2em;
       margin: 0 auto;
       color: #DDDDDD;
       background: url('https://ossacmall.bluedeer.com.cn/app/static/images/h_loading.png') left center/41rpx auto no-repeat;
   }
</style>