Commit b5afaf37 by 李嘉林

兼容不同场景分享埋点

parent 6703bca1
......@@ -248,8 +248,6 @@ export default {
}
this.page = "";
this.params = "";
// 记录分销员分享商品信息
this.saveSpokesmanShareGoodsLog();
} else if (options.from && options.from == "h5login") {
let params = JSON.parse(options.params);
log.info(params.sessionid,'--------------h5login--params')
......@@ -343,10 +341,7 @@ export default {
login.get_open_id_by_code({ code: res.code}).then(res1 => {
log.info('get_open_id_by_code',res1)
if (res1.data.code == 200) {
wx.setStorageSync({
key: "openid",
data: res1.data.data
});
wx.setStorageSync("openid", res1.data.data);
// 新华优选埋点
if (app.trackSetOpenid) {
app.trackSetOpenid(res1.data.data);
......@@ -391,6 +386,8 @@ export default {
params += "&"+i+'='+paramsObj[i]
}
this.params += params
log.info("存入商品分享日志", this.page + this.params);
this.saveSpokesmanShareGoodsLog(this.page + this.params);
}
}).catch((err)=>{
this.withoutScene = true;
......@@ -449,6 +446,12 @@ export default {
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
this.newPageUrl = this.pageUrl;
console.log('this.newPageUrl', this.newPageUrl)
// 商品分享进入 (卡片分享、扫码、点击小程序链接)
if (this.newPageUrl.includes('/goods/') && (options.share || options.share_copy)) {
log.info("存入商品分享日志", this.newPageUrl);
this.saveSpokesmanShareGoodsLog(this.newPageUrl);
}
this.init();
},
onShow(){
......@@ -613,16 +616,31 @@ export default {
url = beforeUrl + nextUrl;
return url;
},
saveSpokesmanShareGoodsLog() {
let query = {
spokesmanGroupId: getQueryVariable(this.link, "spokesmanGroupId") || "",
spokesmanRelId: getQueryVariable(this.link, "spokesmanRelId") || "",
userId: getQueryVariable(this.link, "userId") || "",
productId: getQueryVariable(this.link, "productId") || "",
terminalProductId: getQueryVariable(this.link, "terminalProductId") || "",
mixid: getQueryVariable(this.link, "mixid") || "",
spokesmanShopId: getQueryVariable(this.link, "spokesmanShopId") || "",
timeStamp: getQueryVariable(this.link, "timeStamp") || "",
saveSpokesmanShareGoodsLog(link) {
let query = {};
if(getQueryVariable(link, "spokesmanGroupId")) {
query.spokesmanGroupId = getQueryVariable(link, "spokesmanGroupId")
}
if(getQueryVariable(link, "spokesmanRelId")) {
query.spokesmanRelId = getQueryVariable(link, "spokesmanRelId")
}
if(getQueryVariable(link, "userId")) {
query.userId = getQueryVariable(link, "userId")
}
if(getQueryVariable(link, "productId")) {
query.productId = getQueryVariable(link, "productId")
}
if(getQueryVariable(link, "terminalProductId")) {
query.terminalProductId = getQueryVariable(link, "terminalProductId")
}
if(getQueryVariable(link, "mixid")) {
query.mixid = getQueryVariable(link, "mixid")
}
if(getQueryVariable(link, "spokesmanShopId")) {
query.spokesmanShopId = getQueryVariable(link, "spokesmanShopId")
}
if(getQueryVariable(link, "timeStamp")) {
query.timeStamp = getQueryVariable(link, "timeStamp")
}
console.log("saveSpokesmanShareGoodsLog", query)
goods.saveSpokesmanShareGoodsLog(query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment