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
yangyang
9 years ago
Commit
fe50cd8796ec1b267aa708e1d044315cd5f0cf61
2 parents
9d9961d5
f102373f
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
19 deletions
static/js/guang/info.js
static/js/me/my-guang.js
static/js/me/order.js
template/m.yohobuy.com/actions/index/home/my-guang.phtml
template/m.yohobuy.com/partials/layout/use.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
static/js/guang/info.js
View file @
fe50cd8
...
...
@@ -55,16 +55,19 @@ function initInfosEvt($container) {
cHammer
=
new
Hammer
(
$container
[
0
]);
//点赞或者收藏事件
cHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
),
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$btn
,
$info
;
$likeBtn
=
$this
.
closest
(
'.like-btn'
);
if
(
$likeBtn
.
length
>
0
)
{
if
(
$likeBtn
.
hasClass
(
'like'
))
{
e
.
preventDefault
();
//点赞
$btn
=
$this
.
closest
(
'.like-btn'
);
if
(
$btn
.
length
>
0
)
{
if
(
$btn
.
hasClass
(
'like'
))
{
opt
=
'cancel'
;
}
...
...
@@ -80,22 +83,23 @@ function initInfosEvt($container) {
var
code
=
data
.
code
;
if
(
code
===
200
)
{
$
likeB
tn
.
next
(
'.like-count'
).
text
(
data
.
data
);
$
b
tn
.
next
(
'.like-count'
).
text
(
data
.
data
);
//切换点赞状态
$
likeB
tn
.
toggleClass
(
'like'
);
$
b
tn
.
toggleClass
(
'like'
);
}
},
error
:
function
()
{
tip
.
show
(
'网络断开连接了~'
);
}
});
return
;
}
// 2015/11/03 hf: 增加APP里的收藏资讯功能. 写得不对的地方还请大神修改!
$collectBtn
=
$this
.
closest
(
'.collect-btn'
);
if
(
$collectBtn
.
length
>
0
)
{
if
(
$collectBtn
.
hasClass
(
'collected'
))
{
//APP收藏
$btn
=
$this
.
closest
(
'.collect-btn'
);
if
(
$btn
.
length
>
0
)
{
if
(
$btn
.
hasClass
(
'collected'
))
{
opt
=
'cancel'
;
}
...
...
@@ -111,7 +115,7 @@ function initInfosEvt($container) {
if
(
data
.
code
&&
data
.
code
===
200
)
{
//切换收藏状态
$
collectB
tn
.
toggleClass
(
'collected'
);
$
b
tn
.
toggleClass
(
'collected'
);
}
},
error
:
function
()
{
...
...
static/js/me/my-guang.js
View file @
fe50cd8
...
...
@@ -6,6 +6,22 @@
var
$
=
require
(
'jquery'
);
var
info
=
require
(
'../guang/info
'
);
var
$infoList
=
$
(
'#info-list
'
);
info
.
initInfoEvt
(
$
(
'#info-list'
));
\ No newline at end of file
var
winH
=
$
(
window
).
height
();
var
info
=
require
(
'../guang/info'
),
loadMore
=
info
.
loadMore
;
var
setting
=
{
page
:
2
,
end
:
false
};
info
.
initInfoEvt
(
$infoList
);
$
(
window
).
scroll
(
function
()
{
if
(
$
(
window
).
scrollTop
()
+
winH
>=
$
(
document
).
height
()
-
0.25
*
$infoList
.
height
())
{
loadMore
(
$infoList
,
setting
);
}
});
\ No newline at end of file
...
...
static/js/me/order.js
View file @
fe50cd8
...
...
@@ -112,7 +112,7 @@ orderHammer.on('tap', function(e) {
//Order delete
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/delOrder'
,
url
:
'/home/del
ete
Order'
,
data
:
{
id
:
id
},
...
...
@@ -136,8 +136,8 @@ orderHammer.on('tap', function(e) {
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
//取消订单
alert
(
'order cancel'
);
//取消订单页面刷新
location
.
href
=
location
.
href
;
}
}
});
...
...
template/m.yohobuy.com/actions/index/home/my-guang.phtml
View file @
fe50cd8
{
{>
layout/header
}
}
<div
class=
"my-guang-page yoho-page"
>
<div
class=
"info-list"
>
<div
id=
"info-list"
class=
"info-list"
>
{
{#
myGuang
}
}
{
{>
guang/info
}
}
{
{/
myGuang
}
}
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
fe50cd8
...
...
@@ -242,4 +242,9 @@
<script>
seajs.use('js/me/address');
</script>
{{/if}}
{{#if myGuangPage}}
<script>
seajs.use('js/me/my-guang');
</script>
{{/if}}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
fe50cd8
...
...
@@ -434,7 +434,7 @@ class HomeController extends AbstractAction
$gender
=
Helpers
::
getGenderByCookie
();
$channel
=
Helpers
::
getChannelByCookie
();
$uid
=
$this
->
getUid
();
$uid
=
'
7566245
'
;
//临时测试用
$uid
=
'
10267443
'
;
//临时测试用
$data
=
GradeModel
::
getGrade
(
$gender
,
$channel
,
$uid
);
$data
[
'pageFooter'
]
=
true
;
$this
->
_view
->
display
(
'vip-grade'
,
$data
);
...
...
Please
register
or
login
to post a comment