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
Lynnic
9 years ago
Commit
69c3346a8177cef1dc80fb4e64cd1c234a8d64a2
1 parent
126a07d0
修改了收藏商品的bug
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
17 deletions
static/js/product/detail/detail.js
static/js/product/detail/like.js
template/m.yohobuy.com/actions/product/detail/index.phtml
static/js/product/detail/detail.js
View file @
69c3346
...
...
@@ -27,14 +27,11 @@ goodsSwiper = new Swiper('.banner-swiper', {
});
(
function
()
{
//初始化goods-discount
if
(
0
===
$
(
'.goods-discount .discount-folder'
).
children
().
length
)
{
$
(
'.goods-discount .discount-folder'
).
css
(
'display'
,
'none'
);
$
(
'.goods-discount .first-item span'
).
html
(
''
);
}
})();
//初始化goods-discount
if
(
0
===
$
(
'.goods-discount .discount-folder'
).
children
().
length
)
{
$
(
'.goods-discount .discount-folder'
).
css
(
'display'
,
'none'
);
$
(
'.goods-discount .first-item span'
).
html
(
''
);
}
//goods-discount下拉按钮点击事件
$
(
'.goodsDiscount .dropdown'
).
on
(
'click'
,
function
()
{
...
...
@@ -50,5 +47,4 @@ $('.goodsDiscount .dropdown').on('click', function() {
$
(
'.goodsDiscount .discount-folder'
).
slideUp
();
}
});
require
(
'./like'
);
\ No newline at end of file
...
...
static/js/product/detail/like.js
View file @
69c3346
...
...
@@ -3,12 +3,14 @@
* @author: Lynnic
* @date: 2015/11/24
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
tip
=
require
(
'../../plugin/tip'
);
var
likeHammer
=
new
Hammer
(
document
.
getElementById
(
'likeBtn'
)),
addToCartHammer
=
new
Hammer
(
document
.
getElementById
(
'addtoCart'
));
var
likeHammer
=
new
Hammer
(
document
.
getElementById
(
'likeBtn'
));
var
addToCartHammer
=
new
Hammer
(
document
.
getElementById
(
'addtoCart'
));
var
productId
=
$
(
'#productId'
).
val
();
...
...
@@ -16,8 +18,7 @@ likeHammer.on('tap', function(e) {
var
opt
,
favorite
;
var
$this
=
$
(
this
);
var
$this
=
$
(
e
.
target
);
if
(
$this
.
hasClass
(
'liked'
))
{
opt
=
'cancel'
;
...
...
@@ -26,7 +27,6 @@ likeHammer.on('tap', function(e) {
opt
=
'ok'
;
favorite
=
1
;
}
$
.
ajax
({
type
:
'POST'
,
url
:
'/product/opt/favoriteProduct'
,
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
69c3346
...
...
@@ -124,11 +124,10 @@
{
{/if
}
}
<a
href=
"{{cartUrl}}"
class=
"num-incart iconfont"
>
62
c;</a>
{
{#if
goodsInstore
}
}
<a
href=
"{{cartUrl}}"
id=
"addtoCart"
class=
"addto-cart"
>加入购物车</a>
<a
id=
"addtoCart"
href=
"{{cartUrl}}"
class=
"addto-cart"
>加入购物车</a>
{
{else
}
}
<a
href=
"javascript:;"
class=
"sold-out"
>已售罄</a>
<a
href=
"javascript:;"
id=
"addtoCart"
class=
"sold-out"
>已售罄</a>
{
{/if
}
}
<a
href=
"javascript:;"
id=
"likeBtn"
class=
"favorite iconfont {{#isCollect}}liked{{/isCollect}}"
>
605
;</a>
</div>
{
{/cartInfo
}
}
...
...
Please
register
or
login
to post a comment