Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
2c1080531557ef0784adf2f657a3b7d9ea85cab3
1 parent
c8597c86
extract url param
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
192 deletions
static/js/product/extract-url.js
static/js/product/list.js
static/js/product/newsale/discount.js
static/js/product/newsale/newarrival.js
template/m.yohobuy.com/actions/product/newsale/new.phtml
template/m.yohobuy.com/actions/product/newsale/sale.phtml
template/m.yohobuy.com/partials/product/list.phtml
static/js/product/extract-url.js
0 → 100644
View file @
2c10805
/**
* 提取URL中的参数
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/19
*/
var
opt
=
{};
var
paramStr
=
window
.
location
.
search
.
split
(
'?'
)[
1
];
var
keyVal
=
paramStr
.
split
(
'&'
);
var
i
,
key
,
val
;
for
(
i
=
keyVal
.
length
;
i
>
0
;
i
--
)
{
key
=
keyVal
[
i
-
1
].
split
(
'='
);
val
=
key
[
1
];
key
=
key
[
0
];
//初始化默认参数
switch
(
key
)
{
case
'gender'
:
opt
.
gender
=
val
;
break
;
case
'brand'
:
opt
.
brand
=
val
;
break
;
case
'sort'
:
opt
.
sort
=
val
;
break
;
case
'msort'
:
opt
.
msort
=
val
;
break
;
case
'misort'
:
opt
.
misort
=
val
;
break
;
case
'color'
:
opt
.
color
=
val
;
break
;
case
'size'
:
opt
.
size
=
val
;
break
;
case
'price'
:
opt
.
price
=
val
;
break
;
case
'discount'
:
opt
.
discount
=
val
;
break
;
case
'query'
:
opt
.
query
=
val
;
break
;
case
'style'
:
opt
.
style
=
val
;
break
;
case
'limit'
:
opt
.
limit
=
val
;
break
;
case
'channel'
:
opt
.
channel
=
val
;
break
;
case
'p_d'
:
opt
.
p_d
=
val
;
break
;
case
'dayLimit'
:
opt
.
dayLimit
=
val
;
break
;
}
}
module
.
exports
=
opt
;
\ No newline at end of file
...
...
static/js/product/list.js
View file @
2c10805
...
...
@@ -31,19 +31,7 @@ var $input = $('#search-input input'),
$clear
=
$
(
'#search-input .clear-input'
);
//默认筛选条件
var
defaultOpt
=
{
gender
:
$
(
'#gender'
).
val
(),
brand
:
$
(
'#brand'
).
val
(),
sort
:
$
(
'#sort'
).
val
(),
msort
:
$
(
'#msort'
).
val
(),
misort
:
$
(
'#misort'
).
val
(),
color
:
$
(
'#color'
).
val
(),
size
:
$
(
'#size'
).
val
(),
price
:
$
(
'#price'
).
val
(),
discount
:
$
(
'#discount'
).
val
(),
query
:
$
(
'#query'
).
val
(),
style
:
$
(
'#style'
).
val
()
};
var
defaultOpt
=
require
(
'./extract-url'
);
var
$listNav
=
$
(
'#list-nav'
),
...
...
static/js/product/newsale/discount.js
View file @
2c10805
...
...
@@ -25,18 +25,7 @@ var winH = $(window).height(),
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
//默认筛选条件
var
defaultOpt
=
{
gender
:
$
(
'#gender'
).
val
(),
brand
:
$
(
'#brand'
).
val
(),
sort
:
$
(
'#sort'
).
val
(),
msort
:
$
(
'#msort'
).
val
(),
misort
:
$
(
'#misort'
).
val
(),
color
:
$
(
'#color'
).
val
(),
size
:
$
(
'#size'
).
val
(),
price
:
$
(
'#price'
).
val
(),
discount
:
$
(
'#discount'
).
val
(),
style
:
$
(
'#style'
).
val
()
};
var
defaultOpt
=
require
(
'../extract-url'
);
var
$listNav
=
$
(
'#list-nav'
),
...
...
static/js/product/newsale/newarrival.js
View file @
2c10805
...
...
@@ -28,22 +28,7 @@ var winH = $(window).height(),
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
//默认筛选条件
var
defaultOpt
=
{
gender
:
$
(
'#gender'
).
val
(),
brand
:
$
(
'#brand'
).
val
(),
sort
:
$
(
'#sort'
).
val
(),
msort
:
$
(
'#msort'
).
val
(),
misort
:
$
(
'#misort'
).
val
(),
color
:
$
(
'#color'
).
val
(),
size
:
$
(
'#size'
).
val
(),
price
:
$
(
'#price'
).
val
(),
discount
:
$
(
'#discount'
).
val
(),
limit
:
$
(
'#limit'
).
val
(),
channel
:
$
(
'#channel'
).
val
(),
p_d
:
$
(
'#p_d'
).
val
(),
dayLimit
:
1
,
style
:
$
(
'#style'
).
val
()
};
var
defaultOpt
=
require
(
'../extract-url'
);
var
storeOpt
=
$
.
extend
({},
defaultOpt
);
//存储默认筛选条件以便重置
...
...
template/m.yohobuy.com/actions/product/newsale/new.phtml
View file @
2c10805
...
...
@@ -37,59 +37,6 @@
<div
class=
"container hide clearfix"
></div>
{
{>
filter
}
}
</div>
{
{#if
brand
}
}
<input
id=
"brand"
type=
"hidden"
value=
{
{brand
}
}>
{
{/if
}
}
{
{#if
gender
}
}
<input
id=
"gender"
type=
"hidden"
value=
{
{gender
}
}>
{
{/if
}
}
{
{#if
sort
}
}
<input
id=
"sort"
type=
"hidden"
value=
{
{sort
}
}>
{
{/if
}
}
{
{#if
msort
}
}
<input
id=
"msort"
type=
"hidden"
value=
{
{msort
}
}>
{
{/if
}
}
{
{#if
misort
}
}
<input
id=
"misort"
type=
"hidden"
value=
{
{misort
}
}>
{
{/if
}
}
{
{#if
color
}
}
<input
id=
"color"
type=
"hidden"
value=
{
{color
}
}>
{
{/if
}
}
{
{#if
size
}
}
<input
id=
"size"
type=
"hidden"
value=
{
{size
}
}>
{
{/if
}
}
{
{#if
price
}
}
<input
id=
"price"
type=
"hidden"
value=
{
{price
}
}>
{
{/if
}
}
{
{#if
p_d
}
}
<input
id=
"p_d"
type=
"hidden"
value=
{
{p_d
}
}>
{
{/if
}
}
{
{#if
channel
}
}
<input
id=
"channel"
type=
"hidden"
value=
{
{channel
}
}>
{
{/if
}
}
{
{#if
dayLimit
}
}
<input
id=
"dayLimit"
type=
"hidden"
value=
{
{dayLimit
}
}>
{
{/if
}
}
{
{#if
limit
}
}
<input
id=
"limit"
type=
"hidden"
value=
{
{limit
}
}>
{
{/if
}
}
{
{#if
style
}
}
<input
id=
"style"
type=
"hidden"
value=
{
{style
}
}>
{
{/if
}
}
{
{>
product/suspend-cart
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/newsale/sale.phtml
View file @
2c10805
...
...
@@ -48,59 +48,6 @@
{
{>
filter
}
}
</div>
{
{#if
brand
}
}
<input
id=
"brand"
type=
"hidden"
value=
{
{brand
}
}>
{
{/if
}
}
{
{#if
gender
}
}
<input
id=
"gender"
type=
"hidden"
value=
{
{gender
}
}>
{
{/if
}
}
{
{#if
sort
}
}
<input
id=
"sort"
type=
"hidden"
value=
{
{sort
}
}>
{
{/if
}
}
{
{#if
msort
}
}
<input
id=
"msort"
type=
"hidden"
value=
{
{msort
}
}>
{
{/if
}
}
{
{#if
misort
}
}
<input
id=
"misort"
type=
"hidden"
value=
{
{misort
}
}>
{
{/if
}
}
{
{#if
color
}
}
<input
id=
"color"
type=
"hidden"
value=
{
{color
}
}>
{
{/if
}
}
{
{#if
size
}
}
<input
id=
"size"
type=
"hidden"
value=
{
{size
}
}>
{
{/if
}
}
{
{#if
price
}
}
<input
id=
"price"
type=
"hidden"
value=
{
{price
}
}>
{
{/if
}
}
{
{#if
p_d
}
}
<input
id=
"p_d"
type=
"hidden"
value=
{
{p_d
}
}>
{
{/if
}
}
{
{#if
channel
}
}
<input
id=
"channel"
type=
"hidden"
value=
{
{channel
}
}>
{
{/if
}
}
{
{#if
limit
}
}
<input
id=
"limit"
type=
"hidden"
value=
{
{limit
}
}>
{
{/if
}
}
{
{#if
discount
}
}
<input
id=
"discount"
type=
"hidden"
value=
{
{discount
}
}>
{
{/if
}
}
{
{#if
style
}
}
<input
id=
"style"
type=
"hidden"
value=
{
{style
}
}>
{
{/if
}
}
{
{>
product/suspend-cart
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/list.phtml
View file @
2c10805
...
...
@@ -89,50 +89,5 @@
{
{>
filter
}
}
</div>
{
{#if
brand
}
}
<input
id=
"brand"
type=
"hidden"
value=
{
{brand
}
}>
{
{/if
}
}
{
{#if
gender
}
}
<input
id=
"gender"
type=
"hidden"
value=
{
{gender
}
}>
{
{/if
}
}
{
{#if
sort
}
}
<input
id=
"sort"
type=
"hidden"
value=
{
{sort
}
}>
{
{/if
}
}
{
{#if
msort
}
}
<input
id=
"msort"
type=
"hidden"
value=
{
{msort
}
}>
{
{/if
}
}
{
{#if
misort
}
}
<input
id=
"misort"
type=
"hidden"
value=
{
{misort
}
}>
{
{/if
}
}
{
{#if
color
}
}
<input
id=
"color"
type=
"hidden"
value=
{
{color
}
}>
{
{/if
}
}
{
{#if
size
}
}
<input
id=
"size"
type=
"hidden"
value=
{
{size
}
}>
{
{/if
}
}
{
{#if
price
}
}
<input
id=
"price"
type=
"hidden"
value=
{
{price
}
}>
{
{/if
}
}
{
{#if
discount
}
}
<input
id=
"discount"
type=
"hidden"
value=
{
{discount
}
}>
{
{/if
}
}
{
{#if
query
}
}
<input
id=
"query"
type=
"hidden"
value=
{
{query
}
}>
{
{/if
}
}
{
{#if
style
}
}
<input
id=
"style"
type=
"hidden"
value=
{
{style
}
}>
{
{/if
}
}
{
{>
product/suspend-cart
}
}
{
{/
goodList
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment