Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
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 e40050e3
authored
Dec 07, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:分享人手机号
1 parent
fcdb815b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
pages/tab/index/components/indexProduct/indexProduct.js
pages/viewProd/index.js
pages/viewProd/index.wxml
utils/share.js
pages/tab/index/components/indexProduct/indexProduct.js
View file @
e40050e
...
...
@@ -201,6 +201,7 @@ Component({
},
checkProd
(
e
)
{
let
{
tabActive
}
=
this
.
data
;
//登录的用户手机号
let
userInfo
=
wx
.
$storage
.
get
(
"userInfo"
);
// let item = e.currentTarget.dataset.item
let
index
=
e
.
currentTarget
.
dataset
.
index
;
...
...
pages/viewProd/index.js
View file @
e40050e
...
...
@@ -23,9 +23,10 @@ Page({
img_version
:
'0.1.0'
,
// 是否授权昵称
hasUserInfo
:
false
,
phone
:
''
,
//授权手机号
//
phone: '', //授权手机号
prodItemVideo
:
''
,
//选中的场景下的video的第一个
activeUrl
:
''
,
// 1.3场景才有的活动配置
sharephone
:
''
//主要微信用户,服务商
},
// 计算属性
computed
:
{
...
...
@@ -53,12 +54,12 @@ Page({
this
.
getActiveApiFn
()
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
actNum
,
activeNavIdx
,
isShare
,
phone
}
=
options
let
{
actNum
,
activeNavIdx
,
isShare
,
share
phone
}
=
options
this
.
setData
({
actNum
,
activeNavIdx
,
isShare
,
phone
share
phone
});
//分享数据
...
...
@@ -78,7 +79,7 @@ Page({
// console.log('shareOpenId: ', shareOpenId);
// &shareOpenId=${shareOpenId}
this
.
shareQuery
=
`sceneCode=
${
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
phone
=
$
{
phone
}
`
this
.
shareQuery
=
`sceneCode=
${
senceItem
?.
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
sharephone
=
$
{
share
phone
}
`
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
...
...
@@ -99,7 +100,7 @@ Page({
this.setData({
actNum, //选中的场景下标
activeNavIdx, //选中的产品
phone //联系电话
sharephone:phone //联系电话 (登陆的用户)
});
// 设置转发标题
...
...
@@ -126,7 +127,7 @@ Page({
shareOpenId = wx_user_info.openId || ''
// &shareOpenId=
${
shareOpenId
}
this.shareQuery = `
sceneCode
=
$
{
senceData
[
actNum
].
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
phone
=
$
{
phone
}
`
this.shareQuery = `
sceneCode
=
$
{
senceData
[
actNum
].
sceneCode
}
&
productCode
=
$
{
item
?.
productCode
}
&
isShare
=
$
{
true
}
&
productDesc
=
$
{
item
?.
productName
}
&
category
=
$
{
item
?.
category
}
&
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
share
phone
=
$
{
phone
}
`
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
productCode: item?.productCode,
...
...
@@ -264,7 +265,7 @@ Page({
// console.log('userInfo: ', userInfo);
let { phone } = result;
wx.$storage.set('authphone', phone)
//
console.log('phone: ', phone);
console.log('phone: ', phone);
wx.$storage.set("wx_user_info", {
...userInfo,
phone,
...
...
@@ -273,13 +274,15 @@ Page({
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
//触发浏览埋点
this.onLoad(null)
},300)
this.setData({
showLeft: true
})
//触发浏览埋点
this.onLoad(null)
})
.catch(({ errMsg }) => {
...
...
pages/viewProd/index.wxml
View file @
e40050e
...
...
@@ -24,7 +24,7 @@
<glsx-image webp src="index/phone.png" class="icon"></glsx-image>
请联系我
<view style="color:#3666fe">
{{phone}}
{{
share
phone}}
</view>
</view>
</block>
...
...
utils/share.js
View file @
e40050e
...
...
@@ -88,9 +88,9 @@ class Share {
}
}
}
getCommonData
()
{
const
WXUSERINFO
=
wx
.
$storage
.
get
(
'wx_user_info'
),
USERINFO
=
wx
.
$storage
.
get
(
'userInfo'
)
getCommonData
()
{
const
WXUSERINFO
=
wx
.
$storage
.
get
(
'wx_user_info'
),
//针对没登录用户,有openid
USERINFO
=
wx
.
$storage
.
get
(
'userInfo'
)
//这个是针对登录的
return
{
WXUSERINFO
,
USERINFO
...
...
@@ -110,10 +110,10 @@ class Share {
unionId
:
WXUSERINFO
.
unionId
||
''
,
nickName
:
WXUSERINFO
.
nickName
||
''
,
avatar
:
WXUSERINFO
.
avatarUrl
||
''
,
phone
:
USERINFO
.
phone
||
''
,
phone
:
WXUSERINFO
.
phone
||
''
,
//浏览用户授权的手机号
merchantId
:
thisPage
.
merchantId
||
USERINFO
.
merchantId
||
''
,
shareOpenId
:
thisPage
.
shareOpenId
||
WXUSERINFO
.
openId
||
''
,
sharePhone
:
thisPage
.
sharePhone
||
USERINFO
.
phone
||
''
,
sharePhone
:
thisPage
.
sharePhone
||
USERINFO
.
phone
||
''
,
//登陆人,服务商的手机号
...
shareTrackData
})
}
...
...
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