Authored by hongweigao

品牌拍讯

@@ -160,7 +160,7 @@ const getBrandViewList = (channel, start, length) => { @@ -160,7 +160,7 @@ const getBrandViewList = (channel, start, length) => {
160 let res = yield brandApi.getBrandListData(switchParams.channelType); 160 let res = yield brandApi.getBrandListData(switchParams.channelType);
161 161
162 let result = [], 162 let result = [],
163 - navigation = []; 163 + numResult = {};
164 164
165 if (!res || res.code !== 200) { 165 if (!res || res.code !== 200) {
166 return result; 166 return result;
@@ -195,12 +195,18 @@ const getBrandViewList = (channel, start, length) => { @@ -195,12 +195,18 @@ const getBrandViewList = (channel, start, length) => {
195 listTmp.push(brandItem); 195 listTmp.push(brandItem);
196 196
197 }); 197 });
198 - navigation.push(key);  
199 198
  199 + if (key.match(/\d+/g)) {
  200 + numResult = {// 把0-9提出来
  201 + key: key,
  202 + val: _.sortBy(listTmp, 'name')// 对name排序
  203 + };
  204 + } else {
200 result.push({ 205 result.push({
201 key: key, 206 key: key,
202 val: _.sortBy(listTmp, 'name')// 对name排序 207 val: _.sortBy(listTmp, 'name')// 对name排序
203 }); 208 });
  209 + }
204 }); 210 });
205 211
206 } 212 }
@@ -208,15 +214,15 @@ const getBrandViewList = (channel, start, length) => { @@ -208,15 +214,15 @@ const getBrandViewList = (channel, start, length) => {
208 // 只取部分数据 214 // 只取部分数据
209 let begin; 215 let begin;
210 216
211 -  
212 if (start) { 217 if (start) {
213 begin = (start - 1) ? (start - 1) : 0; 218 begin = (start - 1) ? (start - 1) : 0;
214 begin = (begin > 0) ? begin : 0; 219 begin = (begin > 0) ? begin : 0;
215 result = length ? result.slice(begin, length + begin) : result.slice(begin); 220 result = length ? result.slice(begin, length + begin) : result.slice(begin);
216 } 221 }
217 222
218 - result.navigation = navigation;  
219 - 223 + result = _.sortBy(result, 'key');// A-Z排序
  224 + result.push(numResult); // 0-9放到最后
  225 + result.navigation = _.map(result, 'key');
220 return result; 226 return result;
221 })(); 227 })();
222 }; 228 };