Commit ee882989 by chenwq

去掉userinfo组件

1 parent 923e8e4c
// components/UserInfo/UserInfo.js
import { componentsMixin } from "../../mixins/index";
import util from "../../utils/util";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
cardInfo: {
type: Object,
observer(n) {
this.setData({
cardInfo: n,
});
},
},
shareDisabled: {
type: Boolean,
defalut: true,
observer(n) {
this.setData({
shareDisabled: n
})
}
}
},
/**
* 组件的初始数据
*/
data: {
showWechant: false,
// shareDisabled: true
},
/**
* 组件的方法列表
*/
methods: {
// 添加微信
addWechat() {
this.setData({
showWechant: !this.data.showWechant,
});
},
// 保存名片
addPhone() {
let _this = this,
{ clickCount } = this.data;
const { staffName, staffPhone, operation, address, agentName } =
this.data.cardInfo;
wx.addPhoneContact({
firstName: staffName,
mobilePhoneNumber: staffPhone,
title: operation,
organization: '广联数科',
workAddressCountry: "中国",
workAddressState: "广东省",
workAddressCity: "深圳市",
workAddressStreet: "留仙大道3370号南山智园崇文园区1号楼14层",
fail({ errMsg }) {
if (clickCount)
_this.setData({
showAuth: errMsg == "addPhoneContact:fail auth deny",
});
else
_this.setData({
clickCount: 1,
});
},
});
},
/**授权通讯录成功 */
authSuccess() {
this.setData({
flag: true,
unauthorized: false,
});
this.addPhone();
},
/**授权失败 */
authFail() {
this.setData({
unauthorized: true,
flag: true,
});
},
/** 拨打电话 */
callPhone() {
const { staffPhone } = this.data.cardInfo;
if (!staffPhone) {
util.showToast("手机号不存在");
return;
}
wx.makePhoneCall({
phoneNumber: staffPhone,
});
},
shareClick() {
if (this.data.shareDisabled) {
wx.showToast({
title: '正在生成名片缩略图,请稍后分享',
icon: 'none',
duration: 2000
})
}
}
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="user-wrapper">
<view class="user-box">
<view class="user-info" data-item="{{cardInfo}}">
<block wx:if="{{!showWechant}}">
<view class="user-company">
<image class="company-logo" webp src="{{IMGURL}}home/logo.png?v={{img_version}}"></image>
</view>
<view class="user-name">
<view class="name">{{cardInfo.staffName || ''}}</view>
<view class="position">{{cardInfo.operation || ''}}</view>
</view>
<view class="user-phone">
<image class="user-icon" webp src="{{IMGURL}}share/icon-phone.png?v={{img_version}}"></image>
<view>{{cardInfo.staffPhone || ''}}</view>
</view>
<view class="user-address">
<image class="user-icon" webp src="{{IMGURL}}share/icon-address.png?v={{img_version}}"></image>
<view class="address">深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层</view>
</view>
<image class="user-avatar" src="{{cardInfo.image}}" lazy-load></image>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/add-wechat.png?v={{img_version}}"></image>
</block>
<view class="scrm" wx:else>
<image class="srcm-img" show-menu-by-longpress src="{{cardInfo.qrCode}}" lazy-load></image>
<view class="scrm-text">长按识别二维码,免费体验嘀加SCRM</view>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/back-user.png?v={{img_version}}"></image>
</view>
</view>
<image class="user-bg" webp src="{{IMGURL}}home/user-bg.png?v={{img_version}}" />
</view>
<view class="btn-group">
<view class="phone-btn" bindtap="callPhone">
<image class="icon-dial" webp src="{{IMGURL}}home/icon-dial.png?v={{img_version}}"></image>
<view class="phone-text">拨打电话</view>
</view>
<button class="btn-plain btn" bindtap="addPhone">保存名片</button>
<button wx:if="{{shareDisabled}}" class="btn-primary btn" bindtap="shareClick">分享名片</button>
<button wx:else class="btn-primary btn" open-type="share">分享名片</button>
</view>
</view>
<authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}"></authorize>
\ No newline at end of file
.user-wrapper {
padding: 24rpx 32rpx;
background-color: #fff;
z-index: -1;
margin-bottom: 20rpx;
}
.user-info {
height: 416rpx;
padding: 40rpx 52rpx;
border-radius: 16rpx;
box-sizing: border-box;
}
.user-box {
position: relative;
z-index: 1;
border-radius: 16rpx;
box-shadow: 0 12rpx 32rpx 0 rgba(147, 160, 194, .35);
}
.user-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 416rpx;
z-index: -1;
border-radius: 16rpx;
}
.user-company {
display: flex;
align-items: center;
}
.company-logo{
width: 296rpx;
height: 60rpx;
}
.user-company text {
font-size: 18rpx;
line-height: 24rpx;
color: #2d2d33;
margin-left: 16rpx;
}
.user-name {
display: flex;
align-items: baseline;
margin-top: 24rpx;
}
.user-name .name {
font-size: 44rpx;
font-weight: 700;
color: #111111;
line-height: 72rpx;
}
.user-name .position {
font-weight: 400;
font-size: 26rpx;
color: #6E6E7A;
margin-left: 20rpx;
}
.user-phone {
display: flex;
align-items: center;
font-size: 24rpx;
color: #2D2D33;
line-height: 32rpx;
margin-top: 76rpx;
}
.user-icon {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.user-address {
display: flex;
align-items: baseline;
font-size: 24rpx;
color: #2D2D33;
line-height: 32rpx;
margin-top: 16rpx;
}
.user-address .address {
width: 438rpx;
}
.user-avatar {
position: absolute;
width: 128rpx;
height: 128rpx;
border-radius: 8rpx;
top: 48rpx;
right: 36rpx;
}
.add-wechat {
position: absolute;
bottom: 0;
right: 0;
width: 112rpx;
height: 120rpx;
}
.scrm {
text-align: center;
z-index: 1;
}
.srcm-img {
margin-top: 44rpx;
width: 192rpx;
height: 192rpx;
}
.scrm-text {
margin-top: 32rpx;
font-size: 28rpx;
color: #2d2d33;
}
.btn-group {
margin-top: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.phone-btn {
width: 136rpx;
/* height: 88rpx; */
box-sizing: border-box;
text-align: center;
padding: 4rpx 32rpx 4rpx 24rpx;
background: #FFFFFF;
box-shadow: 8rpx 0 16rpx 0 rgba(202,211,230,0.30);
}
.icon-dial {
width: 48rpx;
height: 48rpx;
}
.phone-text {
font-size: 20rpx;
color: #6E6E7A;
}
button::after {
display: none;
}
.btn {
display: inline-flex;
align-items: center;
padding: 12rpx 56rpx;
font-size: 32rpx;
line-height: 48rpx;
border-radius: 8rpx;
float: right;
margin: 0;
height: 48rpx;
box-sizing: content-box;
}
.btn-plain {
color: #5850ff;
border: 2rpx solid #9B96FF;
background-color: #fff;
/* margin-left: 46rpx; */
}
.btn-primary {
color: #FFFFFF;
background: #5850FF;
/* margin-left: 24rpx; */
}
\ No newline at end of file
......@@ -2,7 +2,6 @@
"component": true,
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"user-info": "../UserInfo/UserInfo"
"van-tabs": "@vant/weapp/tabs/index"
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!