Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b2c36343
authored
Sep 08, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
9d449fec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
113 deletions
components/UserInfo/UserInfo.js
components/UserInfo/UserInfo.wxml
pages/tab/index/index.js
pages/tab/index/index.wxml
components/UserInfo/UserInfo.js
View file @
b2c3634
// components/UserInfo/UserInfo.js
// components/UserInfo/UserInfo.js
import
{
import
{
componentsMixin
}
from
"../../mixins/index"
;
componentsMixin
import
util
from
"../../utils/util"
;
}
from
'../../mixins/index'
Component
({
Component
({
behaviors
:
[
componentsMixin
],
behaviors
:
[
componentsMixin
],
/**
/**
* 组件的属性列表
* 组件的属性列表
*/
*/
properties
:
{},
properties
:
{
cardInfo
:
{
type
:
Object
,
observer
(
n
)
{
this
.
setData
({
cardInfo
:
n
,
});
},
},
},
/**
/**
* 组件的初始数据
* 组件的初始数据
*/
*/
data
:
{
data
:
{
showWechant
:
false
showWechant
:
false
,
},
},
/**
/**
...
@@ -22,60 +30,66 @@ Component({
...
@@ -22,60 +30,66 @@ Component({
methods
:
{
methods
:
{
// 添加微信
// 添加微信
addWechat
()
{
addWechat
()
{
console
.
log
(
112
,
this
.
data
.
showWechant
)
console
.
log
(
112
,
this
.
data
.
showWechant
)
;
this
.
setData
({
this
.
setData
({
showWechant
:
!
this
.
data
.
showWechant
showWechant
:
!
this
.
data
.
showWechant
,
})
})
;
console
.
log
(
this
.
data
.
showWechant
)
console
.
log
(
this
.
data
.
showWechant
)
;
},
},
// 保存名片
// 保存名片
addPhone
()
{
addPhone
()
{
let
_this
=
this
,
let
_this
=
this
,
{
{
clickCount
}
=
this
.
data
;
clickCount
const
{
staffName
,
phoneNumber
,
operation
,
address
,
agentName
}
=
}
=
this
.
data
this
.
data
.
cardInfo
;
wx
.
addPhoneContact
({
wx
.
addPhoneContact
({
firstName
:
'石文'
,
firstName
:
staffName
,
mobilePhoneNumber
:
'13274150220'
,
mobilePhoneNumber
:
phoneNumber
,
title
:
'市场总监'
,
title
:
operation
,
organization
:
'广联数科'
,
organization
:
agentName
,
workAddressCountry
:
'中国'
,
workAddressCountry
:
"中国"
,
workAddressState
:
'广东省'
,
workAddressState
:
"广东省"
,
workAddressCity
:
'深圳市'
,
workAddressCity
:
"深圳市"
,
workAddressStreet
:
'留仙大道3370号'
,
workAddressStreet
:
address
,
fail
({
fail
({
errMsg
})
{
errMsg
if
(
clickCount
)
})
{
_this
.
setData
(
{
if
(
clickCount
)
_this
.
setData
({
showAuth
:
errMsg
==
"addPhoneContact:fail auth deny"
,
showAuth
:
errMsg
==
'addPhoneContact:fail auth deny'
});
})
else
else
_this
.
setData
({
_this
.
setData
({
clickCount
:
1
clickCount
:
1
,
})
});
}
}
,
})
})
;
},
},
/**授权通讯录成功 */
/**授权通讯录成功 */
authSuccess
()
{
authSuccess
()
{
this
.
setData
({
this
.
setData
({
flag
:
true
,
flag
:
true
,
unauthorized
:
false
unauthorized
:
false
,
})
})
;
this
.
addPhone
()
this
.
addPhone
()
;
},
},
/**授权失败 */
/**授权失败 */
authFail
()
{
authFail
()
{
this
.
setData
({
this
.
setData
({
unauthorized
:
true
,
unauthorized
:
true
,
flag
:
true
flag
:
true
,
})
})
;
},
},
/** 拨打电话 */
/** 拨打电话 */
callPhone
()
{
callPhone
()
{
console
.
log
(
this
.
data
.
cardInfo
);
const
{
phoneNumber
}
=
this
.
data
.
cardInfo
;
if
(
!
phoneNumber
)
{
util
.
showToast
(
"手机号不存在"
);
return
;
}
wx
.
makePhoneCall
({
wx
.
makePhoneCall
({
phoneNumber
:
'18925261040'
,
})
}
}
})
\ No newline at end of file
\ No newline at end of file
phoneNumber
:
phoneNumber
,
});
},
},
});
components/UserInfo/UserInfo.wxml
View file @
b2c3634
<view class="user-wrapper">
<view class="user-wrapper">
<view class="user-box">
<view class="user-box">
<view class="user-info">
<view class="user-info"
data-item="{{cardInfo}}"
>
<block wx:if="{{!showWechant}}">
<block wx:if="{{!showWechant}}">
<view class="user-company">
<view class="user-company">
<image class="company-logo" src="{{IMGURL}}home/logo.png"></image>
<image class="company-logo" src="{{IMGURL}}home/logo.png"></image>
<text>汽车流通行业数字化运营服务商</text>
<text>汽车流通行业数字化运营服务商</text>
</view>
</view>
<view class="user-name">
<view class="user-name">
<view class="name">
石文
</view>
<view class="name">
{{cardInfo.staffName}}
</view>
<view class="position">
市场总监
</view>
<view class="position">
{{cardInfo.operation}}
</view>
</view>
</view>
<view class="user-phone">
<view class="user-phone">
<image class="user-icon" webp src="{{IMGURL}}home/icon-phone.png"></image>
<image class="user-icon" webp src="{{IMGURL}}home/icon-phone.png"></image>
<view>
13274150220
</view>
<view>
{{cardInfo.agentPhone}}
</view>
</view>
</view>
<view class="user-address">
<view class="user-address">
<image class="user-icon" webp src="{{IMGURL}}home/icon-address.png"></image>
<image class="user-icon" webp src="{{IMGURL}}home/icon-address.png"></image>
<view class="address">深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层</view>
<view class="address">深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层</view>
</view>
</view>
<image class="user-avatar" src="
https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg"
></image>
<image class="user-avatar" src="
{{cardInfo.image}}" lazy-load
></image>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/add-wechat.png"></image>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/add-wechat.png"></image>
</block>
</block>
<view class="scrm" wx:else>
<view class="scrm" wx:else>
<image class="srcm-img"
src="https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg"
></image>
<image class="srcm-img"
webp src="{{cardInfo.wechatCode}}" lazy-load
></image>
<view class="scrm-text">长按识别二维码,免费体验嘀加SCRM</view>
<view class="scrm-text">长按识别二维码,免费体验嘀加SCRM</view>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/back-user.png"></image>
<image bindtap="addWechat" class="add-wechat" webp src="{{IMGURL}}home/back-user.png"></image>
</view>
</view>
...
@@ -38,5 +38,4 @@
...
@@ -38,5 +38,4 @@
<button class="btn-primary btn" open-type="share">分享名片</button>
<button class="btn-primary btn" open-type="share">分享名片</button>
</view>
</view>
</view>
</view>
<authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}">
</authorize>
\ No newline at end of file
\ No newline at end of file
<authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}"></authorize>
\ No newline at end of file
\ No newline at end of file
pages/tab/index/index.js
View file @
b2c3634
...
@@ -10,7 +10,7 @@ import { menuMixin } from "../../../mixins/index";
...
@@ -10,7 +10,7 @@ import { menuMixin } from "../../../mixins/index";
import
Draw
from
"../../../utils/Draw"
;
import
Draw
from
"../../../utils/Draw"
;
import
{
ssoApi
,
entmicroApi
}
from
"../../../api/api"
;
import
{
ssoApi
,
entmicroApi
}
from
"../../../api/api"
;
import
util
from
"../../../utils/util"
;
import
util
from
"../../../utils/util"
;
import
{
trackData
}
from
'../../../utils/data'
import
{
trackData
}
from
"../../../utils/data"
;
Page
({
Page
({
behaviors
:
[
menuMixin
],
behaviors
:
[
menuMixin
],
/**
/**
...
@@ -49,7 +49,7 @@ Page({
...
@@ -49,7 +49,7 @@ Page({
hasPhoneNumber
:
false
,
hasPhoneNumber
:
false
,
curTab
:
[
trackData
.
COMPANY
,
trackData
.
CUBE
],
curTab
:
[
trackData
.
COMPANY
,
trackData
.
CUBE
],
// 员工名片信息
// 员工名片信息
cardInfo
:
[]
cardInfo
:
{},
},
},
introduce
(
e
)
{
introduce
(
e
)
{
const
curTabIndex
=
e
.
currentTarget
.
dataset
.
index
;
const
curTabIndex
=
e
.
currentTarget
.
dataset
.
index
;
...
@@ -59,13 +59,13 @@ Page({
...
@@ -59,13 +59,13 @@ Page({
switch
(
curTabIndex
)
{
switch
(
curTabIndex
)
{
case
2
:
case
2
:
console
.
log
(
"跳转直播"
);
console
.
log
(
"跳转直播"
);
wx
.
$Track
.
sendTrack
(
trackData
.
VIDEO
)
wx
.
$Track
.
sendTrack
(
trackData
.
VIDEO
)
;
break
;
break
;
default
:
default
:
this
.
setData
({
this
.
setData
({
curTabIndex
:
curTabIndex
,
curTabIndex
:
curTabIndex
,
});
});
wx
.
$Track
.
sendTrack
(
this
.
data
.
curTab
[
this
.
data
.
curTabIndex
])
wx
.
$Track
.
sendTrack
(
this
.
data
.
curTab
[
this
.
data
.
curTabIndex
])
;
}
}
},
},
...
@@ -78,44 +78,45 @@ Page({
...
@@ -78,44 +78,45 @@ Page({
getPhoneNumber
()
{
getPhoneNumber
()
{
console
.
log
(
11111111
);
console
.
log
(
11111111
);
this
.
setData
({
this
.
setData
({
hasPhoneNumber
:
true
hasPhoneNumber
:
true
,
})
})
;
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
console
.
log
(
this
.
data
.
hasUserInfo
);
console
.
log
(
this
.
data
.
hasUserInfo
);
getApp
().
login
().
then
(({
data
})
=>
{
getApp
()
console
.
log
(
data
);
.
login
()
if
(
data
)
{
.
then
(({
data
})
=>
{
this
.
setData
({
console
.
log
(
data
);
hasUserInfo
:
true
if
(
data
)
{
})
this
.
setData
({
}
hasUserInfo
:
true
,
if
(
data
.
phone
)
{
});
this
.
setData
({
}
hasPhoneNumber
:
true
if
(
data
.
phone
)
{
})
this
.
setData
({
}
else
{
hasPhoneNumber
:
true
,
this
.
getCardDetail
()
});
}
}
else
{
})
this
.
getCardDetail
();
}
});
},
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
*/
onReady
()
{
onReady
()
{},
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{
this
.
setShareInfo
();
this
.
setShareInfo
();
console
.
log
(
wx
.
$util
.
getUserInfo
())
console
.
log
(
wx
.
$util
.
getUserInfo
())
;
wx
.
$Track
.
sendTrack
(
this
.
data
.
curTab
[
this
.
data
.
curTabIndex
])
wx
.
$Track
.
sendTrack
(
this
.
data
.
curTab
[
this
.
data
.
curTabIndex
])
;
},
},
/**
/**
...
@@ -269,48 +270,46 @@ Page({
...
@@ -269,48 +270,46 @@ Page({
},
},
// 获取用户昵称
// 获取用户昵称
getUserProfile
(
e
)
{
getUserProfile
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
;
this
.
setData
({
this
.
setData
({
hasUserInfo
:
true
hasUserInfo
:
true
,
})
})
;
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx
.
getUserProfile
({
wx
.
getUserProfile
({
desc
:
"用于完善资料"
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
desc
:
"用于完善资料"
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
this
.
data
.
hasUserInfo
)
console
.
log
(
this
.
data
.
hasUserInfo
)
;
ssoApi
.
authUserInfo
({
ssoApi
.
..
res
.
authUserInfo
({
}).
then
(({
...
res
,
code
})
})
=>
{
.
then
(({
code
})
=>
{
if
(
code
==
'0'
)
{
if
(
code
==
"0"
)
{
getApp
().
login
().
then
(({
getApp
()
data
.
login
()
})
=>
{
.
then
(({
data
})
=>
{
this
.
setData
({
this
.
setData
({
userInfo
:
data
,
userInfo
:
data
,
// hasUserInfo: true
// hasUserInfo: true
})
});
})
});
}
}
})
});
}
}
,
})
})
;
},
},
// 获取员工名片信息
// 获取员工名片信息
getCardDetail
()
{
getCardDetail
()
{
const
sessionId
=
util
.
getSessionId
();
const
sessionId
=
util
.
getSessionId
();
let
params
=
{};
let
params
=
{};
params
.
cardId
=
21
;
params
.
cardId
=
21
;
params
.
sessionId
=
sessionId
;
params
.
sessionId
=
sessionId
;
console
.
log
(
params
,
"+++"
);
console
.
log
(
params
,
"+++"
);
entmicroApi
.
getCardDetail
(
params
).
then
((
res
)
=>
{
entmicroApi
.
getCardDetail
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
if
(
res
.
data
)
{
if
(
res
.
data
)
{
}
}
});
});
},
}
});
})
pages/tab/index/index.wxml
View file @
b2c3634
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<import src="../../template/equity/equity" />
<import src="../../template/equity/equity" />
<import src="../../template/clue/clue" /> -->
<import src="../../template/clue/clue" /> -->
<view class="main-box">
<view class="main-box">
<user-info
data
="{{cardInfo}}"></user-info>
<user-info
cardInfo
="{{cardInfo}}"></user-info>
<view class="main-bottom">
<view class="main-bottom">
<!-- 面向渠道 -->
<!-- 面向渠道 -->
<template is="channel"></template>
<template is="channel"></template>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment