<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">{{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">
|
<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>
|
export default {
|
components: {
|
|
},
|
data() {
|
return {
|
/*是否正在加载*/
|
loading: true,
|
detail: [],
|
user_id: 0,
|
wechat_share: false,
|
};
|
},
|
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.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>
|