Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
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
Lynnic
9 years ago
Commit
a8e51496ca96f0cf82104cced04cd0388e48e2a1
1 parent
0f1fbac9
购物车逻辑修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
static/js/shopping-cart/chose-panel.js
static/sass/shopping-cart/_chose-panel.scss
template/m.yohobuy.com/partials/shopping-cart/chose-panel.phtml
static/js/shopping-cart/chose-panel.js
View file @
a8e5149
...
...
@@ -14,7 +14,20 @@ var $ = require('jquery');
var
$num
,
$chosed
,
re
=
/
\d
+/
,
leftNum
;
leftNum
,
$colorList
=
$
(
'.color-list ul>li'
),
$sizeList
=
$
(
'.size-list ul>li'
),
firstColorId
=
$colorList
.
eq
(
0
).
data
(
'id'
);
//初始化购物车面板显示
$sizeList
.
each
(
function
()
{
var
id
=
$
(
this
).
data
(
'colorid'
);
if
(
id
===
firstColorId
)
{
$
(
this
).
removeClass
(
'hide'
);
}
});
// confirm;
...
...
@@ -39,6 +52,8 @@ var $num,
// $num = $('#good-num');
// }
function
show
()
{
$
(
'.chose-panel'
).
show
();
...
...
@@ -63,12 +78,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
remove
();
}).
on
(
'touchstart'
,
'#chose-btn-sure'
,
function
()
{
// var
// // goodId,
// // skuId,
// skcId = $('.color-list li.chosed').data('skcid'),
// colorIndex = $('.color-list li.chosed').index(),
// skuArray = $('.size-list').data('skustr').split('/');
// var productSku,
// buyNumber = $('#good-num') - 0;
// promotionId,
// goodsType,
// isEdit;
// //确定
// $chosed = $('.block-list>ul>li.chosed');
...
...
@@ -83,7 +97,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
// loading.showLoadingMask();
// $.ajax({
// method: 'POST',
// url: '/
product/detail/xxxx
',
// url: '/
cart/index/add
',
// data: {
// product_id: productId,
// content: content
...
...
static/sass/shopping-cart/_chose-panel.scss
View file @
a8e5149
...
...
@@ -8,7 +8,8 @@
right
:
0
;
background
:
rgba
(
0
,
0
,
0
,.
3
);
z-index
:
3
;
.main
{
position
:
absolute
;
height
:
pxToRem
(
610px
);
...
...
@@ -85,6 +86,10 @@
top
:
20rem
/
$pxConvertRem
;
}
}
.size-list
li
.hide
{
display
:
none
;
}
.block
{
float
:
left
;
...
...
template/m.yohobuy.com/partials/shopping-cart/chose-panel.phtml
View file @
a8e5149
{
{#cartInfo
}
}
<div
class=
"chose-panel"
>
<div
class=
"main"
>
<div
class=
"infos"
>
...
...
@@ -36,7 +36,7 @@
<ul
class=
"clearfix"
data-type=
"size"
>
{
{#
sizes
}
}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id={{id}} data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}">
<li
class=
"block
hide
{{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-id=
{
{id
}
}
data-colorid=
"{{colorId}}"
data-num=
"{{sizeNum}}"
data-numstr=
"{{colorNumStr}}"
data-skuid=
"{{skuId}}"
data-goodid=
"{{goodsId}}"
>
{
{name
}
}
</li>
{
{/
sizes
}
}
...
...
@@ -62,3 +62,4 @@
</div>
</div>
</div>
{
{/cartInfo
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment