Commit e40050e3 by luyt

fix:分享人手机号

1 parent fcdb815b
...@@ -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;
......
...@@ -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,sharephone } = options
this.setData({ this.setData({
actNum, actNum,
activeNavIdx, activeNavIdx,
isShare, isShare,
phone sharephone
}); });
//分享数据 //分享数据
...@@ -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=${sharephone}`
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}&sharephone=${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 }) => {
......
...@@ -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}} {{sharephone}}
</view> </view>
</view> </view>
</block> </block>
......
...@@ -88,9 +88,9 @@ class Share { ...@@ -88,9 +88,9 @@ 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
}) })
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!