Authored by ccbikai(👎🏻🍜)

Merge branch 'release/5.5.1' of git.yoho.cn:fe/yohobuywap-node into release/5.5.1

... ... @@ -12,6 +12,9 @@ const singleAPI = global.yoho.SingleAPI;
const helpers = global.yoho.helpers;
const _ = require('lodash');
const crypto = global.yoho.crypto;
const service = global.yoho.ServiceAPI;
const utils = '../../../utils';
const resourcesProcess = require(`${utils}/resources-process`);
/**
* 个人详情数据
... ... @@ -92,6 +95,24 @@ const _getAddressData = (params) => {
}
};
// 资源位
const _getRes = () => {
return service.get('/operations/api/v5/resource/home', {
content_code: '5d05d443a557783b1489d328c127e9bf',
}).then(result => {
if (result && result.code === 200 && result.data && result.data.list) {
for (let item of result.data.list) {
item.template_name === 'single_image' &&
item.data.length === 1 &&
(item.singleOne = true);
}
return resourcesProcess(result.data.list);
} else {
return result;
}
});
};
/**
* 个人中心首页
* @param params
... ... @@ -116,7 +137,8 @@ const index = (params) => {
_noticeData(),
_favoriteData(params),
_infoNum(params),
_getAddressData(params)
_getAddressData(params),
_getRes()
]).then(result => {
if (result[0] && result[0].data) {
Object.assign(finalResult, {
... ... @@ -167,6 +189,10 @@ const index = (params) => {
});
}
if (result[5]) {
finalResult.content = result[5];
}
return finalResult;
});
};
... ...
... ... @@ -121,6 +121,13 @@
</a>
</div>
{{! 资源位}}
<div class="res-c">
<div class="resource-content">
{{> content}}
</div>
</div>
{{!--
<div class="group-list">
<a class="list-item" href="/home/onlineService">
... ...
{{#content}}
{{! 中间banner}}
{{#if singleImage}}
<div data-id="{{template_id}}">
{{> resources/banner}}
</div>
{{/if}}
{{! 两个小图}}
{{#if smallPic}}
{{> resources/thumb-row}}
{{/if}}
{{! 分隔楼层}}
{{#if divideImage}}
{{> resources/divide-image}}
{{/if}}
{{/content}}
... ...
{{#if singleOne}}
{{#data}}
<div class="banner-list">
<a href="{{url}}">
<a href="{{url}}" id="{{../template_id}}" name="{{../template_intro}}">
<img src="{{image2 src w=640 h=200 q=60 mode=3}}" alt="">
</a>
</div>
... ... @@ -11,7 +11,7 @@
<ul class="banner-list swiper-wrapper clearfix">
{{#data}}
<li class="swiper-slide">
<a href="{{url}}">
<a href="{{url}}" id="{{../template_id}}" name="{{../template_intro}}">
<img src="{{image2 src w=640 h=200 q=60 mode=3}}" alt="">
</a>
</li>
... ...
<div class="thumb-row">
{{# data}}
<a href="{{url}}">
<a href="{{url}}" id="{{../template_id}}" name="{{../template_intro}}">
<div class="thumb-row-box" style="background-image:url({{image2 src w=275 h=160 q=60}})"></div>
</a>
{{/ data}}
... ...
... ... @@ -12,6 +12,8 @@ var $userAvatar = $('.user-avatar'),
var myImage = new Image(),
avatar;
var Swiper = require('yoho-swiper2');
require('home/index.page.css');
require('../common');
... ... @@ -21,6 +23,14 @@ if ($('.recommend-for-you').length) {
require('../common/suspend-cart');
require('../common/footer');
new Swiper('.banner-center-swiper', {
pagination: '.swiper-pagination',
lazyLoading: true,
lazyLoadingInPrevNext: true,
paginationClickable: true,
autoplay: 3000
});
window.reMarginFooter('.footer-tab');
// 部分老用户没有头像,显示默认头像
... ... @@ -40,3 +50,29 @@ $('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', functio
}).on('touchend touchcancel', '.list-item, .type-item, .order-title', function() {
$(this).removeClass('highlight');
});
// 埋点
$('.res-c').on('click', 'a', function() {
var $this = $(this);
var index = $this.index() + 1;
var pIndex = $this.parent('div').index() + 1;
var url = $this.attr('href');
var name = $this.attr('name');
var id = $this.attr('id');
var status = $this.parent('li').hasClass('swiper-slide');
if (status) {
index = $this.parent('li').index() + 1;
pIndex = 1;
}
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
I_INDEX: index,
F_URL: encodeURIComponent(url),
F_NAME: name,
F_INDEX: pIndex,
F_ID: id
}, true);
}
});
... ...
... ... @@ -319,4 +319,14 @@
font-size: 16PX;
}
}
.res-c {
img {
width: 100%;
}
.thumb-row {
padding-top: 0;
}
}
}
... ...
... ... @@ -2,3 +2,7 @@
@import "product/detail/recommend-for-you";
@import "common/good";
@import "channel/footer-tab";
@import "channel/thumb-row";
@import "channel/divide-image";
@import "channel/banner-center";
@import "layout/swiper";
... ...