Authored by lijing

个人中心增加资源位

... ... @@ -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}}
... ...
... ... @@ -319,4 +319,14 @@
font-size: 16PX;
}
}
.res-c {
img {
width: 100%;
}
.thumb-row {
padding-top: 0;
}
}
}
... ...
... ... @@ -2,3 +2,5 @@
@import "product/detail/recommend-for-you";
@import "common/good";
@import "channel/footer-tab";
@import "channel/thumb-row";
@import "channel/divide-image";
... ...