Authored by 马力

埋点需求

... ... @@ -124,4 +124,6 @@ module.exports=function(app) {
app.post("/netSale/saveProductUrlList","netsale_saveProductUrlList");
/*立即比价商品链接*/
app.post("/ChannelProductController/synChannelProduct","netsale_synChannelProduct");
/*商品操作的埋点请求*/
app.post("/product/addProductOperateLog","netsale_addProductOperateLog");
}
\ No newline at end of file
... ...
... ... @@ -421,6 +421,15 @@ module.exports={
{name: 'url', type: 'string'},
{name: 'type', type: 'number'}
]
},
addProductOperateLog:{
title:'商品操作日志埋点请求',
url: '/product/addProductOperateLog',
params: [
{name: 'productSkn', type: 'number'},
{name: 'operateType', type: 'number'},
{name: 'jsondata', type: 'string'}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -121,7 +121,7 @@
<label class="col-sm-1 control-label">推荐短语:</label>
[[if renderType=='edit']]
<div class="col-sm-11">
<textarea id="phrase" class="form-control" placeholder="推荐短语" type="text" value="[[phrase]]" rows="4"> [[phrase]]</textarea>
<textarea id="phrase" class="form-control" placeholder="推荐短语" type="text" value="[[phrase]]" rows="4">[[phrase]]</textarea>
</div>
[[else]]
<div class="col-sm-11">
... ...
... ... @@ -86,6 +86,7 @@ var basicInfohtml = '',
//alert('basic:' + JSON.stringify(basicInfo));
var basicInfoTmp = JSON.stringify(basicInfo);
basicInfoTmp = JSON.parse(basicInfoTmp);
var oldphrase = productExtBo.phrase + '';
/*
* 基本信息value值转换
* @param: basicInfo(请求的要渲染的数据), obj(转换的对象)
... ... @@ -259,6 +260,10 @@ $('#saveBasicInfo').on('click', function() {
seasons:common.util.__input('seasons')
}
})
if (sknOperateLog(common.util.__input('phrase'), oldphrase)) {
oldphrase = common.util.__input('phrase');
}
})
// var e = new common.edit('#basicInfoWrap');
// e.init();
... ... @@ -290,4 +295,25 @@ $('#saveBasicInfo').on('click', function() {
// data.shopIds = data.shopIds ? data.shopIds.split('|').join(',') : '';
// return data;
// }
// });
\ No newline at end of file
// });
// 埋点请求
function sknOperateLog(newValue, oldValue) {
if ((newValue && newValue.trim() != oldValue) || (oldValue != '' && newValue == '')) {
var jsondata = {};
jsondata.new = newValue;
jsondata.old = oldValue;
common.util.__ajax({
url:'/product/addProductOperateLog',
data:{
productSkn:basicInfo.productSkn,
jsondata : JSON.stringify(jsondata),
operateType : 6
}
},null, true);
return true;
}
return false;
}
\ No newline at end of file
... ...
... ... @@ -57,9 +57,9 @@ if (window.NETSALEDATA) {
});
var taobaoUrl = window.NETSALEDATA.productUrlBo.taobaoUrl || "";
var tmallUrl = window.NETSALEDATA.productUrlBo.tmallUrl || "";
var jdUrl = window.NETSALEDATA.productUrlBo.jdUrl || "";
var oldtaobaoUrl = taobaoUrl = window.NETSALEDATA.productUrlBo.taobaoUrl || "";
var oldtmallUrl = tmallUrl = window.NETSALEDATA.productUrlBo.tmallUrl || "";
var oldjdUrl = jdUrl = window.NETSALEDATA.productUrlBo.jdUrl || "";
$("#taobaoUrl").val(taobaoUrl);
$("#tmallUrl").val(tmallUrl);
$("#jdUrl").val(jdUrl);
... ... @@ -95,6 +95,17 @@ if (window.NETSALEDATA) {
linkExistFlag : $("#linkExistFlag").val()
}
});
if (sknOperateLog(taobaoUrl, oldtaobaoUrl, 7)) {
oldtaobaoUrl = taobaoUrl;
}
if (sknOperateLog(tmallUrl, oldtmallUrl, 8)) {
oldtmallUrl = tmallUrl;
}
if (sknOperateLog(jdUrl, oldjdUrl, 9)) {
oldjdUrl = jdUrl;
}
return false;
});
... ... @@ -280,4 +291,26 @@ if (window.NETSALEDATA) {
}
//当点击“无需测量”,该列输入框不可编辑
common.sizeInfo.check();
\ No newline at end of file
common.sizeInfo.check();
// 埋点请求
function sknOperateLog(newValue, oldValue, operateType) {
if ((newValue && newValue.trim() != oldValue) || (oldValue != '' && newValue == '')) {
var jsondata = {};
jsondata.new = newValue;
jsondata.old = oldValue;
common.util.__ajax({
url:'/product/addProductOperateLog',
data:{
productSkn:window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,
jsondata : JSON.stringify(jsondata),
operateType : operateType
}
},null, true);
return true;
}
return false;
}
\ No newline at end of file
... ...