Commit b5afaf37 by 李嘉林

兼容不同场景分享埋点

parent 6703bca1
...@@ -248,8 +248,6 @@ export default { ...@@ -248,8 +248,6 @@ export default {
} }
this.page = ""; this.page = "";
this.params = ""; this.params = "";
// 记录分销员分享商品信息
this.saveSpokesmanShareGoodsLog();
} else if (options.from && options.from == "h5login") { } else if (options.from && options.from == "h5login") {
let params = JSON.parse(options.params); let params = JSON.parse(options.params);
log.info(params.sessionid,'--------------h5login--params') log.info(params.sessionid,'--------------h5login--params')
...@@ -343,10 +341,7 @@ export default { ...@@ -343,10 +341,7 @@ export default {
login.get_open_id_by_code({ code: res.code}).then(res1 => { login.get_open_id_by_code({ code: res.code}).then(res1 => {
log.info('get_open_id_by_code',res1) log.info('get_open_id_by_code',res1)
if (res1.data.code == 200) { if (res1.data.code == 200) {
wx.setStorageSync({ wx.setStorageSync("openid", res1.data.data);
key: "openid",
data: res1.data.data
});
// 新华优选埋点 // 新华优选埋点
if (app.trackSetOpenid) { if (app.trackSetOpenid) {
app.trackSetOpenid(res1.data.data); app.trackSetOpenid(res1.data.data);
...@@ -391,6 +386,8 @@ export default { ...@@ -391,6 +386,8 @@ export default {
params += "&"+i+'='+paramsObj[i] params += "&"+i+'='+paramsObj[i]
} }
this.params += params this.params += params
log.info("存入商品分享日志", this.page + this.params);
this.saveSpokesmanShareGoodsLog(this.page + this.params);
} }
}).catch((err)=>{ }).catch((err)=>{
this.withoutScene = true; this.withoutScene = true;
...@@ -449,6 +446,12 @@ export default { ...@@ -449,6 +446,12 @@ export default {
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数 // var query = options.query.dentistId; // 参数二维码传递过来的场景参数
} }
this.newPageUrl = this.pageUrl; 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(); this.init();
}, },
onShow(){ onShow(){
...@@ -613,16 +616,31 @@ export default { ...@@ -613,16 +616,31 @@ export default {
url = beforeUrl + nextUrl; url = beforeUrl + nextUrl;
return url; return url;
}, },
saveSpokesmanShareGoodsLog() { saveSpokesmanShareGoodsLog(link) {
let query = { let query = {};
spokesmanGroupId: getQueryVariable(this.link, "spokesmanGroupId") || "", if(getQueryVariable(link, "spokesmanGroupId")) {
spokesmanRelId: getQueryVariable(this.link, "spokesmanRelId") || "", query.spokesmanGroupId = getQueryVariable(link, "spokesmanGroupId")
userId: getQueryVariable(this.link, "userId") || "", }
productId: getQueryVariable(this.link, "productId") || "", if(getQueryVariable(link, "spokesmanRelId")) {
terminalProductId: getQueryVariable(this.link, "terminalProductId") || "", query.spokesmanRelId = getQueryVariable(link, "spokesmanRelId")
mixid: getQueryVariable(this.link, "mixid") || "", }
spokesmanShopId: getQueryVariable(this.link, "spokesmanShopId") || "", if(getQueryVariable(link, "userId")) {
timeStamp: getQueryVariable(this.link, "timeStamp") || "", 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) console.log("saveSpokesmanShareGoodsLog", query)
goods.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