quanwei
2025-11-21 1db9a4130699636cabe7e0c9f7f15d004aadada0
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
<template>
    <view class="member-container" :data-theme='theme()' :class="theme() || ''">
        <!--内容-->
        <view class="member-detail f28">
            <view class="detail-section detail-base d-s-c">
                <view class="image">
                    <image :src="detail.user.avatarUrl"></image>
                </view>
                <view class="pl20">
                    <view class="d-s-c">
                        <view class="f32 fb">{{detail.user.real_name}}</view>
                        <view class="position" v-if="detail.position_name && setting.show_position=='1'">{{detail.position_name}}</view>
                    </view>
                    <view class="gray6 pt10 f26" v-if="detail.branch">{{detail.branch.name}}</view>
                    <!-- <view class="gray6 pt20">{{detail.region.province}}{{detail.region.city}}{{detail.region.region}}</view> -->
                </view>
            </view>
            <!-- 联系方式 -->
            <view class="detail-section">
                <view class="d-s-s">
                    <view>联系电话:</view>
                    <view class="flex-1">{{detail.user.mobile}}</view>
                </view>
                <view class="d-s-s pt20">
                    <view>公司地址:</view>
                    <view class="flex-1">{{detail.supplier.address}}</view>
                </view>
            </view>
            <!-- 公司简介 -->
            <view class="detail-section" v-if="detail.supplier">
                <view class="f28 fb">{{detail.supplier.name}}</view>
                <view class="desc o-h lh200 pt20">{{detail.supplier.description}}</view>
            </view>
            <!-- 个人简介 -->
            <view class="detail-section">
                <view class="f28 fb">个人简介</view>
                <view class="desc o-h lh200 pt20">{{detail.describe}}</view>
            </view>
            <!-- 行业分类 -->
            <view class="detail-section d-b-c">
                <view class="f28 fb">行业分类</view>
                <view>{{detail.supplier.category.name}}</view>
            </view>
            <!-- 籍贯 -->
            <view class="detail-section d-b-c" v-if="detail.region">
                <view class="f28 fb">籍贯</view>
                <view>
                    <text>{{detail.region.province}}</text>
                    <text>-{{detail.region.city}}</text>
                    <text v-if="detail.region.region">-{{detail.region.region}}</text>
                </view>
            </view>
        </view>
        <view class="member-footer d-s-c">
            <button class="item-icon p-0-30 d-c-c d-c" open-type="share" @click="share">
                <text class="iconfont icon-share1"></text>
                <text class="f24 pt10">分享</text>
            </button>
            <view class="item-icon p-0-30 d-c-c d-c" @click="callPhone" v-if="setting.show_mobile=='1'">
                <text class="iconfont icon-002dianhua"></text>
                <text class="f24 pt10">电话</text>
            </view>
            <view class="btn flex-1" @click="addPhoneContact">保存到通讯录</view>
        </view>
        <view class="popup-bg" :class="wechat_share?'open':'close'" @click="closeShare" v-if="wechat_share">
            <view class="wechat-box">
                <image src="/static/share.png" mode="widthFix"></image>
            </view>
        </view>
    </view>
</template>
 
<script>
    import utils from '@/common/utils';
    export default {
        components: {
            
        },
        data() {
            return {
                /*是否正在加载*/
                loading: true,
                detail: [],
                user_id: 0,
                wechat_share: false,
                setting: {},
            };
        },
        onLoad(e) {
            this.user_id = e.user_id;
        },
        mounted() {
            this.getData();
        },
        onReachBottom() {},
        methods: {
            /*获取活动列表*/
            getData() {
                let self = this;
                self.loading = true;
                self._get(
                    'branch.member/detail', {
                        user_id: self.user_id,
                    }, function(res) {
                        self.detail = res.data.detail;
                        self.setting = res.data.setting;
                        if (self.setting.show_mobile != '1') {
                            self.detail.user.mobile = utils.maskPhoneNumber(self.detail.user.mobile);
                        }
                        self.loading = false;
                    }
                );
            },
            
            // 添加到通讯录
            addPhoneContact() {
                let self = this;
                uni.addPhoneContact({
                    firstName: self.detail.user.real_name,
                    lastName: '',
                    // 联系方式
                    mobilePhoneNumber: self.detail.user.mobile, // 手机号
                    email: '', // 电子邮件
                    // 工作相关信息
                    organization: self.detail.branch.name, // 组织
                    title: self.detail.position_name, // 职位
                    // 成功回调
                    success: () => {
                        uni.showToast({
                            title: '已成功保存到通讯录',
                            icon: 'success'
                        });
                    },
                    // 失败回调
                    fail: (err) => {
                        console.error('添加联系人失败:', err);
                        let errMsg = '保存失败,请重试';
                        // 可以根据不同的错误码或错误信息给予更具体的提示
                        if (err && err.errMsg && err.errMsg.includes('cancel')) {
                            errMsg = '您已取消保存';
                        }
                        uni.showToast({
                            title: errMsg,
                            icon: 'none'
                        });
                    }
                });
            },
            
            callPhone(){
                uni.makePhoneCall({
                    phoneNumber: this.detail.user.mobile + ''
                });
            },
            
            //发送给朋友
            share: function() {
                //#ifdef H5
                    this.wechat_share = true;
                //#endif
            },
            
            closeShare() {
                //#ifdef H5
                    this.wechat_share = false;
                //#endif
            }
        }
    };
</script>
 
<style lang="scss" scoped>
    page {
        background: #f5f5f5;
    }
    
    .member-detail {
        padding: 0 20rpx;
        padding-bottom: 120rpx;
        
        .detail-section {
            margin-top: 20rpx;
            background: #ffffff;
            border-radius: 24rpx;
            padding: 20rpx;
            
            .desc {
                white-space: break-spaces;
            }
        }
        .detail-base {
            background: linear-gradient(145deg, #ffffff, #f8e3a8);
            
            .image {
                image {
                    width: 100rpx;
                    height: 100rpx;
                    border-radius: 100rpx;
                }
            }
            .position {
                border-width: 1rpx;
                border-style: solid;
                @include border_color('border_color');
                padding: 4rpx 12rpx;
                border-radius: 60rpx;
                font-size: 22rpx;
                margin-left: 20rpx;
                @include font_color('font_color');
            }
        }
    }
    
    .member-footer {
        position: fixed;
        height: 100rpx;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        background: #ffffff;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1rpx solid #eeeeee;
        
        .item-icon {
            background: transparent;
            line-height: inherit;
            
            .iconfont {
                font-size: 30rpx;
                font-weight: bold;
                color: #333333;
            }
        }
        
        .btn {
            @include background_color('background_color');
            color: #ffffff;
            text-align: center;
            border-radius: 100rpx;
            height: 70rpx;
            line-height: 70rpx;
            font-size: 28rpx;
            margin-right: 30rpx;
            margin-left: 20rpx;
        }
    }
    
    .member-container .popup-bg {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0, 0, 0, .6);
        z-index: 98;
        
        &.close {
            display: none;
        }
        
        .wechat-box{
            padding-top: var(--window-top);
        }
        
        .wechat-box image{
            width: 100%;
        }
    }
</style>