Authored by 陈轩

fix new-arrial埋点

@@ -16,10 +16,12 @@ @@ -16,10 +16,12 @@
16 }} 16 }}
17 17
18 {{!--新入驻品牌--}} 18 {{!--新入驻品牌--}}
19 - {{> new/recommend-brands  
20 - id="new-brands"  
21 - title="新入驻品牌"  
22 - style="new-brands"  
23 - shops=newBrands  
24 - }} 19 + {{#if newBrands}}
  20 + {{> new/recommend-brands
  21 + id="new-brands"
  22 + title="新入驻品牌"
  23 + style="new-brands"
  24 + shops=newBrands
  25 + }}
  26 + {{/if}}
25 </div> 27 </div>
@@ -313,12 +313,21 @@ function _swiperData($item, bool) { @@ -313,12 +313,21 @@ function _swiperData($item, bool) {
313 } 313 }
314 } 314 }
315 315
  316 +
  317 +let order2Cn = {
  318 + s_t_desc: '默认',
  319 + s_p_desc: '价格递减',
  320 + s_p_asc: '价格递增',
  321 + p_d_desc: '折扣递减',
  322 + p_d_asc: '折扣递增'
  323 +};
  324 +
316 // 楼层分析配置 325 // 楼层分析配置
317 let analysisMap = { 326 let analysisMap = {
318 'banner-top': { 327 'banner-top': {
319 container: '.banner-top', // floor容器 328 container: '.banner-top', // floor容器
320 item: '.swiper-slide', // floor item 329 item: '.swiper-slide', // floor item
321 - floorInfo: {F_NAME: 'banner', F_ID: '0'}, // analysis 信息 330 + floorInfo: {F_NAME: 'banner', F_ID: '1'}, // analysis 信息
322 331
323 extraAttrs: _swiperData // 从item 获取 额外字段 332 extraAttrs: _swiperData // 从item 获取 额外字段
324 }, 333 },
@@ -326,7 +335,7 @@ let analysisMap = { @@ -326,7 +335,7 @@ let analysisMap = {
326 'new-recommend': { 335 'new-recommend': {
327 container: '#new-recommend', 336 container: '#new-recommend',
328 item: '.brand-news-count', 337 item: '.brand-news-count',
329 - floorInfo: {F_NAME: '为您推荐', F_ID: '1'}, 338 + floorInfo: {F_NAME: '为您推荐', F_ID: '2'},
330 339
331 extraAttrs: function($item) { 340 extraAttrs: function($item) {
332 return { 341 return {
@@ -339,7 +348,7 @@ let analysisMap = { @@ -339,7 +348,7 @@ let analysisMap = {
339 handpick: { 348 handpick: {
340 container: '#handpick', 349 container: '#handpick',
341 item: '.swiper-slide', 350 item: '.swiper-slide',
342 - floorInfo: {F_NAME: '精选抢先看', F_ID: '2'}, 351 + floorInfo: {F_NAME: '精选抢先看', F_ID: '3'},
343 352
344 extraAttrs: _swiperData 353 extraAttrs: _swiperData
345 }, 354 },
@@ -347,7 +356,7 @@ let analysisMap = { @@ -347,7 +356,7 @@ let analysisMap = {
347 'new-goods': { 356 'new-goods': {
348 container: '#new-goods', 357 container: '#new-goods',
349 item: '.good-info', 358 item: '.good-info',
350 - floorInfo: {F_NAME: '最新上架', F_ID: '3'}, 359 + floorInfo: {F_NAME: '最新上架', F_ID: '4'},
351 360
352 361
353 /** 362 /**
@@ -374,7 +383,7 @@ let analysisMap = { @@ -374,7 +383,7 @@ let analysisMap = {
374 383
375 function tagIndex(arr, $_target) { 384 function tagIndex(arr, $_target) {
376 if ($_target) { 385 if ($_target) {
377 - arr.L_INDEX = $_target.index(); 386 + arr.L_INDEX = $_target.closet('li').index() + 1;
378 } 387 }
379 } 388 }
380 389
@@ -391,7 +400,7 @@ let analysisMap = { @@ -391,7 +400,7 @@ let analysisMap = {
391 handler = li => $(li).data('cate'); 400 handler = li => $(li).data('cate');
392 _attrs = { 401 _attrs = {
393 RECOMMEND_TYPE: 'seasonSort', 402 RECOMMEND_TYPE: 'seasonSort',
394 - CATE_ID: tagsStr($item, handler, $target) 403 + CATE_ID: tagsStr($item, handler, $target) + ''
395 }; 404 };
396 405
397 tagIndex(_attrs, $target); 406 tagIndex(_attrs, $target);
@@ -400,7 +409,7 @@ let analysisMap = { @@ -400,7 +409,7 @@ let analysisMap = {
400 handler = li => $(li).find('a').text(); 409 handler = li => $(li).find('a').text();
401 _attrs = { 410 _attrs = {
402 RECOMMEND_TYPE: 'hotSearchTerm', 411 RECOMMEND_TYPE: 'hotSearchTerm',
403 - KEYWORD_WORD: tagsStr($item, handler, $target) 412 + KEYWORD_WORD: tagsStr($item, handler, $target) + ''
404 }; 413 };
405 414
406 tagIndex(_attrs, $target); 415 tagIndex(_attrs, $target);
@@ -408,19 +417,19 @@ let analysisMap = { @@ -408,19 +417,19 @@ let analysisMap = {
408 case 'hot-shop': 417 case 'hot-shop':
409 _attrs = { 418 _attrs = {
410 RECOMMEND_TYPE: 'hotShop', 419 RECOMMEND_TYPE: 'hotShop',
411 - BRAND_ID: $item.data('brand'),  
412 - SHOP_ID: $item.data('shop') 420 + BRAND_ID: $item.data('brand') + '',
  421 + SHOP_ID: $item.data('shop') + ''
413 }; 422 };
414 break; 423 break;
415 default: 424 default:
416 _attrs = { 425 _attrs = {
417 - PRD_SKN: $item.data('id') 426 + PRD_SKN: $item.data('id') + ''
418 }; 427 };
419 break; 428 break;
420 } 429 }
421 430
422 if ($target) { 431 if ($target) {
423 - _attrs.SORT_NM = search.searchParams.order; 432 + _attrs.SORT_NM = order2Cn[search.searchParams.order];
424 _attrs.FILTER_VALUE = search.searchParams.filter; 433 _attrs.FILTER_VALUE = search.searchParams.filter;
425 } 434 }
426 435
@@ -440,17 +449,17 @@ let {analysisShowData} = analysisWorker(analysisMap, 'YB_NEW_ARRIVAL_FLR_C'); @@ -440,17 +449,17 @@ let {analysisShowData} = analysisWorker(analysisMap, 'YB_NEW_ARRIVAL_FLR_C');
440 $callback.add(function(html, searchParams) { 449 $callback.add(function(html, searchParams) {
441 let pageData = analysisShowData('new-goods', {container: $(`<div>${html}</div>`)}); 450 let pageData = analysisShowData('new-goods', {container: $(`<div>${html}</div>`)});
442 451
443 - pageData.SORT_NM = searchParams.order; 452 + pageData.SORT_NM = order2Cn[searchParams.order];
444 pageData.FILTER_VALUE = searchParams.filter; 453 pageData.FILTER_VALUE = searchParams.filter;
445 454
446 - analysis('YB_SHOW_NEW_ARRIVAL', {data: pageData}); 455 + analysis('YB_SHOW_NEW_ARRIVAL', {DATA: pageData});
447 }); 456 });
448 457
449 $(function() { 458 $(function() {
450 setTimeout(()=> { 459 setTimeout(()=> {
451 // 新品到着页面曝光时的页面数据,异步的单独发 460 // 新品到着页面曝光时的页面数据,异步的单独发
452 analysis('YB_SHOW_NEW_ARRIVAL', { 461 analysis('YB_SHOW_NEW_ARRIVAL', {
453 - data: ['banner-top', 'new-recommend', 'handpick'].map(analysisShowData) 462 + DATA: ['banner-top', 'new-recommend', 'handpick'].map(analysisShowData)
454 }); 463 });
455 }, 1000); 464 }, 1000);
456 }); 465 });
@@ -17,19 +17,19 @@ let analysisMap = { @@ -17,19 +17,19 @@ let analysisMap = {
17 'browse-brands': { 17 'browse-brands': {
18 container: '#browse-brands', 18 container: '#browse-brands',
19 item: '.brand-news-count', 19 item: '.brand-news-count',
20 - floorInfo: {F_NAME: '浏览过的品牌', F_ID: '0'}, 20 + floorInfo: {F_NAME: '浏览过的品牌', F_ID: '1'},
21 extraAttrs 21 extraAttrs
22 }, 22 },
23 'hot-brands': { 23 'hot-brands': {
24 container: '#hot-brands', 24 container: '#hot-brands',
25 item: '.brand-news-count', 25 item: '.brand-news-count',
26 - floorInfo: {F_NAME: '热门品牌', F_ID: '1'}, 26 + floorInfo: {F_NAME: '热门品牌', F_ID: '2'},
27 extraAttrs 27 extraAttrs
28 }, 28 },
29 'new-brands': { 29 'new-brands': {
30 - container: 'new-brands', 30 + container: '#new-brands',
31 item: '.brand-news-count', 31 item: '.brand-news-count',
32 - floorInfo: {F_NAME: '新入驻品牌', F_ID: '2'}, 32 + floorInfo: {F_NAME: '新入驻品牌', F_ID: '3'},
33 extraAttrs 33 extraAttrs
34 } 34 }
35 }; 35 };
@@ -43,7 +43,7 @@ $(function() { @@ -43,7 +43,7 @@ $(function() {
43 setTimeout(()=> { 43 setTimeout(()=> {
44 // 新品到着页面曝光时的页面数据,异步的单独发 44 // 新品到着页面曝光时的页面数据,异步的单独发
45 analysis('YB_SHOW_NEW_ARRIVAL_RECOMMEND', { 45 analysis('YB_SHOW_NEW_ARRIVAL_RECOMMEND', {
46 - data: ['browse-brands', 'hot-brands', 'new-brands'].map(analysisShowData) 46 + DATA: ['browse-brands', 'hot-brands', 'new-brands'].map(analysisShowData)
47 }); 47 });
48 }, 1000); 48 }, 1000);
49 }); 49 });
@@ -62,7 +62,7 @@ body { @@ -62,7 +62,7 @@ body {
62 border-bottom: 1PX solid #dededf; 62 border-bottom: 1PX solid #dededf;
63 } 63 }
64 64
65 -.filter-nav:first-child .down{ 65 +.filter-nav li:first-child .down{
66 display: none; 66 display: none;
67 } 67 }
68 68
@@ -15,6 +15,10 @@ @@ -15,6 +15,10 @@
15 display: flex; 15 display: flex;
16 flex-wrap: wrap; 16 flex-wrap: wrap;
17 justify-content: space-between; 17 justify-content: space-between;
  18 +
  19 + &:last-child {
  20 + border-bottom: none;
  21 + }
18 } 22 }
19 23
20 .brand-news-count { 24 .brand-news-count {