Authored by zhangxiaoru

merge feature/brandsTree

@@ -159,7 +159,12 @@ const _getBrandListOriginData = (channel) => { @@ -159,7 +159,12 @@ const _getBrandListOriginData = (channel) => {
159 code: 200, 159 code: 200,
160 cache: true 160 cache: true
161 }).then(result => { 161 }).then(result => {
162 - return Object.assign(finalResult, handleBrandList(result.data.all_list)); 162 + if (result.data && result.data.all_list) {
  163 + return Object.assign(finalResult, handleBrandList(result.data.all_list));
  164 + } else {
  165 + return {};
  166 + }
  167 +
163 }); 168 });
164 }; 169 };
165 170
@@ -240,12 +245,14 @@ const indexData = (gender, brandCode, cateCode) => { @@ -240,12 +245,14 @@ const indexData = (gender, brandCode, cateCode) => {
240 245
241 if (result[1]) { 246 if (result[1]) {
242 _.forEach(result[1], function(data) { 247 _.forEach(result[1], function(data) {
243 - if (data.focus_type === '1') { 248 + if (data.focus_type && data.focus_type === '1') {
244 //brandList.bannerTop = _dealBrandUrl(data); 249 //brandList.bannerTop = _dealBrandUrl(data);
245 brandList.bannerTop = data; 250 brandList.bannerTop = data;
246 - } else if (data.focus_type === '2') { 251 + } else if (data.focus_type && data.focus_type === '2') {
247 //brandList.focusData = _dealBrandUrl(data).data; 252 //brandList.focusData = _dealBrandUrl(data).data;
248 brandList.focusData = data.data; 253 brandList.focusData = data.data;
  254 + } else if (data.template_intro === '一张图片') {
  255 + brandList.bannerTop = data;
249 } 256 }
250 }); 257 });
251 } 258 }
@@ -288,12 +295,14 @@ const brandListData = (code, gender) => { @@ -288,12 +295,14 @@ const brandListData = (code, gender) => {
288 295
289 if (result[0]) { 296 if (result[0]) {
290 _.forEach(result[0], function(data) { 297 _.forEach(result[0], function(data) {
291 - if (data.focus_type === '1') { 298 + if (data.focus_type && data.focus_type === '1') {
292 //brandList.bannerTop = _dealBrandUrl(data); 299 //brandList.bannerTop = _dealBrandUrl(data);
293 brandList.bannerTop = data; 300 brandList.bannerTop = data;
294 - } else if (data.focus_type === '2') { 301 + } else if (data.focus_type && data.focus_type === '2') {
295 //brandList.focusData = _dealBrandUrl(data).data; 302 //brandList.focusData = _dealBrandUrl(data).data;
296 brandList.focusData = data.data; 303 brandList.focusData = data.data;
  304 + } else if (data.template_intro === '一张图片') {
  305 + brandList.bannerTop = data;
297 } 306 }
298 }); 307 });
299 } 308 }