quanwei
2025-11-15 6f12eadd25c8f5335fd9eccf373bf9835bf3e4c6
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
<template>
    <view :data-theme='theme()' :class="theme() || ''">
        <view class="top-tabbar">
            <view class="d-b-c" id="searchBox">
                <view class="index-search t-c flex-1" style="height: 70rpx; line-height: 70rpx; margin: 10rpx;">
                    <span class="icon iconfont icon-sousuo"></span>
                    <input type="text" v-model="search" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f24 gray6"
                     placeholder="核销员姓名" confirm-type="search" @confirm="gotoSearch()"/>      
                </view>
                <view  class="index-search t-c flex-1" style="height: 70rpx; line-height: 70rpx; margin: 10rpx;">
                    <picker mode="date" @change="onChangeStartTime">
                       <view class="label-right">
                         {{start_time}}
                       </view>
                     </picker>
                </view>
                <view  class="index-search t-c flex-1" style="height: 70rpx; line-height: 70rpx; margin: 10rpx;">
                     <picker mode="date" @change="onChangeEndTime">
                        <view class="label-right">
                          {{end_time}}
                        </view>
                      </picker>
                </view>
                
            </view>    
        </view>
        <view class="p20 gray6">共{{total_num}}条核销记录</view>
        <!--列表-->
        <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
         @scrolltolower="scrolltolowerFunc">
            <view :class="topRefresh ? 'top-refresh open' : 'top-refresh'">
                <view class="circle" v-for="(circle, n) in 3" :key="n"></view>
            </view>
            <view class="order-list">
                <view class="item" v-for="(item, index) in listData" :key="index">
                    <view class="d-b-c pb20">
                        <view class="item-dianpu">
                            <view class="item-d-l mr10">
                                <i class="icon iconfont icon-dianpu1"></i>
                                <text class="fb gray3 f32" v-if="item.store">{{item.store.store_name}}</text>
                            </view>
                            
                        </view>
                    </view>
                    <!--显示-->
                    <view class="d-s-s">
                        <view class="pl30">
                            <view class="p-20-0">
                                <text>核销员:</text>
                                <text>{{ item.clerk.real_name }}</text>
                            </view>
                            <view class="p-20-0">
                                <text>核销时间:</text>
                                <text>{{ item.create_time }}</text>
                            </view>
                            <view class="p-20-0">
                                <text>订单号:</text>
                                <text>{{ item.order.order_no }}</text>
                            </view>
                        </view>
                        
                    </view>
                </view>
                <view class="d-c-c p30" v-if="listData.length == 0 && !loading">
                    <text class="iconfont icon-wushuju"></text>
                    <text class="cont">亲,暂无相关记录哦</text>
                </view>
                <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
            </view>
        </scroll-view>
    </view>
</template>
 
<script>
    import Popup from '@/components/uni-popup.vue';
    import uniLoadMore from '@/components/uni-load-more.vue';
    import {
        pay
    } from '@/common/pay.js';
    export default {
        components: {
            Popup,
            uniLoadMore
        },
        data() {
            return {
                /*手机高度*/
                phoneHeight: 0,
                /*可滚动视图区域高度*/
                scrollviewHigh: 0,
                /*顶部刷新*/
                topRefresh: false,
                /*数据*/
                listData: [],
                /*最后一页码数*/
                last_page: 0,
                /*当前页面*/
                page: 1,
                /*每页条数*/
                list_rows: 10,
                total_num:0,
                /*有没有等多*/
                no_more: false,
                /*是否正在加载*/
                loading: true,
                isfirst:false,
                start_time:'开始时间',
                end_time:'结束时间',
                search:''
            };
        },
        computed: {
            /*加载中状态*/
            loadingType() {
                if (this.loading) {
                    return 1;
                } else {
                    if (this.listData.length != 0 && this.no_more) {
                        return 2;
                    } else {
                        return 0;
                    }
                }
            }
        },
        onLoad(e) {
        },
        mounted() {
            this.init();
            this.initData();
            /*获取订单列表*/
            this.getData();
        },
        onShow() {
            if(this.isfirst){
                this.initData();
                this.getData();
            }
        },
        methods: {
            initData(){
                let self=this;
                self.page = 1;
                self.listData = [];
                self.no_more=false;
            },
            
            /*初始化*/
            init() {
                let self = this;
                uni.getSystemInfo({
                    success(res) {
                        self.phoneHeight = res.windowHeight;
                        // 计算组件的高度
                        let view = uni.createSelectorQuery().in(self).select('.top-tabbar');
                        view.boundingClientRect(data => {
                            let h = self.phoneHeight - data.height;
                            self.scrollviewHigh = h;
                        }).exec();
                    }
                });
            },
 
 
            /*可滚动视图区域到底触发*/
            scrolltolowerFunc() {
                let self = this;
                if (self.no_more) {
                    return;
                }
                self.page++;
                if (self.page <= self.last_page) {
                    self.getData();
                } else {
                    self.no_more = true;
                }
            },
            
            //选择时间
            onChangeStartTime(e) {
                let self = this;
                let val = e.detail.value;
                self.start_time = val;
                self.initData();
                self.getData();    
            },
            onChangeEndTime(e) {
                let self = this;
                let val = e.detail.value;
                self.end_time = val;
                self.initData();
                self.getData();    
            },
            gotoSearch() {
                let self=this;
                self.initData();
                self.getData();    
            },
 
            /*获取数据*/
            getData() {
                let self = this;
                self.loading = true;
                let start_time = '';
                let end_time = '';
                if(self.start_time && self.start_time != "开始时间"){
                    start_time=self.start_time;
                }
                if(self.end_time && self.end_time != "结束时间"){
                    end_time=self.end_time;
                }
                self._get(
                    'store.Order/index', {
                        page: self.page,
                        list_rows: self.list_rows,
                        search: self.search,
                        start_time: start_time,
                        end_time: end_time
                    },
                    function(res) {
                        self.loading = false;
                        self.listData = self.listData.concat(res.data.list.data);
                        self.last_page = res.data.list.last_page;
                        self.total_num = res.data.list.total;
                        if (res.data.list.last_page <= 1) {
                            self.no_more = true;
                        } else {
                            self.no_more = false;
                        }
                        self.isfirst=true;
                    }
                );
            },
        }
    };
