Showing
1 changed file
with
55 additions
and
36 deletions
@@ -172,60 +172,79 @@ const getSizeInfo = (sizeInfo) => { | @@ -172,60 +172,79 @@ const getSizeInfo = (sizeInfo) => { | ||
172 | 172 | ||
173 | // 模特试穿, 竖着输出排列显示 | 173 | // 模特试穿, 竖着输出排列显示 |
174 | if (!_.isEmpty(sizeInfo.modelBos)) { | 174 | if (!_.isEmpty(sizeInfo.modelBos)) { |
175 | - dest.reference = {}; | ||
176 | - dest.reference.title = '模特试穿'; | ||
177 | - dest.reference.enTitle = 'REFERENCE'; | ||
178 | - dest.reference.detail = {}; | ||
179 | - dest.reference.detail.list = []; | 175 | + let reference = { |
176 | + title: '模特试穿', | ||
177 | + enTitle: 'REFERENCE' | ||
178 | + }; | ||
179 | + | ||
180 | + dest.reference = reference; | ||
180 | 181 | ||
181 | // 控制是否显示备注 | 182 | // 控制是否显示备注 |
182 | let showRemark = false; | 183 | let showRemark = false; |
183 | - let remarkList = []; | ||
184 | - | ||
185 | - remarkList[0] = {}; | ||
186 | - remarkList[0].param = '备注'; | ||
187 | - | ||
188 | - for (let i = 0; i < 7; i++) { | ||
189 | - dest.reference.detail.list[i] = {}; | ||
190 | - dest.reference.detail.list[i].params = []; | ||
191 | - dest.reference.detail.list[i].params[0] = {}; | ||
192 | - } | ||
193 | - | ||
194 | - dest.reference.detail.list[0].params[0] && (dest.reference.detail.list[0].params[0].param = ''); | ||
195 | - dest.reference.detail.list[1].params[0] && (dest.reference.detail.list[1].params[0].param = '模特'); | ||
196 | - dest.reference.detail.list[2].params[0] && (dest.reference.detail.list[2].params[0].param = '身高'); | ||
197 | - dest.reference.detail.list[3].params[0] && (dest.reference.detail.list[3].params[0].param = '体重'); | ||
198 | - dest.reference.detail.list[4].params[0] && (dest.reference.detail.list[4].params[0].param = '三围'); | ||
199 | - dest.reference.detail.list[5].params[0] && (dest.reference.detail.list[5].params[0].param = '吊牌尺码'); | ||
200 | - dest.reference.detail.list[6].params[0] && (dest.reference.detail.list[6].params[0].param = '试穿描述'); | 184 | + let remarkList = [{ |
185 | + param: '备注' | ||
186 | + }]; | ||
201 | 187 | ||
188 | + let detail = { | ||
189 | + list: [{ | ||
190 | + params: [{ | ||
191 | + param: '' | ||
192 | + }] | ||
193 | + }, { | ||
194 | + params: [{ | ||
195 | + param: '模特' | ||
196 | + }] | ||
197 | + }, { | ||
198 | + params: [{ | ||
199 | + param: '身高' | ||
200 | + }] | ||
201 | + }, { | ||
202 | + params: [{ | ||
203 | + param: '体重' | ||
204 | + }] | ||
205 | + }, { | ||
206 | + params: [{ | ||
207 | + param: '三围' | ||
208 | + }] | ||
209 | + }, { | ||
210 | + params: [{ | ||
211 | + param: '吊牌尺码' | ||
212 | + }] | ||
213 | + }, { | ||
214 | + params: [{ | ||
215 | + param: '试穿描述' | ||
216 | + }] | ||
217 | + }] | ||
218 | + }; | ||
219 | + | ||
220 | + reference.detail = detail; | ||
202 | _.forEach(sizeInfo.modelBos, function(value) { | 221 | _.forEach(sizeInfo.modelBos, function(value) { |
203 | - dest.reference.detail.list[0].params.push({ | 222 | + detail.list[0].params.push({ |
204 | param: value.avatar.replace('http://', '//') | 223 | param: value.avatar.replace('http://', '//') |
205 | }); | 224 | }); |
206 | - dest.reference.detail.list[1].params.push({ | 225 | + detail.list[1].params.push({ |
207 | param: value.modelName | 226 | param: value.modelName |
208 | }); | 227 | }); |
209 | - dest.reference.detail.list[2].params.push({ | 228 | + detail.list[2].params.push({ |
210 | param: value.height | 229 | param: value.height |
211 | }); | 230 | }); |
212 | - dest.reference.detail.list[3].params.push({ | 231 | + detail.list[3].params.push({ |
213 | param: value.weight | 232 | param: value.weight |
214 | }); | 233 | }); |
215 | - dest.reference.detail.list[4].params.push({ | 234 | + detail.list[4].params.push({ |
216 | param: value.vitalStatistics | 235 | param: value.vitalStatistics |
217 | }); | 236 | }); |
218 | - dest.reference.detail.list[5].params.push({ | ||
219 | - param: value.fitModelBo.fit_size | 237 | + detail.list[5].params.push({ |
238 | + param: value.fitModelBo && value.fitModelBo.fit_size | ||
220 | }); | 239 | }); |
221 | - dest.reference.detail.list[6].params.push({ | ||
222 | - param: value.fitModelBo.feel | 240 | + detail.list[6].params.push({ |
241 | + param: value.fitModelBo && value.fitModelBo.feel | ||
223 | }); | 242 | }); |
224 | 243 | ||
225 | - if (value.fitModelBo.fit_remark) { | 244 | + if (value.fitModelBo && value.fitModelBo.fit_remark) { |
226 | showRemark = true; | 245 | showRemark = true; |
227 | remarkList.push({ | 246 | remarkList.push({ |
228 | - param: value.fitModelBo.fit_remark | 247 | + param: value.fitModelBo && value.fitModelBo.fit_remark |
229 | }); | 248 | }); |
230 | } else { | 249 | } else { |
231 | remarkList.push({ | 250 | remarkList.push({ |
@@ -236,8 +255,8 @@ const getSizeInfo = (sizeInfo) => { | @@ -236,8 +255,8 @@ const getSizeInfo = (sizeInfo) => { | ||
236 | 255 | ||
237 | // 显示模特备注 | 256 | // 显示模特备注 |
238 | if (showRemark) { | 257 | if (showRemark) { |
239 | - dest.reference.detail.list[7] = {}; | ||
240 | - dest.reference.detail.list[7].params = remarkList; | 258 | + detail.list[7] = {}; |
259 | + detail.list[7].params = remarkList; | ||
241 | } | 260 | } |
242 | 261 | ||
243 | } | 262 | } |
-
Please register or login to post a comment