Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
ff028f0a51a591522a4a6a89401c7030892a24a7
1 parent
3cb2ed15
click/touchstart -> tap
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
48 additions
and
48 deletions
static/js/category/index.js
static/js/guang/home.js
static/js/guang/info.js
static/js/guang/plus-star/detail.js
static/js/guang/plus-star/list.js
static/js/index/search.js
static/js/passport/api.js
static/js/passport/back/email-success.js
static/js/passport/back/email.js
static/js/passport/back/mobile.js
static/js/passport/code.js
static/js/passport/login/international.js
static/js/passport/login/login.js
static/js/passport/register/password.js
static/js/passport/register/register.js
static/js/plugin/filter.js
static/js/plugin/tip.js
static/js/product/list.js
static/js/shopping-cart/cart.js
static/js/shopping-cart/chose-panel.js
static/js/shopping-cart/gift-advance.js
static/js/shopping-cart/good.js
static/js/category/index.js
View file @
ff028f0
...
...
@@ -15,7 +15,7 @@ $('#search-input').focus(function() {
$
(
this
).
blur
();
});
$nav
.
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
$nav
.
delegate
(
'li'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
),
index
=
$this
.
index
();
...
...
@@ -30,7 +30,7 @@ $nav.delegate('li', 'touchstart', function() {
$curContent
=
$contents
.
eq
(
index
).
removeClass
(
'hide'
);
});
$
(
'.primary-level'
).
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
$
(
'.primary-level'
).
delegate
(
'li'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
),
index
=
$this
.
index
();
...
...
static/js/guang/home.js
View file @
ff028f0
...
...
@@ -56,7 +56,7 @@ info.initInfosEvt($infoList);
});
}());
$nav
.
delegate
(
'.guang-nav-item'
,
't
ouchstart
'
,
function
()
{
$nav
.
delegate
(
'.guang-nav-item'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
),
$content
,
index
;
...
...
static/js/guang/info.js
View file @
ff028f0
...
...
@@ -45,7 +45,7 @@ function setLazyLoadAndMellipsis($infos) {
* @params $container 逛资讯列表容器
*/
function
initInfosEvt
(
$container
)
{
$container
.
delegate
(
'.like-btn'
,
't
ouchstart
'
,
function
(
e
)
{
$container
.
delegate
(
'.like-btn'
,
't
ap
'
,
function
(
e
)
{
var
$likeBtn
=
$
(
e
.
currentTarget
),
$info
=
$likeBtn
.
closest
(
'.guang-info'
),
opt
=
'ok'
;
...
...
static/js/guang/plus-star/detail.js
View file @
ff028f0
...
...
@@ -37,7 +37,7 @@ setTimeout(function() {
info
.
initInfosEvt
(
$infosContainer
);
//文字介绍收起与展开
$
(
'#more-intro'
).
bind
(
't
ouchstart
'
,
function
()
{
$
(
'#more-intro'
).
bind
(
't
ap
'
,
function
()
{
var
$this
=
$
(
this
);
$this
.
toggleClass
(
'spread'
);
...
...
@@ -56,7 +56,7 @@ $('#more-intro').bind('touchstart', function() {
});
//品牌收藏
$
(
'#brand-like'
).
bind
(
't
ouchstart
'
,
function
(
e
)
{
$
(
'#brand-like'
).
bind
(
't
ap
'
,
function
(
e
)
{
var
opt
=
'ok'
,
$this
=
$
(
this
);
...
...
static/js/guang/plus-star/list.js
View file @
ff028f0
...
...
@@ -20,7 +20,7 @@ mySwiper = new Swiper('.swiper-container', {
pagination
:
'.swiper-pagination'
});
$
(
'#nav-tab'
).
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
$
(
'#nav-tab'
).
delegate
(
'li'
,
't
ap
'
,
function
()
{
if
(
$
(
this
).
hasClass
(
'focus'
))
{
return
;
}
...
...
static/js/index/search.js
View file @
ff028f0
...
...
@@ -6,13 +6,13 @@
var
$
=
require
(
'yoho.zepto'
);
var
$input
=
$
(
'#search-input
>
input'
);
var
$input
=
$
(
'#search-input input'
);
var
$clear
=
$
(
'#search-input
>
.clear-input'
);
var
$clear
=
$
(
'#search-input .clear-input'
);
var
$history
=
$
(
'.history'
);
$
(
'#clear-history'
).
bind
(
't
ouchstart
'
,
function
()
{
$
(
'#clear-history'
).
bind
(
't
ap
'
,
function
()
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/search/clearHistory'
,
...
...
@@ -32,6 +32,6 @@ $input.bind('input', function() {
}
});
$clear
.
bind
(
't
ouchstart
'
,
function
()
{
$clear
.
bind
(
't
ap
'
,
function
()
{
$input
.
val
(
''
).
trigger
(
'input'
);
});
\ No newline at end of file
...
...
static/js/passport/api.js
View file @
ff028f0
...
...
@@ -33,7 +33,7 @@ function bindEyesEvt() {
$hasEye
.
append
(
'<div class="eye close"></div>'
);
$eye
=
$hasEye
.
children
(
'.eye'
);
$eye
.
on
(
't
ouchstart
'
,
function
(
e
)
{
$eye
.
on
(
't
ap
'
,
function
(
e
)
{
var
$this
=
$
(
this
),
$pwd
=
$this
.
siblings
(
'.pwd'
);
...
...
@@ -58,7 +58,7 @@ function bindClearEvt() {
$hasClear
.
append
(
'<div class="clear-input"></div>'
);
$clear
=
$hasClear
.
children
(
'.clear-input'
);
$clear
.
on
(
't
ouchstart
'
,
function
(
e
)
{
$clear
.
on
(
't
ap
'
,
function
(
e
)
{
var
$input
=
$clear
.
siblings
(
'.input'
);
$input
.
val
(
''
).
trigger
(
'input'
).
focus
();
...
...
static/js/passport/back/email-success.js
View file @
ff028f0
...
...
@@ -11,7 +11,7 @@ var $resend = $('#resend');
var
tip
=
require
(
'../../plugin/tip'
),
showErrTip
=
tip
.
show
;
$resend
.
on
(
't
ouchstart
'
,
function
(
e
)
{
$resend
.
on
(
't
ap
'
,
function
(
e
)
{
e
.
preventDefault
();
$
.
ajax
({
...
...
static/js/passport/back/email.js
View file @
ff028f0
...
...
@@ -24,7 +24,7 @@ $email.bind('input', function() {
}
});
$btnSure
.
on
(
't
ouchstart
'
,
function
()
{
$btnSure
.
on
(
't
ap
'
,
function
()
{
var
email
=
trim
(
$email
.
val
());
if
(
$btnSure
.
hasClass
(
'disable'
))
{
...
...
static/js/passport/back/mobile.js
View file @
ff028f0
...
...
@@ -32,7 +32,7 @@ $countrySelect.change(function() {
$areaCode
.
text
(
$countrySelect
.
val
());
});
$btnNext
.
on
(
't
ouchstart
'
,
function
()
{
$btnNext
.
on
(
't
ap
'
,
function
()
{
var
pn
=
trim
(
$phoneNum
.
val
()),
area
=
$countrySelect
.
val
();
...
...
static/js/passport/code.js
View file @
ff028f0
...
...
@@ -45,7 +45,7 @@ module.exports = function(useInRegister) {
});
//重新发送验证码
$captchaTip
.
on
(
't
ouchstart
'
,
function
()
{
$captchaTip
.
on
(
't
ap
'
,
function
()
{
if
(
$captchaTip
.
hasClass
(
'disable'
))
{
return
;
}
...
...
@@ -70,7 +70,7 @@ module.exports = function(useInRegister) {
});
});
$btnNext
.
on
(
't
ouchstart
'
,
function
()
{
$btnNext
.
on
(
't
ap
'
,
function
()
{
if
(
$btnNext
.
hasClass
(
'disable'
))
{
return
;
}
...
...
static/js/passport/login/international.js
View file @
ff028f0
...
...
@@ -64,7 +64,7 @@ $countrySelect.change(function() {
$areaCode
.
text
(
$countrySelect
.
val
());
});
$loginBtn
.
on
(
't
ouchstart
'
,
function
()
{
$loginBtn
.
on
(
't
ap
'
,
function
()
{
var
pn
=
trim
(
$phoneNum
.
val
()),
areaCode
=
$countrySelect
.
val
(),
pwd
=
trim
(
$pwd
.
val
());
...
...
static/js/passport/login/login.js
View file @
ff028f0
...
...
@@ -68,7 +68,7 @@ $pwd.bind('input', function() {
// Login
$loginBtn
.
on
(
't
ouchstart
'
,
function
()
{
$loginBtn
.
on
(
't
ap
'
,
function
()
{
var
acc
=
trim
(
$account
.
val
()),
pwd
=
trim
(
$pwd
.
val
());
...
...
@@ -107,15 +107,15 @@ $loginBtn.on('touchstart', function() {
});
$
(
'#forget-pwd'
).
on
(
't
ouchstart
'
,
function
()
{
$
(
'#forget-pwd'
).
on
(
't
ap
'
,
function
()
{
showRetrivePanel
();
});
$mask
.
on
(
't
ouchstart
'
,
function
()
{
$mask
.
on
(
't
ap
'
,
function
()
{
hideRetrivePanel
();
});
$
(
'#cancel-retrive'
).
on
(
't
ouchstart
'
,
function
(
e
)
{
$
(
'#cancel-retrive'
).
on
(
't
ap
'
,
function
(
e
)
{
e
.
preventDefault
();
hideRetrivePanel
();
});
...
...
static/js/passport/register/password.js
View file @
ff028f0
...
...
@@ -24,7 +24,7 @@ $pwd.bind('input', function() {
}
});
$btnSure
.
on
(
't
ouchstart
'
,
function
()
{
$btnSure
.
on
(
't
ap
'
,
function
()
{
var
pwd
=
trim
(
$pwd
.
val
());
if
(
$btnSure
.
hasClass
(
'disable'
))
{
...
...
static/js/passport/register/register.js
View file @
ff028f0
...
...
@@ -32,7 +32,7 @@ $countrySelect.change(function() {
$areaCode
.
text
(
$countrySelect
.
val
());
});
$btnNext
.
on
(
't
ouchstart
'
,
function
()
{
$btnNext
.
on
(
't
ap
'
,
function
()
{
var
pn
=
trim
(
$phoneNum
.
val
()),
areaCode
=
$countrySelect
.
val
();
...
...
static/js/plugin/filter.js
View file @
ff028f0
...
...
@@ -33,7 +33,7 @@ function registerCbFn(cb) {
$classify
.
children
(
':first-child'
).
addClass
(
'active'
);
//T:不在HTML中使用{{#if @first}}active{{/if}}来初始化active为避免sub设置高度时的闪烁
//classify switch
$classify
.
delegate
(
'.classify-item'
,
't
ouchstart
'
,
function
()
{
$classify
.
delegate
(
'.classify-item'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'active'
))
{
...
...
@@ -46,11 +46,11 @@ $classify.delegate('.classify-item', 'touchstart', function() {
});
//点击Mask隐藏筛选界面
$filter
.
filter
(
'.filter-mask'
).
click
(
function
()
{
$filter
.
filter
(
'.filter-mask'
).
tap
(
function
()
{
hideFilter
();
});
$subClassify
.
delegate
(
'li'
,
'
click
'
,
function
(
e
)
{
$subClassify
.
delegate
(
'li'
,
'
tap
'
,
function
(
e
)
{
var
$this
=
$
(
this
),
id
=
$this
.
data
(
'id'
);
...
...
static/js/plugin/tip.js
View file @
ff028f0
...
...
@@ -17,7 +17,7 @@ var $tip, tipItime;
$
(
'.yoho-page'
).
append
(
tipHtml
);
$tip
=
$
(
'#yoho-tip'
);
$tip
.
on
(
't
ouchstart
'
,
function
()
{
$tip
.
on
(
't
ap
'
,
function
()
{
$tip
.
hide
();
//清除Timeout
...
...
static/js/product/list.js
View file @
ff028f0
...
...
@@ -210,7 +210,7 @@ filter.registerCbFn(search);
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav
.
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
$listNav
.
delegate
(
'li'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
),
nav
,
navType
,
...
...
@@ -309,19 +309,19 @@ $(window).scroll(function() {
});
//品牌介绍
$brandHeader
.
children
(
'.btn-intro'
).
bind
(
't
ouchstart
'
,
function
()
{
$brandHeader
.
children
(
'.btn-intro'
).
bind
(
't
ap
'
,
function
()
{
$introBox
.
removeClass
(
'hide'
);
});
$
(
'.close-intro, .brand-intro-box'
).
click
(
function
()
{
$
(
'.close-intro, .brand-intro-box'
).
tap
(
function
()
{
$introBox
.
addClass
(
'hide'
);
});
$
(
'#brand-intro'
).
click
(
function
(
e
)
{
$
(
'#brand-intro'
).
tap
(
function
(
e
)
{
e
.
stopPropagation
();
});
//品牌收藏
$brandHeader
.
children
(
'.btn-col'
).
bind
(
't
ouchstart
'
,
function
()
{
$brandHeader
.
children
(
'.btn-col'
).
bind
(
't
ap
'
,
function
()
{
$
(
this
).
toggleClass
(
'coled'
);
});
\ No newline at end of file
...
...
static/js/shopping-cart/cart.js
View file @
ff028f0
...
...
@@ -10,7 +10,7 @@ var $cartContent = $('.cart-content');
require
(
'./good'
);
$
(
'.cart-nav'
).
delegate
(
'li'
,
't
ouchstart
'
,
function
()
{
$
(
'.cart-nav'
).
delegate
(
'li'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'active'
))
{
...
...
static/js/shopping-cart/chose-panel.js
View file @
ff028f0
...
...
@@ -37,7 +37,7 @@ function remove() {
$
(
'.chose-panel'
).
remove
();
}
$
(
'.yoho-page'
).
delegate
(
'.chose-panel'
,
't
ouchstart
'
,
function
(
e
)
{
$
(
'.yoho-page'
).
delegate
(
'.chose-panel'
,
't
ap
'
,
function
(
e
)
{
var
$cur
=
$
(
e
.
target
);
if
(
$cur
.
closest
(
'.main'
).
length
>
0
)
{
...
...
@@ -46,10 +46,10 @@ $('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
//点击蒙版消失
remove
();
}).
delegate
(
'#chose-btn-sure'
,
't
ouchstart
'
,
function
()
{
}).
delegate
(
'#chose-btn-sure'
,
't
ap
'
,
function
()
{
//确定
}).
delegate
(
'.block'
,
't
ouchstart
'
,
function
()
{
}).
delegate
(
'.block'
,
't
ap
'
,
function
()
{
//尺寸颜色点选
var
$this
=
$
(
this
);
...
...
@@ -60,7 +60,7 @@ $('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
$this
.
siblings
(
'.chosed'
).
removeClass
(
'chosed'
);
$this
.
addClass
(
'chosed'
);
}).
delegate
(
'.btn-minus'
,
't
ouchstart
'
,
function
()
{
}).
delegate
(
'.btn-minus'
,
't
ap
'
,
function
()
{
var
num
=
+
$num
.
val
();
if
(
num
===
1
)
{
...
...
@@ -68,7 +68,7 @@ $('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
}
$num
.
val
(
num
-
1
);
}).
delegate
(
'.btn-plus'
,
't
ouchstart
'
,
function
()
{
}).
delegate
(
'.btn-plus'
,
't
ap
'
,
function
()
{
var
num
=
+
$num
.
val
();
//TODO:库存数验证
...
...
static/js/shopping-cart/gift-advance.js
View file @
ff028f0
...
...
@@ -11,7 +11,7 @@ var chosePanel = require('./chose-panel');
lazyLoad
(
$
(
'.lazy'
));
$
(
'.gift-advance-page'
).
delegate
(
'.chose'
,
't
ouchstart
'
,
function
()
{
$
(
'.gift-advance-page'
).
delegate
(
'.chose'
,
't
ap
'
,
function
()
{
var
id
=
$
(
this
).
closest
(
'.gift-advance-good'
).
data
(
'id'
);
$
.
ajax
({
...
...
static/js/shopping-cart/good.js
View file @
ff028f0
...
...
@@ -17,12 +17,12 @@ function docTouchEvt(e) {
$
(
'.opt-panel:not(.hide)'
).
addClass
(
'hide'
);
//
$
(
document
).
unbind
(
't
ouchstart
'
,
docTouchEvt
);
$
(
document
).
unbind
(
't
ap
'
,
docTouchEvt
);
}
}
// function unbindDocTouchEvt(e) {
// $(document).unbind('t
ouchstart
', docTouchEvt);
// $(document).unbind('t
ap
', docTouchEvt);
// }
ellipsis
.
init
();
...
...
@@ -32,7 +32,7 @@ lazyLoad($('.lazy'));
$
(
'.name'
)[
0
].
mlellipsis
(
2
);
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$
(
'.cart-goods'
).
delegate
(
'.checkbox'
,
't
ouchstart
'
,
function
()
{
$
(
'.cart-goods'
).
delegate
(
'.checkbox'
,
't
ap
'
,
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'icon-cb-checked'
))
{
...
...
@@ -40,7 +40,7 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() {
}
else
{
$this
.
removeClass
(
'icon-checkbox'
).
addClass
(
'icon-cb-checked'
);
}
}).
delegate
(
'.icon-edit'
,
't
ouchstart
'
,
function
()
{
}).
delegate
(
'.icon-edit'
,
't
ap
'
,
function
()
{
var
id
=
$
(
this
).
closest
(
'.shopping-cart-good'
).
data
(
'id'
);
$
.
ajax
({
...
...
@@ -55,13 +55,13 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() {
}
}
});
}).
delegate
(
'.icon-del'
,
't
ouchstart
'
,
function
(
e
)
{
}).
delegate
(
'.icon-del'
,
't
ap
'
,
function
(
e
)
{
e
.
stopPropagation
();
$
(
this
).
closest
(
'.shopping-cart-good'
).
children
(
'.opt-panel'
).
removeClass
(
'hide'
);
$
(
document
).
bind
(
'touchstart'
,
docTouchEvt
);
}).
delegate
(
'.opt-panel'
,
'touchstart'
,
function
()
{
$
(
document
).
bind
(
'tap'
,
docTouchEvt
);
}).
delegate
(
'.opt-panel'
,
'tap'
,
function
()
{
var
$this
=
$
(
this
),
id
=
$this
.
closest
(
'.shopping-cart-good'
).
data
(
'id'
);
...
...
Please
register
or
login
to post a comment