li-guang
2020-12-15 f3071eeab28fbe9cb850cf9dd00bd8f77fae0798
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
<template>
    <view class="container">
        <search-bar></search-bar>
        <view class="sort-wrap">
            <view @click="filterCustom(1)">
                <text>到店排序</text>
                <text class="iconfont iconjiantouarrow486"></text>
            </view>
            <view @click="filterCustom(2)">
                <text>卡项排序</text>
                <text class="iconfont iconjiantouarrow486"></text>
            </view>
            <view @click="filterCustom(3)">
                <text>全部筛选</text>
                <text class="iconfont iconjiantouarrow486"></text>
            </view>
        </view>
        <filter-dropdown ref="filterDropdownEl" :list="filterList" :type="filterType"></filter-dropdown>
        <view class="sort-tab">
            <text class="sort-tab-item">正式客户</text>
            <text class="sort-tab-item">体验客户</text>
            <text class="sort-tab-item">潜在客户</text>
            <text class="sort-tab-item">潜在客户</text>
        </view>
        <view class="flex justify-between" @click="toDetail">
            <view class="flex-1 mr-10">
                <view class="member-list flex align-center" v-for="(item, index) in 15">
                    <text class="first-name" :style="{background: caculateBgcolor(index)}">李</text>
                    <view class="flex-1 flex align-center justify-between member-list-con">
                        <view>
                            <text>李广</text>
                            <text class="ml-10">152****9645</text>
                        </view>
                        <view>
                            <text class="blue">30天未到店</text>
                            <text class="iconfont iconarrow-backimg gray"></text>
                        </view>
                    </view>
                </view>
            </view>
            <indexed-list></indexed-list>
        </view>
    </view>
</template>
 
<script>
    import searchBar from '../../components/searchBar/index.vue';
    import indexedList from '../../components/indexedList/index.vue';
    import filterDropdown from '../../components/filterDropdown/index.vue';
    export default {
        components:{
            searchBar,
            indexedList,
            filterDropdown
        },
        data() {
            return {
                colors: ['#CCC6B4', '#C0CCB4', '#B4C2CC', '#BEB4CC', '#B4CCBE', '#B4CCCA', '#CCB4C6', '#CCB4B4'],
                filterType: 1,
                filterList: [],
                filter1: ['本月到店次数(由低到高)','本月到店次数(由高到低)','本年到店次数(由低到高)','本年到店次数(由高到低)','本月消费(由高到低)','本月消费(由低到高)','本月消耗(由高到低)','本月消耗(由低到高)'],
                filter2: ['7天内卡项到期','15天内卡项到期','30天内卡项到期'],
                filter3: [{
                    title: '到店途径',
                    list: [
                        {
                            'title': '美团预约',
                            'value': ''
                        },
                        {
                            'title': '网络预约',
                            'value': ''
                        }
                    ]
                },
                {
                    title: '会员等级',
                    list: [
                        {
                            'title': '一级会员',
                            'value': ''
                        },
                        {
                            'title': '二级会员',
                            'value': ''
                        },
                        {
                            'title': '三级会员',
                            'value': ''
                        }
                    ]
                },
                {
                    title: '活跃度',
                    list: [
                        {
                            'title': '活跃',
                            'value': ''
                        },
                        {
                            'title': '不活跃',
                            'value': ''
                        },
                        {
                            'title': '睡眠',
                            'value': ''
                        },
                        {
                            'title': '沉睡',
                            'value': ''
                        }
                    ]
                }]
            };
        },
        onHide(){
            this.$refs.filterDropdownEl.hide();
        },
        methods:{
            caculateBgcolor(index){
                return this.colors[index%8];
            },
            toDetail(){
                uni.navigateTo({
                    url:'./detail'
                })
            },
            filterCustom(type){
                this.$refs.filterDropdownEl.show();
                if(type===1){
                    this.filterList = this.filter1;
                    this.filterType = 1;
                } else if(type===2){
                    this.filterList = this.filter2;
                    this.filterType = 1;
                } else {
                    this.filterList = this.filter3;
                    this.filterType = 0;
                }
            }
        }
    }
</script>
 
<style scoped>
    .container{
        padding: 10px 10px 0;
    }
    .sort-wrap{
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
    }
    .sort-wrap .iconfont{
        font-size: 14px;
        color: #999;
        padding-left: 3px;
    }
    .sort-tab{
        display: flex;
        justify-content: space-between;
        margin: 10px 0;
    }
    .sort-tab-item{
        border:1px solid #EDEAF4;
        font-size: 14px;
        color: #ABB1CC;
        padding: 3px 10px;
        border-radius: 4px;
        box-shadow: 3px 3px 5px #EEEEEE;
    }
    .sort-tab-item.active{
        border: 1px solid #518EFF;
        color: #518EFF;
    }
    .first-name{
        display: inline-block;
        width: 38px;
        height: 38px;
        line-height: 38px;
        margin-right: 10px;
        border-radius: 50%;
        text-align: center;
        color: #FFFFFF;
    }
    .member-list{
        font-size: 15px;
    }
    .member-list-con{
        padding: 20px 0 20px 5px;
        border-bottom: 1px solid #EDEAF4;
    }
</style>