Authored by 马力

buried

@@ -434,6 +434,22 @@ var util = { @@ -434,6 +434,22 @@ var util = {
434 result=data; 434 result=data;
435 } 435 }
436 return result; 436 return result;
  437 + },
  438 + // 埋点请求 如果埋点成功则返回true
  439 + __sknOperateLog(productSkn, newValue, oldValue, operateType) {
  440 + if ((newValue && newValue.trim() != oldValue) || (oldValue != '' && newValue == '')) {
  441 + util.__ajax({
  442 + url:'/product/addProductOperateLog',
  443 + data:{
  444 + productSkn:productSkn,
  445 + updateBeforeValue : oldValue?oldValue:'',
  446 + updateAfterValue : newValue?newValue:'',
  447 + operateType : operateType
  448 + }
  449 + },null, true);
  450 + return true;
  451 + }
  452 + return false;
437 } 453 }
438 } 454 }
439 module.exports = util; 455 module.exports = util;
@@ -261,7 +261,7 @@ $('#saveBasicInfo').on('click', function() { @@ -261,7 +261,7 @@ $('#saveBasicInfo').on('click', function() {
261 } 261 }
262 }) 262 })
263 263
264 - if (sknOperateLog(common.util.__input('phrase'), oldphrase)) { 264 + if (common.util.__sknOperateLog(basicInfo.productSkn, common.util.__input('phrase'), oldphrase, 6)) {
265 oldphrase = common.util.__input('phrase'); 265 oldphrase = common.util.__input('phrase');
266 } 266 }
267 }) 267 })
@@ -296,22 +296,3 @@ $('#saveBasicInfo').on('click', function() { @@ -296,22 +296,3 @@ $('#saveBasicInfo').on('click', function() {
296 // return data; 296 // return data;
297 // } 297 // }
298 // }); 298 // });
299 -  
300 -// 埋点请求  
301 -function sknOperateLog(newValue, oldValue) {  
302 - if ((newValue && newValue.trim() != oldValue) || (oldValue != '' && newValue == '')) {  
303 - common.util.__ajax({  
304 - url:'/product/addProductOperateLog',  
305 - data:{  
306 - productSkn:basicInfo.productSkn,  
307 - updateBeforeValue : oldValue?oldValue:'',  
308 - updateAfterValue : newValue?newValue:'',  
309 - operateType : 6  
310 - }  
311 - },null, true);  
312 -  
313 - return true;  
314 - }  
315 -  
316 - return false;  
317 -}  
@@ -96,13 +96,13 @@ if (window.NETSALEDATA) { @@ -96,13 +96,13 @@ if (window.NETSALEDATA) {
96 } 96 }
97 }); 97 });
98 98
99 - if (sknOperateLog(taobaoUrl, oldtaobaoUrl, 7)) { 99 + if (common.util.__sknOperateLog(window.NETSALEDATA.baseProductInfo.baseProduct.productSkn, taobaoUrl, oldtaobaoUrl, 7)) {
100 oldtaobaoUrl = taobaoUrl; 100 oldtaobaoUrl = taobaoUrl;
101 } 101 }
102 - if (sknOperateLog(tmallUrl, oldtmallUrl, 8)) { 102 + if (common.util.__sknOperateLog(window.NETSALEDATA.baseProductInfo.baseProduct.productSkn, tmallUrl, oldtmallUrl, 8)) {
103 oldtmallUrl = tmallUrl; 103 oldtmallUrl = tmallUrl;
104 } 104 }
105 - if (sknOperateLog(jdUrl, oldjdUrl, 9)) { 105 + if (common.util.__sknOperateLog(window.NETSALEDATA.baseProductInfo.baseProduct.productSkn, jdUrl, oldjdUrl, 9)) {
106 oldjdUrl = jdUrl; 106 oldjdUrl = jdUrl;
107 } 107 }
108 108
@@ -292,23 +292,3 @@ if (window.NETSALEDATA) { @@ -292,23 +292,3 @@ if (window.NETSALEDATA) {
292 292
293 //当点击“无需测量”,该列输入框不可编辑 293 //当点击“无需测量”,该列输入框不可编辑
294 common.sizeInfo.check(); 294 common.sizeInfo.check();
295 -  
296 -  
297 -// 埋点请求  
298 -function sknOperateLog(newValue, oldValue, operateType) {  
299 - if ((newValue && newValue.trim() != oldValue) || (oldValue != '' && newValue == '')) {  
300 - common.util.__ajax({  
301 - url:'/product/addProductOperateLog',  
302 - data:{  
303 - productSkn:window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,  
304 - updateBeforeValue : oldValue?oldValue:'',  
305 - updateAfterValue : newValue?newValue:'',  
306 - operateType : operateType  
307 - }  
308 - },null, true);  
309 -  
310 - return true;  
311 - }  
312 -  
313 - return false;  
314 -}