gx
queenwuli
2021-01-12 a6653e19d20a61e7b8f788037d2a4df3f93a4f32
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
<template>
    <view class="container">
        <search-bar @confirm="search"></search-bar>
        <view class="flex justify-between">
            <view class="flex-1 mr-10">
                <navigator class="member-list flex align-center" 
                    :url="'./customerInfo?type='+type+'&id='+item.id" 
                    hover-class="none"
                    v-for="(item, index) in list">
                    <template>
                        <image v-if="item.photo" src="item.photo" class="avatar"></image>
                        <text v-else class="first-name" :style="{background: caculateBgcolor(index)}">{{item.vipName | formatName}}</text>
                    </template>
                    <view class="flex-1 flex align-center justify-between member-list-con">
                        <view class="flex flex-v">
                            <text class="mb-10">
                                <text>{{item.vipName}}</text>
                                <text class="vip-level" v-if="item.vipLevel">{{item.vipLevel}}</text>
                            </text>
                            <text class="font-13 gray">{{$utils.encryptAccount(item.phone)}}</text>
                        </view>
                        <view>
                            <text class="blue">{{item.shopName}}</text>
                            <text class="iconfont iconarrow-backimg light-gray"></text>
                        </view>
                    </view>
                </navigator>
                <no-record :isShow="!list.length"></no-record>
            </view>
            <indexed-list></indexed-list>
        </view>
    </view>
</template>
 
<script>
    import searchBar from '../../components/searchBar/index.vue';
    import indexedList from '../../components/indexedList/index.vue';
    export default {
        components:{
            searchBar,
            indexedList
        },
        data() {
            return {
                type: 1 ,//1新建订单 2新建服务单
                colors: ['#CCC6B4', '#C0CCB4', '#B4C2CC', '#BEB4CC', '#B4CCBE', '#B4CCCA', '#CCB4C6', '#CCB4B4'],
                queryKey: '',
                list: []
            };
        },
        onLoad(options) {
            if(options.type){
                this.type = options.type;
            }
            this.loadMemberList()
        },
        methods:{
            caculateBgcolor(index){
                return this.colors[index%8];
            },
            search(val){
                this.queryKey = val;
                this.loadMemberList();
            },
            loadMemberList(){
                let parma = Object.assign({
                    order: this.order,
                    queryKey: this.queryKey,
                    sort: this.sort
                }, this.filterKeys)
                this.$httpUtils.request('/api/vip/findVipInfoList', parma, 'POST', {isShowLoad: true}).then((res) => {
                    if(res.status == 200){
                        this.list = res.rows;
                    }
                })
            }
        },
        filters:{
            formatName(val){
                if(!val){
                    return '无'
                }
                val = val.trim();
                return val.substr(0, 1)
            }
        }
    }
</script>
 
<style scoped>
    .container{
        padding: 10px 10px 0;
    }
    .sort-wrap{
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }
    .sort-wrap .iconfont{
        font-size: 14px;
        padding-left: 4px;
    }
    .avatar{
        display: inline-block;
        width: 38px;
        height: 38px;
        border-radius: 50%;
    }
    .first-name{
        display: inline-block;
        width: 38px;
        height: 38px;
        line-height: 38px;
        margin-right: 10px;
        border-radius: 50%;
        text-align: center;
        color: #FFFFFF;
        font-size: 16px;
    }
    .member-list{
        font-size: 14px;
    }
    .member-list-con{
        padding: 15px 0 15px 5px;
        border-bottom: 1px solid #EDEAF4;
    }
    .member-list .vip-level{
        border: 1px solid #666;
        margin-left: 10px;
        font-size: 12px;
        border-radius: 12px;
        padding: 2px 12px;
        color: #666666;
    }
    .quick-entry{
        position: fixed;
        bottom: 80px;
        right: 15px;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
        border-radius: 50%;
        background: #518EFF;
        color: #FFFFFF;
        box-shadow: 4px 4px 5px #ddd;
    }
    .quick-entry .iconfont{
        font-size: 24px;
    }
</style>