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
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
d9c22f4afffed6d1a48efa88944485ae73eaf39c
2 parents
8e2f8151
ddf8b535
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
62 deletions
static/js/index/channel.js
static/js/me/fav.js
static/js/me/suggest.js
static/sass/product/_suspend-cart.scss
static/js/index/channel.js
View file @
d9c22f4
...
...
@@ -10,24 +10,12 @@ var $searchBox = $('.search-box'),
$box
=
$
(
'.box'
),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
),
$channelLink
=
$
(
'.index-channel a'
),
$win
=
$
(
window
),
$doc
=
$
(
document
),
$appFloatLayer
=
$
(
'#float-layer-app'
);
$channelLink
=
$
(
'.index-channel a'
);
var
$search
=
$searchBox
.
children
(
'input[type="text"]'
),
$cancelSearch
=
$box
.
children
(
'.no-search'
),
$searchIcon
=
$searchBox
.
children
(
'.search-icon'
);
// variables for calculate the app download layer position
var
layerInit
=
false
,
windowViewHeight
=
0
,
layerContentHeight
=
$appFloatLayer
.
height
(),
layerPaddingTop
=
parseInt
(
$appFloatLayer
.
css
(
'padding-top'
)),
layerPaddingBottom
=
parseInt
(
$appFloatLayer
.
css
(
'padding-bottom'
)),
layerHeight
=
layerContentHeight
+
layerPaddingTop
+
layerPaddingBottom
,
layerNewPos
;
require
(
'../common'
);
$search
.
on
(
'focus'
,
function
()
{
...
...
@@ -59,6 +47,15 @@ $searchBox.children('.search-icon').on('touchstart', function() {
$indexSearch
.
submit
();
});
$searchBox
.
keyup
(
function
(
e
)
{
if
(
e
.
keyCode
===
13
)
{
if
(
security
.
hasDangerInput
())
{
return
false
;
}
$indexSearch
.
submit
();
}
});
$
(
'.index-channel img'
).
on
(
'load error'
,
function
()
{
window
.
rePosFooter
&&
window
.
rePosFooter
();
});
...
...
@@ -81,40 +78,3 @@ $channelLink.on('touchstart', function() {
borderColor
:
'#fff'
});
});
function
updateLayerPosition
()
{
var
winHeight
=
window
.
innerHeight
,
bodyHeight
=
$doc
.
height
(),
scrollTopPosition
=
$win
.
scrollTop
();
if
(
layerInit
)
{
//keyboard is shown
if
(
windowViewHeight
-
winHeight
>
200
)
{
if
(
scrollTopPosition
+
windowViewHeight
+
layerHeight
>=
bodyHeight
)
{
layerNewPos
=
0
;
}
else
{
layerNewPos
=
bodyHeight
-
windowViewHeight
-
scrollTopPosition
-
layerHeight
;
}
}
else
{
layerNewPos
=
bodyHeight
-
winHeight
-
scrollTopPosition
;
}
}
else
{
windowViewHeight
=
winHeight
;
layerNewPos
=
bodyHeight
-
winHeight
-
scrollTopPosition
+
layerHeight
;
layerInit
=
true
;
}
$appFloatLayer
.
css
({
position
:
'relative'
,
bottom
:
layerNewPos
+
'px'
});
}
$
(
window
).
scroll
(
function
()
{
window
.
requestAnimationFrame
(
updateLayerPosition
);
});
$doc
.
on
(
'ready'
,
updateLayerPosition
);
...
...
static/js/me/fav.js
View file @
d9c22f4
...
...
@@ -12,7 +12,6 @@ var diaLog = require('./dialog');
var
$navLi
=
$
(
'#fav-tab > li'
),
$favContainer
=
$
(
'.fav-content > .fav-type'
),
$swiperList
=
''
,
swiperObj
=
{},
favTabHammer
,
favContentHammer
,
...
...
@@ -37,22 +36,30 @@ function showFavTab(index) {
}
//初始化swiper
function
initSwiper
()
{
function
initSwiper
(
data
)
{
var
i
,
id
;
idStrReg
=
/container-
(\d
+
)[
'"
]{1}
/gi
,
idReg
=
/
\d
+/
,
idArr
=
data
.
match
(
idStrReg
),
idArrLen
=
idArr
.
length
,
containerId
;
$swiperList
=
$
(
'.swiper-container'
);
for
(
i
=
0
;
i
<
$swiperList
.
length
;
i
++
)
{
id
=
$swiperList
.
eq
(
i
).
attr
(
'data-id'
);
//$swiperList = $('.swiper-container');
for
(
i
=
0
;
i
<
idArrLen
;
i
++
)
{
/*id = $swiperList.eq(i).attr('data-id');
if (!!swiperObj[id]) {
swiperObj[id].destroy(true, true);
}
swiperObj
[
id
]
=
new
Swiper
(
'#swiper-container-'
+
id
,
{
}*/
containerId
=
idArr
[
i
].
match
(
idReg
)[
0
];
swiperObj
[
containerId
]
=
new
Swiper
(
'#swiper-container-'
+
containerId
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'li'
,
wrapperClass
:
'swiper-wrapper-'
+
i
d
,
wrapperClass
:
'swiper-wrapper-'
+
containerI
d
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
...
...
@@ -93,7 +100,7 @@ function loadData($parent, url, page) {
$parent
.
append
(
data
);
$parent
.
closest
(
'.fav-type'
).
find
(
'.fav-content-loading'
).
remove
();
if
(
url
===
'favBrand'
)
{
initSwiper
();
//如果是收藏品牌需要初始化swiper
initSwiper
(
data
);
//如果是收藏品牌需要初始化swiper
brandLockId
=
false
;
//请求成功后解锁品牌收藏page++
}
else
{
...
...
static/js/me/suggest.js
View file @
d9c22f4
...
...
@@ -39,7 +39,7 @@ $('#upload-img').uploadifive({
fileType
:
'image*/*'
,
uploadScript
:
'/home/suggestimgUpload'
,
fileObjName
:
'fileData'
,
fileSizeLimit
:
1024
,
fileSizeLimit
:
300
,
height
:
'100%'
,
width
:
'100%'
,
multi
:
false
,
...
...
static/sass/product/_suspend-cart.scss
View file @
d9c22f4
...
...
@@ -10,6 +10,12 @@
bottom
:
70px
;
z-index
:
10
;
a
{
display
:
block
;
width
:
100%
;
height
:
100%
;
}
.iconfont
{
color
:
#fff
;
font-size
:
18px
;
...
...
@@ -26,4 +32,4 @@
right
:
0
;
color
:
#fff
;
}
}
\ No newline at end of file
}
...
...
Please
register
or
login
to post a comment