Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-mobile
·
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
Email Patches
Plain Diff
Browse Files
Authored by
unknown
10 years ago
Commit
725b9e9a4c5d88af0264ae565dc7464603f06bbf
1 parent
89fc8d5b
maybelike ajax addr modify
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
home-page/public/js/common/maybe-like.js
home-page/public/js/common/maybe-like.js
View file @
725b9e9
...
...
@@ -30,7 +30,9 @@ $.get('/common/goodinfo', function(data) {
Mustache
.
parse
(
tpl
);
});
var
gender
=
$
(
'.mobile-wrap'
).
hasClass
(
'boys-wrap'
)
?
'index'
:
'girl'
;
var
isLogin
=
'Y'
;
//TODO:是否登录,后台提供,区分走Ajax还是页面跳转
//商品收藏
$
(
'.goods-list'
).
delegate
(
'.good-islike'
,
'touchstart'
,
function
(
e
)
{
var
$cur
,
$good
,
id
,
url
;
...
...
@@ -43,16 +45,17 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
id
=
$good
.
data
(
'id'
);
if
(
$cur
.
hasClass
(
'good-like'
))
{
url
=
'/
goods
/cancelprise'
;
url
=
'/
'
+
gender
+
'
/cancelprise'
;
}
else
{
url
=
'/
goods
/prise'
;
url
=
'/
'
+
gender
+
'
/prise'
;
}
$
.
ajax
({
type
:
'GET'
,
url
:
url
,
data
:
{
product_skn
:
id
id
:
id
}
}).
then
(
function
(
data
)
{
if
(
data
.
code
===
200
)
{
...
...
@@ -67,8 +70,7 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
//srcoll to load more
$
(
window
).
scroll
(
function
()
{
var
num
,
ajaxUrl
;
var
num
;
if
(
end
||
loading
)
{
return
;
}
...
...
@@ -79,14 +81,9 @@ $(window).scroll(function() {
loading
=
true
;
num
=
$goodList
.
children
(
'.good-info'
).
length
;
if
(
$
(
'.mobile-wrap'
).
hasClass
(
'boys-wrap'
))
{
ajaxUrl
=
'/index/getmore'
;
}
else
{
ajaxUrl
=
'/girl/getmore'
;
}
$
.
ajax
({
type
:
'GET'
,
url
:
ajaxUrl
,
url
:
'/'
+
gender
+
'/getmore'
,
data
:
{
page
:
page
+
1
}
...
...
Please
register
or
login
to post a comment