Commit e40050e3 by luyt

fix:分享人手机号

1 parent fcdb815b
......@@ -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;
......
......@@ -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,sharephone } = options
this.setData({
actNum,
activeNavIdx,
isShare,
phone
sharephone
});
//分享数据
......@@ -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=${sharephone}`
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}&sharephone=${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 }) => {
......
......@@ -24,7 +24,7 @@
<glsx-image webp src="index/phone.png" class="icon"></glsx-image>
请联系我
<view style="color:#3666fe">
{{phone}}
{{sharephone}}
</view>
</view>
</block>
......
......@@ -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
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!