</script>
 
<style lang="scss">
    page {
        background-color: #f2f2f2;
    }
 
    .top-tabbar {
        height: 96rpx;
    }
 
    .order-list .order-head .state-text {
        padding: 10rpx 12rpx;
        margin-right: 21rpx;
        border-radius: 4rpx;
        background: #FFE7E4;
        font-size: 22rpx;
        color: #F6220C;
    }
 
    .shop-name {
        font-size: 26rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #333333;
    }
 
    .order-list .item {
        margin-bottom: 30rpx;
        padding: 30rpx;
        background: #ffffff;
    }
 
    .order-list .product-list,
    .order-list .one-product {
        padding: 30rpx 0 27rpx 0;
        height: 150rpx;
    }
 
    .one-product .pro-info {
        padding: 0 21rpx 0 37rpx;
        display: -webkit-box;
        width: 361rpx;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 26rpx;
        color: #333333;
    }
 
    .order-list .cover,
    .order-list .cover image {
        width: 150rpx;
        height: 150rpx;
        border-radius: 8rpx;
    }
 
    .order-list .total-count {
        padding-left: 20rpx;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
    }
 
    .total-count .count {
        padding-top: 16rpx;
        color: #999999;
        font-size: 22rpx;
    }
 
    .product-list .total-count {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.9);
    }
 
    .product-list .total-count .left-shadow {
        position: absolute;
        top: 0;
        bottom: 0;
        left: -24rpx;
        width: 24rpx;
        overflow: hidden;
    }
 
    .product-list .total-count .left-shadow::after {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 24rpx;
        right: -12rpx;
        display: block;
        content: '';
        background-image: radial-gradient(rgba(0, 0, 0, 0.2) 10%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0) 80%);
    }
 
    .order-list .order-bts {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
 
    .order-list .order-bts.presale {
        display: block;
        padding-top: 12rpx;
    }
 
    .order-list .order-bts button {
        margin: 0;
        padding: 0 30rpx;
        height: 60rpx;
        line-height: 60rpx;
        margin-left: 20rpx;
        font-size: 32rpx;
        border: 1px solid #F6220C;
        border-radius: 30px;
        background: #ffffff;
        white-space: nowrap;
        color: #F6220C;
        font-family: PingFang SC;
    }
 
    .order-list .order-bts button::after {
        display: none;
    }
 
    .order-list .order-bts button.btn-border-red {
        border: 1px solid $dominant-color;
        font-size: 24rpx;
        color: $dominant-color;
    }
 
    .order-list .order-bts button.btn-red {
        background: linear-gradient(90deg, #FF6B6B 4%, #F6220C 100%);
        border-radius: 30rpx;
        font-size: 32rpx;
        font-family: PingFang SC;
        color: #ffffff;
        border: none;
    }
 
    .buy-checkout {
        width: 100%;
    }
 
    .buy-checkout .item {
        min-height: 50rpx;
        line-height: 50rpx;
        padding: 20rpx;
        display: flex;
        justify-content: space-between;
        font-size: 28rpx;
    }
 
    .buy-checkout .iconfont.icon-weixin {
        color: #04be01;
        font-size: 50rpx;
    }
 
    .buy-checkout .iconfont.icon-yue {
        color: #f0de7c;
        font-size: 50rpx;
    }
 
    .buy-checkout .item.active .iconfont.icon-xuanze {
        color: #04be01;
    }
 
    .item-dianpu {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 24rpx;
        line-height: 30rpx;
    }
 
    .item-dianpu .icon-jiantou {
        font-size: 24rpx;
        color: #333333;
    }
 
    .item-d-l {
        display: flex;
    }
 
    .icon-dianpu1 {
        margin-right: 20rpx;
        color: #333333;
        font-size: 32rpx;
    }
</style>