...
|
...
|
@@ -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;
|
|
|
});
|
|
|
};
|
...
|
...
|
|