陶杰
2024-10-16 ef240131386f3f37cd3d0b232b4d237fb73d1132
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
<template>
    <!-- 列表页面 -->
    <view>
 
        <!-- 查询条件 -->
        <view class="component-filter-container m-t-12 flex">
            <view class="flex1 w-fit m-l-a m-r-0" @click="show_time_picker_time=true"
                :class="[query.recordDateStart?'':'desc-gray']">
                <!-- {{query.recordDateStart&&( (query.recordDateStart||'') + ' ~ ' + (query.recordDateEnd || '')) || '请选择日期'}} -->
                {{query.recordDateStart || '请选择日期'}}
                <image src="@/static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
            </view>
            <view class="flex1 w-fit m-l-a m-r-0" @click.stop="$refs.popup_level.open()">
                {{ query.typeStr || '积分类型' }}
                <image src="@/static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
            </view>
            <view class="flex1 w-fit m-l-a m-r-0" @click.stop="()=>{
                query.typeStr = ''
                query.type = ''
                query.recordDateStart = ''
                query.recordDateEnd = ''
                refreshList()
            }">
                重置
            </view>
        </view>
        <view class="p15" style="min-height: calc(100vh - 260rpx);">
            <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data>
            <view v-for="(item,index) in list" :key="index" class="m-b-24">
                <view @click.stop="toDetail(item)" class="notice-item">
                    <view v-if="item.typeStr" class="type">{{item.typeStr||'-'}}</view>
                    <view class="time">{{item.recordDate || ''}}</view>
                    <view class="form-item">
                        <view class="form-item-label">变更类型</view>
                        <view class="form-item-value">{{item.changeTypeStr || ''}}</view>
                    </view>
                    <view class="form-item">
                        <view class="form-item-label">积分</view>
                        <view class="form-item-value">{{item.point || ''}}</view>
                    </view>
                    <view class="form-item">
                        <view class="form-item-label" style="min-width: 80rpx;">备注</view>
                        <view class="form-item-value" style="word-break: break-word;">{{item.remarks || ''}}</view>
                    </view>
                </view>
            </view>
        </view>
 
 
        <!-- 判断是否到底了,自动吧 -->
        <footer-msg :more="page.total>0&&page.total>page.current*page.size"></footer-msg>
 
        <u-calendar :show="show_time_picker_time" mode="single" @confirm="select_time_picker_time" :monthNum="3"
            @cancel="show_time_picker_time = false" rowHeight="100" @close="show_time_picker_time = false"
            minDate="2024-07-01" :maxDate="maxDate" toolTip="选择日期">
        </u-calendar>
 
        <uni-popup ref="popup_level" type="bottom">
            <view class="component-popup_input_all">
                <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同类型</view>
                <view v-for="(item,i) in type_columns" :key="i" class="m-t-20">
                    <view class="m-t-12 flex value-items">
                        <view class="value-item" @click="()=>{
                            if(each.value!==query.value){
                                query.type = each.value
                                query.typeStr = each.label
                                refreshList()
                                $refs.popup_level.close()
                            }                                                                                                                                                        
                        }" :class="[query.type==each.value?'cur':'']" v-for="(each, j) in item" :key="j">
                            {{ each.label || '-' }}
                        </view>
                    </view>
                </view>
                <view class="button-space"></view>
                <view>
                    <view class="button-green" @click="$refs.popup_level.close()">关闭
                    </view>
                </view>
            </view>
        </uni-popup>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                query: {
                    // status: ''
                    recordDateStart: '',
                    recordDateEnd: '',
                    type: '',
                    typeStr: '',
                },
                show_time_picker_time: false,
                maxDate: '',
                type_columns: [],
            }
        },
        onLoad() {
            this.maxDate = this.$util.toDate(new Date())
            this.$http.request('get', '/api/code/value', {
                params: {
                    type: 'point_type'
                }
            }).then(res => {
                var data = res.data
                this.type_columns = [data || []]
                this.type_columns[0].unshift({
                    label: '全部',
                    value: ''
                })
            })
            this.listApi = '/api/customer/point/list'
 
            this.getList()
 
        },
        onReachBottom() {
            this.getMore()
        },
        async onPullDownRefresh() {
            this.page.current = 1
            await this.getList()
            uni.stopPullDownRefresh()
        },
        methods: {
            select_time_picker_time(e) {
                console.log('select_time_picker_time', e)
                if (e && e.length > 0) {
                    this.query.recordDateStart = e[0]
                    this.query.recordDateEnd = e[e.length - 1]
                    this.show_time_picker_time = false
                } else {
                    this.query.recordDateStart = ''
                    this.query.recordDateEnd = ''
                    this.show_time_picker_time = false
                }
                this.refreshList()
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .notice-item {
        padding: 20rpx;
        font-size: 28rpx;
        background-color: #fff;
 
        .type {
            font-weight: 600;
 
        }
 
        .time {
            font-size: 24rpx;
            color: darkgray;
        }
 
        .form-item {
            display: flex;
 
            .form-item-label {}
 
            .form-item-value {
                flex: 1;
                text-align: right;
            }
        }
    }
</style>