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