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
Plain Diff
Browse Files
Authored by
uedxwg
9 years ago
Commit
c5aa356edc6047248da02077936f68dfbf10251b
2 parents
7a079a94
59239699
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
55 deletions
docs/data-structure.md
static/js/guang/info.js
static/js/me/my-guang.js
static/js/me/order.js
static/sass/me/_order.scss
template/m.yohobuy.com/actions/index/home/order.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
docs/data-structure.md
View file @
c5aa356
...
...
@@ -943,7 +943,8 @@
{
name: '',
active: true,
typeId: 1
typeId: 1,
url: ''
},
...
]
...
...
static/js/guang/info.js
View file @
c5aa356
...
...
@@ -5,16 +5,16 @@
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
tip
=
require
(
'../plugin/tip'
);
var
loading
=
require
(
'../plugin/loading'
);
var
$loadMoreInfo
=
$
(
'#load-more-info'
);
var
$loading
=
$
(
''
),
$noMore
=
$
(
''
);
$noMore
=
$
(
''
);
var
searching
=
false
;
...
...
@@ -34,8 +34,8 @@ function setLazyLoadAndMellipsis($infos) {
$infos
.
each
(
function
()
{
var
$this
=
$
(
this
),
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
[
0
].
mlellipsis
(
2
);
$text
[
0
].
mlellipsis
(
2
);
...
...
@@ -57,10 +57,10 @@ function initInfosEvt($container) {
cHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
),
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$info
;
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$info
;
$likeBtn
=
$this
.
closest
(
'.like-btn'
);
if
(
$likeBtn
.
length
>
0
)
{
...
...
static/js/me/my-guang.js
0 → 100644
View file @
c5aa356
/**
* 我的逛
* @author xuqi<qi.xu@yoho.cn>
* @date: 2015/11/17
*/
var
$
=
require
(
'jquery'
);
var
info
=
require
(
'../guang/info'
);
info
.
initInfoEvt
(
$
(
'#info-list'
));
\ No newline at end of file
...
...
static/js/me/order.js
View file @
c5aa356
...
...
@@ -17,27 +17,32 @@ var winH = $(window).height();
var
activeType
=
$navLi
.
filter
(
'.active'
).
data
(
'type'
);
//当前active的项的index
var
orderPage
=
{};
var
order
=
{
page
:
0
,
end
:
false
};
var
inAjax
=
false
;
var
loading
=
require
(
'../plugin/loading'
);
var
navHammer
,
orderHammer
;
var
orderHammer
;
//加载订单
function
getOrders
()
{
function
getOrders
(
option
)
{
var
opt
=
{
type
:
activeType
,
page
:
order
Page
[
activeType
]
?
(
orderPage
[
activeType
]
+
1
)
:
1
page
:
order
.
page
+
1
};
var
show
=
option
&&
option
.
showLoadingMask
;
if
(
inAjax
)
{
return
;
}
inAjax
=
true
;
loading
.
showLoadingMask
();
show
&&
loading
.
showLoadingMask
();
$
.
ajax
({
type
:
'GET'
,
...
...
@@ -46,23 +51,27 @@ function getOrders() {
success
:
function
(
data
)
{
var
num
;
if
(
data
.
code
===
200
)
{
orderPage
[
opt
.
type
]
=
opt
.
page
;
if
(
data
!==
' '
)
{
order
.
page
=
opt
.
page
;
if
(
opt
.
page
===
1
)
{
$curContainer
.
html
(
data
.
data
);
$curContainer
.
html
(
data
);
lazyLoad
(
$curContainer
.
find
(
'.lazy'
));
}
else
{
num
=
$curContainer
.
children
(
'.order'
).
length
;
$curContainer
.
append
(
data
.
data
);
$curContainer
.
append
(
data
);
//lazyload
lazyLoad
(
$curContainer
.
children
(
'.order:gt('
+
(
num
-
1
)
+
')
.lazy'
));
lazyLoad
(
$curContainer
.
children
(
'.order:gt('
+
(
num
-
1
)
+
')
'
).
find
(
'
.lazy'
));
}
window
.
rePosFooter
();
//重新计算底部位置
}
else
{
order
.
end
=
true
;
}
inAjax
=
false
;
loading
.
hideLoadingMask
();
show
&&
loading
.
hideLoadingMask
();
}
});
}
...
...
@@ -83,33 +92,6 @@ lazyLoad();
loading
.
init
(
$
(
'body'
));
//满屏loading
//导航切换
navHammer
=
new
Hammer
(
document
.
getElementById
(
'order-nav'
));
navHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
),
index
;
if
(
$cur
.
length
===
0
||
$cur
.
hasClass
(
'active'
))
{
return
;
}
index
=
$cur
.
index
();
$navLi
.
filter
(
'.active'
).
removeClass
(
'active'
);
$cur
.
addClass
(
'active'
);
$curContainer
.
addClass
(
'hide'
);
$curContainer
=
$orderContainer
.
children
(
':eq('
+
index
+
')'
).
removeClass
(
'hide'
);
activeType
=
$cur
.
data
(
'type'
);
if
(
orderPage
[
activeType
])
{
return
;
}
else
{
getOrders
();
}
});
//点击订单区域跳转订单详情页
orderHammer
=
new
Hammer
(
document
.
getElementById
(
'order-container'
));
orderHammer
.
on
(
'tap'
,
function
(
e
)
{
...
...
@@ -168,9 +150,13 @@ orderHammer.on('tap', function(e) {
});
$
(
window
).
scroll
(
function
()
{
if
(
$
(
window
).
scrollTop
()
+
winH
>
if
(
order
.
end
===
false
&&
$
(
window
).
scrollTop
()
+
winH
>
$
(
document
).
height
()
-
0.25
*
$orderContainer
.
height
())
{
getOrders
();
//下拉请求时不显示mask
getOrders
({
noLoadingMask
:
true
});
}
});
...
...
static/sass/me/_order.scss
View file @
c5aa356
...
...
@@ -106,7 +106,14 @@
border-bottom
:
1px
solid
#e0e0e0
;
background
:
#fff
;
>
li
{
a
{
display
:
block
;
height
:
100%
;
width
:
100%
;
color
:
#b0b0b0
;
}
>
li
{
float
:
left
;
height
:
90rem
/
$pxConvertRem
;
width
:
25%
;
...
...
@@ -115,7 +122,7 @@
font-size
:
26rem
/
$pxConvertRem
;
text-align
:
center
;
&
.active
{
&
.active
a
{
color
:
#000
;
}
}
...
...
template/m.yohobuy.com/actions/index/home/order.phtml
View file @
c5aa356
...
...
@@ -4,7 +4,7 @@
<ul
id=
"order-nav"
class=
"order-nav clearfix"
>
{
{#each
navs
}
}
<li
{
{#if
active
}
}class=
"active"
{
{/if
}
}
data-type=
"{{typeId}}"
>
{
{name
}
}
<a
href=
"{{url}}"
>
{
{name
}
}</a>
</li>
{
{/each
}
}
</ul>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
c5aa356
...
...
@@ -454,7 +454,7 @@ class HomeController extends AbstractAction
}
//ajax请求订单页面
public
function
getOrderAction
()
{
public
function
getOrder
s
Action
()
{
//判断是不是ajax请求
if
(
!
$this
->
isAjax
())
{
$this
->
error
();
...
...
Please
register
or
login
to post a comment