Authored by 陈峰

Merge branch 'feature/brandtreeView' into 'release/5.5'

品牌品类树view代码修改



See merge request !357
@@ -171,13 +171,13 @@ const _processCateData = (list, channel, appType) => { @@ -171,13 +171,13 @@ const _processCateData = (list, channel, appType) => {
171 }; 171 };
172 }); 172 });
173 173
174 - _.map(list, function(item, key) { 174 + _.forEach(list, function(item, key) {
175 item.focus = key === channelNav[channel]; 175 item.focus = key === channelNav[channel];
176 176
177 - _.map(item, function(firstItem) { 177 + _.forEach(item, function(firstItem) {
178 // 如果有二级菜单,二级菜单跳转,否则一级菜单跳转 178 // 如果有二级菜单,二级菜单跳转,否则一级菜单跳转
179 if (firstItem.sub && firstItem.sub.length) { 179 if (firstItem.sub && firstItem.sub.length) {
180 - _.map(firstItem.sub, function(secondItem) { 180 + _.forEach(firstItem.sub, function(secondItem) {
181 secondItem.url = helpers.urlFormat('/', { 181 secondItem.url = helpers.urlFormat('/', {
182 sort: _.get(secondItem, 'relation_parameter.sort'), 182 sort: _.get(secondItem, 'relation_parameter.sort'),
183 sort_name: secondItem.category_name, 183 sort_name: secondItem.category_name,
@@ -241,10 +241,11 @@ const indexData = (gender, brandCode, channel, appType) => { @@ -241,10 +241,11 @@ const indexData = (gender, brandCode, channel, appType) => {
241 } 241 }
242 242
243 if (result[1]) { 243 if (result[1]) {
  244 +
244 _.forEach(result[1], function(data) { 245 _.forEach(result[1], function(data) {
245 - if (data.focus_type && data.focus_type === '1') { 246 + if (data.focus_type === '1') {
246 brandList.bannerTop = data; 247 brandList.bannerTop = data;
247 - } else if (data.focus_type && data.focus_type === '2') { 248 + } else if (data.focus_type === '2') {
248 brandList.focusData = data.data; 249 brandList.focusData = data.data;
249 } 250 }
250 }); 251 });
@@ -274,12 +275,10 @@ const brandListData = (code, gender) => { @@ -274,12 +275,10 @@ const brandListData = (code, gender) => {
274 275
275 if (result[0]) { 276 if (result[0]) {
276 _.forEach(result[0], function(data) { 277 _.forEach(result[0], function(data) {
277 - if (data.focus_type && data.focus_type === '1') { 278 + if (data.focus_type === '1') {
278 brandList.bannerTop = data; 279 brandList.bannerTop = data;
279 - } else if (data.focus_type && data.focus_type === '2') { 280 + } else if (data.focus_type === '2') {
280 brandList.focusData = data.data; 281 brandList.focusData = data.data;
281 - } else if (data.template_name === 'single_image') {  
282 - brandList.bannerTop = data;  
283 } 282 }
284 }); 283 });
285 } 284 }