Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
周少峰
8 years ago
Commit
103cd44d7837e1155933649517e5ac97c8448987
2 parents
946a82f6
88409152
Merge branch 'hotfix/pinyin'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
6 deletions
apps/cart/models/address.js
apps/cart/models/province-pinyin.js
package.json
apps/cart/models/address.js
View file @
103cd44
...
...
@@ -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
;
});
};
...
...
apps/cart/models/province-pinyin.js
0 → 100644
View file @
103cd44
module
.
exports
=
{
'北京市'
:
'b'
,
'天津市'
:
't'
,
'河北省'
:
'h'
,
'山西省'
:
's'
,
'内蒙古自治区'
:
'n'
,
'辽宁省'
:
'l'
,
'吉林省'
:
'j'
,
'黑龙江省'
:
'h'
,
'上海市'
:
's'
,
'江苏省'
:
'j'
,
'浙江省'
:
'z'
,
'安徽省'
:
'a'
,
'福建省'
:
'f'
,
'江西省'
:
'j'
,
'山东省'
:
's'
,
'河南省'
:
'h'
,
'湖北省'
:
'h'
,
'湖南省'
:
'h'
,
'广东省'
:
'g'
,
'广西壮族自治区'
:
'g'
,
'海南省'
:
'h'
,
'重庆市'
:
'c'
,
'四川省'
:
's'
,
'贵州省'
:
'g'
,
'云南省'
:
'y'
,
'西藏自治区'
:
'x'
,
'陕西省'
:
's'
,
'甘肃省'
:
'g'
,
'青海省'
:
'q'
,
'宁夏回族自治区'
:
'n'
,
'新疆维吾尔自治区'
:
'x'
};
...
...
package.json
View file @
103cd44
...
...
@@ -56,7 +56,6 @@
"passport-sina"
:
"^0.1.0"
,
"passport-strategy"
:
"1.x.x"
,
"passport-weixin"
:
"^0.1.0"
,
"pinyin-converter"
:
"^2.8.1"
,
"request-ip"
:
"^1.2.2"
,
"request-promise"
:
"^3.0.0"
,
"serve-favicon"
:
"^2.3.0"
,
...
...
Please
register
or
login
to post a comment