|
@@ -12,6 +12,9 @@ const singleAPI = global.yoho.SingleAPI; |
|
@@ -12,6 +12,9 @@ const singleAPI = global.yoho.SingleAPI; |
12
|
const helpers = global.yoho.helpers;
|
12
|
const helpers = global.yoho.helpers;
|
13
|
const _ = require('lodash');
|
13
|
const _ = require('lodash');
|
14
|
const crypto = global.yoho.crypto;
|
14
|
const crypto = global.yoho.crypto;
|
|
|
15
|
+const service = global.yoho.ServiceAPI;
|
|
|
16
|
+const utils = '../../../utils';
|
|
|
17
|
+const resourcesProcess = require(`${utils}/resources-process`);
|
15
|
|
18
|
|
16
|
/**
|
19
|
/**
|
17
|
* 个人详情数据
|
20
|
* 个人详情数据
|
|
@@ -92,6 +95,24 @@ const _getAddressData = (params) => { |
|
@@ -92,6 +95,24 @@ const _getAddressData = (params) => { |
92
|
}
|
95
|
}
|
93
|
};
|
96
|
};
|
94
|
|
97
|
|
|
|
98
|
+// 资源位
|
|
|
99
|
+const _getRes = () => {
|
|
|
100
|
+ return service.get('/operations/api/v5/resource/home', {
|
|
|
101
|
+ content_code: '5d05d443a557783b1489d328c127e9bf',
|
|
|
102
|
+ }).then(result => {
|
|
|
103
|
+ if (result && result.code === 200 && result.data && result.data.list) {
|
|
|
104
|
+ for (let item of result.data.list) {
|
|
|
105
|
+ item.template_name === 'single_image' &&
|
|
|
106
|
+ item.data.length === 1 &&
|
|
|
107
|
+ (item.singleOne = true);
|
|
|
108
|
+ }
|
|
|
109
|
+ return resourcesProcess(result.data.list);
|
|
|
110
|
+ } else {
|
|
|
111
|
+ return result;
|
|
|
112
|
+ }
|
|
|
113
|
+ });
|
|
|
114
|
+};
|
|
|
115
|
+
|
95
|
/**
|
116
|
/**
|
96
|
* 个人中心首页
|
117
|
* 个人中心首页
|
97
|
* @param params
|
118
|
* @param params
|
|
@@ -116,7 +137,8 @@ const index = (params) => { |
|
@@ -116,7 +137,8 @@ const index = (params) => { |
116
|
_noticeData(),
|
137
|
_noticeData(),
|
117
|
_favoriteData(params),
|
138
|
_favoriteData(params),
|
118
|
_infoNum(params),
|
139
|
_infoNum(params),
|
119
|
- _getAddressData(params)
|
140
|
+ _getAddressData(params),
|
|
|
141
|
+ _getRes()
|
120
|
]).then(result => {
|
142
|
]).then(result => {
|
121
|
if (result[0] && result[0].data) {
|
143
|
if (result[0] && result[0].data) {
|
122
|
Object.assign(finalResult, {
|
144
|
Object.assign(finalResult, {
|
|
@@ -167,6 +189,10 @@ const index = (params) => { |
|
@@ -167,6 +189,10 @@ const index = (params) => { |
167
|
});
|
189
|
});
|
168
|
}
|
190
|
}
|
169
|
|
191
|
|
|
|
192
|
+ if (result[5]) {
|
|
|
193
|
+ finalResult.content = result[5];
|
|
|
194
|
+ }
|
|
|
195
|
+
|
170
|
return finalResult;
|
196
|
return finalResult;
|
171
|
});
|
197
|
});
|
172
|
};
|
198
|
};
|