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
Email Patches
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
2eb7bdf3fcd6b1a75dc008d077906d5e083fed7a
1 parent
3124a503
处理品牌id中的-
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
apps/product/models/list-handler.js
public/js/plugins/filter.js
utils/parameter.js
apps/product/models/list-handler.js
View file @
2eb7bdf
...
...
@@ -342,7 +342,7 @@ class FilterTools {
_
.
each
(
filter
.
brand
,
brand
=>
{
brands
.
push
({
name
:
brand
.
brand_name
,
href
:
href
.
replace
(
'${brand}'
,
brand
.
id
),
href
:
href
.
replace
(
'${brand}'
,
_
.
replace
(
brand
.
id
,
'-'
,
'__'
)),
// 替换全球购品牌id中-
checked
:
_
.
some
(
brandids
,
bid
=>
_
.
parseInt
(
bid
)
===
brand
.
id
)
});
if
(
brands
.
length
>=
10
)
{
...
...
public/js/plugins/filter.js
View file @
2eb7bdf
...
...
@@ -98,7 +98,7 @@ function uriLoc(attr, val, uri) {
newHref
;
if
(
staticPage
&&
uri
)
{
newHref
=
uri
.
replace
(
'{seat}'
,
val
);
newHref
=
uri
.
replace
(
'{seat}'
,
(
val
+
''
).
replace
(
'-'
,
'__'
)
);
}
else
{
qs
[
attr
]
=
val
;
delete
qs
.
page
;
...
...
@@ -115,7 +115,7 @@ function replceStaticUrl(list, uri) {
if
(
staticPage
&&
uri
)
{
for
(
i
=
0
;
i
<
list
.
length
;
i
++
)
{
list
[
i
].
href
=
uri
.
replace
(
'{seat}'
,
list
[
i
].
id
);
list
[
i
].
href
=
uri
.
replace
(
'{seat}'
,
(
list
[
i
].
id
+
''
).
replace
(
'-'
,
'__'
)
);
}
}
...
...
utils/parameter.js
View file @
2eb7bdf
...
...
@@ -72,7 +72,7 @@ const minPathToFullParam = (path) => {
let
fullKey
=
minToFullMap
[
minKey
];
if
(
fullKey
)
{
obj
[
fullKey
]
=
_
.
replace
(
_
.
replace
(
splitValue
,
minKey
,
''
),
'__'
,
'-'
);
obj
[
fullKey
]
=
_
.
replace
(
_
.
replace
(
splitValue
,
minKey
,
''
),
'__'
,
'-'
);
// 替换value中__
}
});
...
...
@@ -97,7 +97,7 @@ const fullParamToMinPath = (uri, params, newObj, delObj = {}) => {
_
.
forEach
(
transformKey
(
obj
,
true
),
(
value
,
key
)
=>
{
if
(
value
)
{
pathArr
.
push
(
`
$
{
key
}
$
{
_
.
replace
(
value
,
'-'
,
'__'
)}
`
);
pathArr
.
push
(
`
$
{
key
}
$
{
_
.
replace
(
value
,
'-'
,
'__'
)}
`
);
// 替换value中-
}
});
...
...
Please
register
or
login
to post a comment