Commit d5c96507 by chenwq

分享埋点

1 parent f3bd924f
......@@ -82,29 +82,29 @@ Page({
// console.log(this.data.senceData, 'senceData-----')
const senceList = productData[this.data.actNum].filter(item => item.name != '全部')
var proInfo = {}
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = senceList[i]?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
proInfo = senceList[i].productList.find(k => k.id == activeNavIdx)
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
sceneCode: item.sceneCode
})
break
}
}
this.setData({
proInfo
})
// console.log(this.data.proInfo, '---------proInfo')
// 设置转发标题
let userInfoObj = wx.$storage.get("userInfo")
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name = userInfoObj.merchantName
this.shareTitle = `${name}给你分享一个活动${proInfo.productName},戳我参与~`
this.shareTitle = `${name}给你分享一个活动${this.data.proInfo.productName},戳我参与~`
//分享数据
let item = proInfo
let item = this.data.proInfo || {}
// console.log('title2',item.productName)
setTimeout(() => {
utils.setNavigationBarTitle(item.productName)
......@@ -114,9 +114,9 @@ Page({
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
this.shareQuery = `sceneCode=${senceData[actNum].sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}`
this.shareQuery = `sceneCode=${this.data.sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}`
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
sceneCode: this.data.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
......@@ -173,7 +173,7 @@ Page({
// 是否已经查看详情
this.isgetAuthphone()
if (!options || utils.isEmptyObj(options)) return
let { actNum, activeNavIdx, isShare,sharephone } = options
let { actNum = 0, activeNavIdx = 0, isShare = true,sharephone = 123 } = options
if(isShare){
wx.hideHomeButton()
}
......@@ -185,26 +185,35 @@ Page({
sharephone
});
//分享数据
let senceItem = senceData[actNum]
let item = senceData[actNum]?.productList[activeNavIdx]
console.log('title',item.productName)
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: " "+item.productName,
// });
utils.setNavigationBarTitle(item.productName)
},100)
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
// 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}&sharephone=${sharephone}`
const senceList = productData[this.data.actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = senceList[i]?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
console.log(proInfo)
this.setData({
proInfo,
sceneCode: item.sceneCode
})
break
}
}
//分享数据
let item = this.data.proInfo || {}
setTimeout(() => {
utils.setNavigationBarTitle(item?.productName)
},100)
this.shareQuery = `sceneCode=${this.data.sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${sharephone}`
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
sceneCode: this.data.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
......
......@@ -75,6 +75,7 @@ const scenario_0 = [
sceneImgs: sceneImgs0,
// 产品详情图片
productImgs: productImgs0,
"sceneCode":"SC001",
productList: [
{
id: 0,
......@@ -134,6 +135,7 @@ const scenario_1 = [
name: '膜类',
sceneImgs: sceneImgs1,
productImgs: productImgs1,
"sceneCode":"SC002",
productList: [
{
id: 0,
......@@ -185,6 +187,7 @@ const scenario_2 = [
name: '膜类',
sceneImgs: sceneImgs2,
productImgs: productImgs2,
"sceneCode":"SC003",
productList: [
{
id: 0,
......@@ -301,6 +304,7 @@ const posterList3 = [
const scenario_3 = [
{
name: '美容类',
"sceneCode":"SC004",
productList: [
{
id: 0,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!