...
|
...
|
@@ -6,10 +6,10 @@ |
|
|
'use strict';
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
const pinyin = require('pinyin-converter');
|
|
|
|
|
|
const crypto = global.yoho.crypto;
|
|
|
|
|
|
const pinyin = require('../models/province-pinyin');
|
|
|
const addressApi = require('../models/address-api');
|
|
|
|
|
|
const worldSort = 'abcdefghijklmnopqrstuvwxyz';
|
...
|
...
|
@@ -20,14 +20,11 @@ const getAreaListData = (id) => { |
|
|
|
|
|
if (id * 1 === 0 && list.length) {
|
|
|
_.forEach(list, value => {
|
|
|
value.initial = _.get(pinyin(value.caption, {
|
|
|
style: pinyin.STYLE_FIRST_LETTER
|
|
|
}), '[0][0]', 'w');
|
|
|
value.initial = pinyin[value.caption] || 'z';
|
|
|
value.pySort = _.indexOf(worldSort, value.initial);
|
|
|
});
|
|
|
result.data = list;
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
});
|
|
|
};
|
...
|
...
|
|