Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
刘传洋
8 years ago
Commit
48b35de477baf10ae08b0b09a8a0d065ecbb716d
2 parents
a8fe55fc
7c2522f2
m
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
50 deletions
apps/cart/views/action/cart.hbs
public/js/cart/cart-action.js
public/js/cart/cart.page.js
apps/cart/views/action/cart.hbs
View file @
48b35de
...
...
@@ -118,7 +118,9 @@
{{#if
isNotReach
}}
<a
class=
"btn-clear blue"
target=
"_blank"
href=
"
{{
promotionPageUrl
}}
"
data-together-id=
"1"
>
去凑单
>
</a>
{{/if}}
<textarea
data-role=
"gifts-cansel"
class=
"hide"
data-promotionid=
"
{{
promotionId
}}
"
>
{{{
giftGoodsListStr
}}}
</textarea>
{{>
cart-sel-gift-tpl
}}
<!--<textarea data-role="gifts-cansel" class="hide" data-promotionid="
{{
promotionId
}}
">
{{{
giftGoodsListStr
}}}
</textarea>-->
</p>
{{/
promotionInfos
}}
</div>
...
...
public/js/cart/cart-action.js
View file @
48b35de
...
...
@@ -297,6 +297,11 @@ function renderAndShowSelWin($item, pinfo) {
var
Cart
=
{
addToCart
:
function
(
params
)
{
$payWapper
.
find
(
'.cart-item-check'
).
each
(
function
()
{
var
$item
=
$
(
this
);
var
$chk
=
$item
.
find
(
'.cart-item-check'
);
if
(
$chk
.
hasClass
(
'cart-item-checked'
))
{
},
toggleSelectOne
:
function
()
{
// 单选
...
...
public/js/cart/cart.page.js
View file @
48b35de
...
...
@@ -142,37 +142,16 @@ $payWapper.on('click', '.cart-del-btn', function() {
// 凑单图片懒加载
var
togetherDialog
=
{};
var
dialogTpl
=
require
(
'hbs/cart/cart-togetherGoods.hbs'
);
//
var dialogTpl = require('hbs/cart/cart-togetherGoods.hbs');
lazyLoad
(
$
(
'#details-html img'
));
/*$('.shop-cart').on('click', '.gift-sell .btn-clear', function() {
var tid = $(this).attr('data-together-id');
showTogetherGoods(tid);
});*/
// 凑单
/*function showTogetherGoods(id) {
if (!id) {
return;
}
var dialog = togetherDialog[id];
if (!dialog) {
dialog = new Dialog({
content: dialogTpl(),
className: 'cart-togetherGoods'
});
togetherDialog[id] = dialog;
}
dialog.show();
}*/
}
//凑单 顶部 轮播
$
(
'.side-img-dd'
).
slider2
({
isCircle
:
true
,
shownum
:
5
});
// 凑单弹框 详情切换
$
(
'body'
).
on
(
'click'
,
'.piclist li'
,
function
()
{
...
...
@@ -262,25 +241,25 @@ $('body').on('click', '.cut, .add', function() {
// 凑单弹框 商品信息弹出框,加入收藏夹
$cartGoodsDetail
.
on
(
'click'
,
'.btn-favCount'
,
function
()
{
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: '',
// data: {
// productId: productId,
// type: 'add'
// }
// }).then(function(d) {
// if (d.code === 200) {
// new Alert(d.message).show();
// } else if (d.code === 403) {
// if (d.data.url) {
// window.location = d.data.url;
// }
// } else {
// new Alert(d.message).show();
// }
// });
$
.
ajax
({
type
:
'POST'
,
dataType
:
'json'
,
url
:
''
,
data
:
{
productId
:
productId
,
type
:
'add'
}
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
new
Alert
(
d
.
message
).
show
();
}
else
if
(
d
.
code
===
403
)
{
if
(
d
.
data
.
url
)
{
window
.
location
=
d
.
data
.
url
;
}
}
else
{
new
Alert
(
d
.
message
).
show
();
}
});
});
...
...
@@ -294,7 +273,7 @@ $('.shop-cart').on('click', '.gift-sell .btn-clear', function() {
});
// 购物车列表 显示
/*
function showPromotion(id) {
if (!id) {
...
...
@@ -313,7 +292,7 @@ function showPromotion(id) {
dialog.show();
}
}
*/
// 购物车列表 大小图切换
$
(
'body'
).
on
(
'click'
,
'.piclist li'
,
function
()
{
...
...
Please
register
or
login
to post a comment