Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
hf
9 years ago
Commit
f64c2a222f3e39594dfb56df80c4656b97c3dd7e
1 parent
8523326e
do modify category search and goods list filter bugs
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
46 deletions
static/dist/myohobuy/1.2.0/index-debug.js
static/dist/myohobuy/1.2.0/index.js
static/dist/myohobuy/1.2.0/index-debug.js
View file @
f64c2a2
...
...
@@ -1970,6 +1970,7 @@ var $icon = $('.search-icon');
var
$form
=
$
(
'#search-form'
);
var
$history
=
$
(
'.history'
);
var
$historySearch
=
$
(
'.history-search'
);
var
$clearHistory
=
$
(
'#clear-history'
);
...
...
@@ -1984,6 +1985,8 @@ chHammer.on('tap', function() {
localStorage
.
removeItem
(
'historys'
);
$history
.
html
(
''
);
$historySearch
.
hide
();
$clearHistory
.
hide
();
window
.
rePosFooter
();
});
...
...
@@ -2033,7 +2036,7 @@ $('#search').on('touchend', function() {
$history
.
html
(
html
);
$clearHistory
.
removeClass
(
'hide'
);
$historySearch
.
removeClass
(
'hide'
);
window
.
rePosFooter
();
}
}
...
...
@@ -3299,7 +3302,7 @@ var winH = $(window).height(),
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
//默认筛选条件
var
defaultOpt
=
require
(
"js/product/
extract-url
"
);
var
defaultOpt
=
require
(
"js/product/
query-param
"
);
var
storeOpt
=
$
.
extend
({},
defaultOpt
);
//存储默认筛选条件以便重置
...
...
@@ -3844,49 +3847,21 @@ exports.hideFilter = hideFilter;
exports
.
resetFilter
=
resetFilter
;
});
define
(
"js/product/
extract-url"
,
[
],
function
(
require
,
exports
,
module
){
define
(
"js/product/
query-param"
,
[
"jquery"
],
function
(
require
,
exports
,
module
){
/**
* 提取
URL中的
参数
* 提取
查询
参数
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/19
*/
var
opt
=
{};
var
paramStr
=
window
.
location
.
search
.
split
(
'?'
)[
1
];
var
keyVal
=
paramStr
?
paramStr
.
split
(
'&'
)
:
[];
var
i
,
key
,
val
;
for
(
i
=
keyVal
.
length
;
i
>
0
;
i
--
)
{
key
=
keyVal
[
i
-
1
].
split
(
'='
);
val
=
key
[
1
];
key
=
key
[
0
];
//初始化默认参数
opt
[
key
]
=
val
;
var
$
=
require
(
"jquery"
),
opt
=
{};
//discount = p_d,同时需要两个参数
if
(
key
===
'discount'
||
key
===
'p_d'
)
{
opt
.
discount
=
val
;
opt
.
p_d
=
val
;
}
}
$
(
'.query-param'
).
each
(
function
()
{
var
$this
=
$
(
this
);
if
(
typeof
opt
.
gender
===
'undefined'
)
{
switch
(
window
.
cookie
(
'_Channel'
))
{
case
'boys'
:
opt
.
gender
=
'1,3'
;
break
;
case
'girls'
:
opt
.
gender
=
'2,3'
;
break
;
default
:
opt
.
gender
=
'1,2,3'
;
}
}
opt
[
$this
.
data
(
'attr'
)]
=
$this
.
val
();
});
module
.
exports
=
opt
;
});
...
...
@@ -3938,7 +3913,7 @@ var winH = $(window).height(),
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
//默认筛选条件
var
defaultOpt
=
require
(
"js/product/
extract-url
"
);
var
defaultOpt
=
require
(
"js/product/
query-param
"
);
var
$listNav
=
$
(
'#list-nav'
),
...
...
@@ -4324,7 +4299,7 @@ var $input = $('#search-input input'),
$clear
=
$
(
'#search-input .clear-input'
);
//默认筛选条件
var
defaultOpt
=
require
(
"js/product/
extract-url
"
);
var
defaultOpt
=
require
(
"js/product/
query-param
"
);
var
$listNav
=
$
(
'#list-nav'
),
...
...
@@ -4808,13 +4783,13 @@ goodsSwiper = new Swiper('.banner-swiper', {
//初始化goods-discount
if
(
0
===
$
(
'.goodsDiscount .discount-folder'
)
.
children
().
length
)
{
if
(
0
===
$
discountFolder
.
children
().
length
)
{
$discountFolder
.
css
(
'display'
,
'none'
);
$discountArrow
.
html
(
''
);
}
//goods-discount下拉按钮点击事件
if
(
goodsDiscountHammer
)
{
if
(
goodsDiscountHammer
&&
$discountFolder
.
children
().
length
>
0
)
{
goodsDiscountHammer
.
on
(
'tap'
,
function
(
e
)
{
if
(
$discountFolder
.
is
(
':hidden'
))
{
$discountArrow
.
removeClass
(
'icon-down'
).
addClass
(
'icon-up'
).
html
(
''
);
...
...
@@ -4823,7 +4798,6 @@ if (goodsDiscountHammer) {
$discountArrow
.
removeClass
(
'icon-up'
).
addClass
(
'icon-down'
).
html
(
''
);
$discountFolder
.
slideUp
();
}
return
false
;
});
}
...
...
@@ -4949,7 +4923,7 @@ var $ = require("jquery"),
var
commentsNum
,
consultsNum
;
var
consultFooterEle
=
document
.
getElementById
(
'consult-content-footer'
)
,
var
consultFooterEle
=
$
(
'.consult-content-footer'
)[
0
]
,
consultFooterHammer
=
consultFooterEle
&&
new
Hammer
(
consultFooterEle
),
navtabEle
=
document
.
getElementById
(
'nav-tab'
),
...
...
@@ -5008,13 +4982,13 @@ if (navtabHammer) {
if
(
consultFooterHammer
)
{
consultFooterHammer
.
on
(
'tap'
,
function
()
{
location
.
href
=
$
(
consultFooterEle
).
find
(
'a'
).
attr
(
'href'
);
location
.
href
=
$
(
consultFooterEle
).
data
(
'href'
);
});
}
if
(
gotoConsultHammer
)
{
gotoConsultHammer
.
on
(
'tap'
,
function
()
{
location
.
href
=
$
(
gotoConsultEle
).
find
(
'a'
).
attr
(
'href'
);
location
.
href
=
$
(
gotoConsultEle
).
data
(
'href'
);
});
}
...
...
static/dist/myohobuy/1.2.0/index.js
View file @
f64c2a2
This diff could not be displayed because it is too large.
Please
register
or
login
to post a comment