queenwuli
2021-01-19 a3a48da30bdea132d2bfbb47fa2ccf83f1937c45
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
<template>
    <!-- 会员详情 -->
    <view>
        <view class="header flex flex-v align-center">
            <image class="avatar" :src="memberInfo.photo?memberInfo.photo:'../../static/images/default-avatar.png'"></image>
            <text class="font-18 mt-5">{{memberInfo.vipName}}</text>
            <text class="font-14 mt-5">会员编号: {{memberInfo.vipNo}}</text>
            <view class="flex align-center mt-5">
                <text class="font-12 mr-10">{{handlePhone(memberInfo.phone)}}</text>
                <text class="icon iconfont" :class="isHidePhone?'iconyanjing':'iconyanjing1'" @click="isHidePhone=!isHidePhone"></text>
            </view>    
            <view class="flex mt-10">
                <view class="icon-box mr-20" @click="call(memberInfo.phone)">
                    <text class="icon iconfont icondianhua blue"></text>
                </view>
                <view class="icon-box" @click="sendMessage(memberInfo.phone)">
                    <text class="icon iconfont iconxinxiduanxinsixinduihua blue"></text>
                </view>
            </view>
        </view>
        <view class="content">
            <view class="content-row flex justify-around">
                <view class="center">
                    <text class="font-18 red">{{memberInfo.totalBalance | formatNum}}</text>
                    <text class="font-14 mt-10 block">余额</text>
                </view>
                <view class="center">
                    <text class="font-18 green">{{memberInfo.giftBalance | formatNum}}</text>
                    <text class="font-14 mt-10 block">赠送余额</text>
                </view>
                <view class="center">
                    <text class="font-18 blue">{{memberInfo.totalShopping | formatNum}}</text>
                    <text class="font-14 mt-10 block">累计消费</text>
                </view>
            </view>
            <view class="content-row flex flex-wrap">
                <view class="detail-item" v-if="$utils.hasPermission('hyxx')">
                    <navigator :url="'./editMember?id='+id" hover-class="none" >
                        <image class="detail-icon" mode="aspectFit" src="../../static/images/member-detail1.png"></image>
                        <text class="mt-5">会员信息</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('tcxm')">
                    <navigator :url="'./projectPlan?id='+id+'&vipName='+memberInfo.vipName" hover-class="none" >
                        <image class="detail-icon"  mode="aspectFit" src="../../static/images/member-detail2.png"></image>
                        <text class="font-14 mt-5">项目/套餐</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('kaxiang')">
                    <navigator :url="'./membershipCard?id='+id" hover-class="none" >
                        <image class="detail-icon"  mode="aspectFit" src="../../static/images/member-detail3.png"></image>                        
                        <text class="mt-5">卡项</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('pfjc')">
                    <navigator :url="'./skinDetection?id='+id" hover-class="none" >
                        <image class="detail-icon"  mode="aspectFit" src="../../static/images/member-detail4.png"></image>
                        <text class="mt-5">皮肤检测</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('xfjl')">
                    <navigator :url="'../workbench/orderList?queryKey='+memberInfo.phone" hover-class="none" >
                        <image class="detail-icon" mode="aspectFit" src="../../static/images/member-detail5.png"></image>
                        <text class="mt-5">订单记录</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('fwjl')">
                    <navigator :url="'../workbench/serviceOrderList?queryKey='+memberInfo.phone" hover-class="none" >
                        <image class="detail-icon"  mode="aspectFit" src="../../static/images/member-detail6.png"></image>
                        <text class="mt-5">服务单记录</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('gjjl')">
                    <navigator :url="'../workbench/followRecords/index?selectInfo='+JSON.stringify(selectInfo)" hover-class="none" >
                        <image class="detail-icon"  mode="aspectFit" src="../../static/images/member-detail7.png"></image>                        
                        <text class="mt-5">跟进记录</text>
                    </navigator>
                </view>
                <view class="detail-item" v-if="$utils.hasPermission('hyda')">
                    <navigator :url="'./memberProfile?id='+id" hover-class="none" >
                        <image class="detail-icon"  mode="aspectFit" src="../../static/images/member-detail3.png"></image>                        
                        <text class="mt-5">会员档案</text>
                    </navigator>
                </view>
            </view>
        </view>
        <view class="sticky-footer flex justify-between">
            <navigator :url="'../workbench/selectProduct/index?id='+id+'&vipName='+memberInfo.vipName" class="btn" v-if="$utils.hasPermission('ddgl.add')">
                <button class="white-btn">开单</button>
            </navigator>
            <navigator :url="'../workbench/selectService/index?id='+id+'&vipName='+memberInfo.vipName" class="btn" v-if="$utils.hasPermission('fwdgl.add')">
                <button class="blue-btn">预约</button>
            </navigator>
        </view>
    </view>
</template>
 
<script>
    export default{
        data(){
            return{
                isHidePhone: true,
                id: '',
                memberInfo: {}
            }
        },
        onLoad(options) {
            this.id = options.id;
        },
        onShow() {
            this.loadMemberInfo()
        },
        computed:{
            selectInfo(){
                return {
                    vipName: this.memberInfo.vipName,
                    photo: this.memberInfo.photo,
                    id: this.id
                }
            }
        },
        methods:{
            loadMemberInfo(){
                this.$httpUtils.request('/api/vip/findVipInfoById/'+this.id).then((res) => {
                    if(res.status == 200){
                        this.memberInfo = res.mapInfo.vipInfo;
                    }
                })
            },
            handlePhone(val){
                if(this.isHidePhone){
                    return this.$utils.encryptAccount(val);
                }
                return val;
            },
            // 打电话
            call(val){
                // #ifdef APP-PLUS
                plus.device.dial(val, false);
                // #endif
            },
            // 发信息
            sendMessage(val){
                // #ifdef APP-PLUS
                let msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS);
                msg.to = [val];
                msg.body = '';
                plus.messaging.sendMessage(msg);
                // #endif
            },
        }
    }
</script>
 
<style>
    .status_bar{
        background: #518EFF;
        color: #FFFFFF;
    }
    .header{
        background: #518EFF;
        color: #FFFFFF;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        padding: 0 15px 15px;
    }
    .avatar{
        width: 60px;
        height: 60px;
        border-radius: 50%;
    }
    .icon-box{
        width: 28px;
        height: 28px;
        line-height: 28px;
        text-align: center;
        background: #FFFFFF;
        border-radius: 50%;
    }
    .icon{
        font-size: 18px;
    }
    .content{
        padding: 0 10px;
    }
    .content-row{
        border: 1px solid #EDEAF4;
        background: #FFFFFF;
        margin-top: 10px;
        padding: 15px 0;
        border-radius: 4px;
        box-shadow:0 6px 6px rgba(237,234,244,0.5);
    }
    .detail-item{
        width: 25%;
        margin: 10px 0;
        text-align: center;
        font-size: 12px;
    }
    .detail-icon{
        display: block;
        width: 24px;
        height: 24px;
        margin: 0 auto 5px;
    }
    .sticky-footer{
        margin: 0 -8px;
    }
    .btn{
        width: 100%;
        margin: 0 8px;
    }
</style>