Authored by htoooth

Merge remote-tracking branch 'origin/release/5.2' into release/5.2

... ... @@ -265,7 +265,7 @@
{{/if}}
</li>
<li>
<span id="use-coin" class="use-coin coin-trigger">使用YOHO币支付</span>
<span id="use-coin" class="use-coin coin-trigger">使用有货币支付</span>
<div class="using-coin coin-trigger hide">
<ul>
... ...
... ... @@ -89,16 +89,18 @@ const handleBrandCheckedData = (params, origin) => {
// 分拆品牌参数
let brands = _.split(params.brand, ',');
let intBrands = [];
let brandTotalName = '';
_.forEach(brands, value => {
intBrands.push(parseInt(value, 10));
});
let checkedCount = 0;
let checkedCount = 0,
brandsTotalName = '';
// 遍历品牌数据,如果在参数中,那么加 checked,将此数据加入到 checked 数组中
if (!_.isEmpty(origin)) {
brandsTotalName = _.map(origin, 'name').join('、');
_.forEach(origin, (value) => {
if (typeof _.find(intBrands, o => {
return _.isEqual(o, +value.id);
... ... @@ -139,10 +141,10 @@ const handleBrandCheckedData = (params, origin) => {
// 建议保留,需要品牌可以单个删除时放开注释即可
// dest.push(checked);
brandTotalName += checked.name + '、';
dest[0].totalName = brandTotalName;
dest[0].totalName = brandsTotalName;
}
});
}
return dest;
};
... ...
... ... @@ -164,7 +164,9 @@
<script type="text/html" id="simple-account-info-tpl">
<div class="account-info-header">
<div class="user-img">
<img src="\{{headIco}}">
\{{#if headIco}}
<img src="\{{headIco}}">
\{{/if}}
</div>
<div class="user-name">
<a href="//www.yohobuy.com/home?t=\{{random}}">\{{profileName}}</a>
... ...
... ... @@ -103,6 +103,7 @@
$prevswitch.data('disable', false);
$nextswitch.data('disable', false);
});
options.yasFun($arrow);
} else {
$prevswitch.data('disable', false);
$nextswitch.data('disable', false);
... ...
... ... @@ -21,10 +21,11 @@ function _getCommonFilterValue() {
$attrchecked.each(function() {
var $this = $(this);
var key = $this.parents('.attr-content').prev().html(),
name = $this.attr('name');
filterValue += key + name + ';';
filterValue += key.replace(new RegExp(/()/g), ':') + name + ';';
});
return filterValue;
... ...
... ... @@ -43,6 +43,9 @@ var $saleReturn = $('#saleReturn');
var dialogTpl = require('hbs/product/coupon-dialog.hbs');
var $goodsIdArr = [],
pageNum = 1;
function productUrl(s) {
return window.location.href + '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"' + s + '"}}';
}
... ... @@ -1044,22 +1047,21 @@ function randomString(len) {
/*
* 页面加载完
*/
function initPageYas() {
var $goodsIdArr = [],
loadYas = {};
function initPageYas(pNum) {
var loadYas = {},
starIndex = (parseInt(pNum, 10) - 1) * 5,
endIndex = parseInt(pNum, 10) * 5;
$('.recommend-slider .img-item .goods-id').each(function() {
$goodsIdArr.push($(this).html());
});
var pageGoods = $goodsIdArr.slice(starIndex, endIndex);
loadYas = {
REC_POSE: 100013,
REC_ID: randomString(40),
PRD_ID: $goodsIdArr.join(','),
PRD_NUM: $goodsIdArr.length,
PRD_ID: pageGoods.join(','),
PRD_NUM: pageGoods.length,
ORDER_CODE: '',
ACTION_ID: 0,
PAGE_NUM: 1
PAGE_NUM: pNum
};
... ... @@ -1067,6 +1069,22 @@ function initPageYas() {
yas.givePoint('YB_CHOOSE_FOR_YOU_Y', loadYas);
}
/*
* 左右箭头埋点
*/
function arrowYas($arrow) {
var totalPage = Math.ceil($goodsIdArr.length / 5);
if ($arrow.hasClass('prev') && pageNum > 1) {
pageNum--;
}
if ($arrow.hasClass('next') && pageNum < totalPage) {
pageNum++;
}
initPageYas(pageNum);
}
// 店铺推荐
function loadRecommend() {
$.ajax({
... ... @@ -1094,7 +1112,12 @@ function loadRecommend() {
$('#recommend-content').append(html);
$('.recommend-slider').slider2({
shownum: 5,
isCircle: false
isCircle: false,
yasFun: arrowYas
});
$('.recommend-slider .img-item .goods-id').each(function() {
$goodsIdArr.push($(this).html());
});
} else {
$('.individual-comment').find('.block-title .title:first-child').addClass('hide');
... ... @@ -1103,26 +1126,30 @@ function loadRecommend() {
}
// 页面加载完,埋点
initPageYas();
initPageYas(pageNum);
// 点击为您推荐商品埋点
$('.recommend-slider .img-item').click(function() {
var $this = $(this);
var index = parseInt($this.index(), 10) + 1;
var page = index / 5 <= 1 ? '' : Math.ceil(index / 5) + '';
var num = index % 5 ? index % 5 + '' : '5';
var loadYas = {
REC_POSE: 100013,
REC_ID: randomString(40),
PRD_ID: $this.find('.goods-id').html(),
PRD_NUM: parseInt($this.index(), 10) + 1,
PRD_NUM: page + num,
ORDER_CODE: '',
ACTION_ID: 1,
PAGE_NUM: 1
PAGE_NUM: page === '' ? 1 : page
};
// 关键词搜索结果页展示时
yas.givePoint('YB_CHOOSE_FOR_YOU_Y', loadYas);
});
});
}
... ...
... ... @@ -44,7 +44,7 @@ lazyLoad($('img.lazy'), {
});
qs = window.queryString();
commonParams = {
PAGE_NUM: qs.pager || 1,
PAGE_NUM: qs.page || 1,
FILTER_VALUE: filterValue,
L1_SORT: $leftLi.length > 0 ? $leftLi.parent().prev().attr('title') : '',
L2_SORT: $leftLi.find('a').attr('title') || '',
... ... @@ -97,7 +97,7 @@ $('.good-item-wrapper').click(function() {
var $this = $(this),
proId = $this.find('.product-id').html(),
aIndex = $this.attr('activeIndex'),
pageNum = qs.pager || 1,
pageNum = qs.page || 1,
limit = qs.limit || 60,
proNum = (parseInt(pageNum, 10) - 1) * limit + parseInt(aIndex, 10),
shelveTime = $this.find('.shelve-time').html();
... ...