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
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
bfd3fc65a6cf75aecd6657d8912d2d115ecc2060
1 parent
0ffb90b3
问题解决
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
static/js/cart/chose-panel.js
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
static/js/cart/chose-panel.js
View file @
bfd3fc6
...
...
@@ -60,6 +60,8 @@ var limitProductCode,
// 限购商品的skn。只有限购商品时才会设置。
skn
;
var
sizeInfo
=
$
(
'.size-info'
);
//禁用数字编辑
function
disableNumEdit
()
{
var
$numBtn
=
$
(
'.chose-panel'
).
find
(
'.num .btn>.iconfont'
);
...
...
@@ -343,12 +345,15 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
});
function
chosedLength
()
{
var
$chosedL
=
$
(
'.block-list>ul>li.chosed'
),
infoHtml
;
var
$chosedL
=
$
(
'.block-list li.chosed'
),
infoHtml
,
choosedInfo
=
$
(
'.choosed-info'
),
notChoose
=
$
(
'.not-choose'
);
choosedInfo
.
removeClass
(
'hide'
);
$
(
'.choosed-info'
).
removeClass
(
'hide'
);
if
(
!
$
(
'.not-choose'
).
hasClass
(
'hide'
))
{
$
(
'.not-choose'
).
addClass
(
'hide'
);
if
(
!
notChoose
.
hasClass
(
'hide'
))
{
notChoose
.
addClass
(
'hide'
);
}
if
(
$chosedL
.
length
===
2
)
{
...
...
@@ -359,11 +364,11 @@ function chosedLength() {
}
else
if
(
$chosedL
.
length
===
1
)
{
infoHtml
=
'已选:'
+
$chosedL
.
eq
(
0
).
html
();
}
else
{
$
(
'.choosed-info'
).
addClass
(
'hide'
);
$
(
'.not-choose'
).
removeClass
(
'hide'
);
choosedInfo
.
addClass
(
'hide'
);
notChoose
.
removeClass
(
'hide'
);
}
$
(
'.choosed-info'
)
.
html
(
infoHtml
);
choosedInfo
.
html
(
infoHtml
);
}
$yohoPage
.
on
(
'touchstart'
,
'.color-list .block'
,
function
()
{
...
...
@@ -472,8 +477,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
//老的选中颜色去掉勾选,新的选中颜色加上勾选
changeColorChosed
(
0
);
if
(
!
$
(
'.size-info'
).
hasClass
(
'hide'
))
{
$
(
'.size-info'
).
addClass
(
'hide'
);
if
(
!
sizeInfo
.
hasClass
(
'hide'
))
{
sizeInfo
.
addClass
(
'hide'
);
}
// 当前尺码不是选中状态,选中时
...
...
@@ -497,7 +502,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
curColorIndex
=
index
+
1
;
$curSizeBlock
=
$this
;
$
(
'.size-info'
)
.
html
(
$
(
this
).
data
(
'info'
)).
removeClass
(
'hide'
);
sizeInfo
.
html
(
$
(
this
).
data
(
'info'
)).
removeClass
(
'hide'
);
}
// 颜色块切换勾选样式
...
...
@@ -724,7 +729,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
});
$yohoPage
.
on
(
'
touchstart
'
,
'.close'
,
function
()
{
$yohoPage
.
on
(
'
click
'
,
'.close'
,
function
()
{
hide
();
});
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
bfd3fc6
...
...
@@ -958,11 +958,11 @@ class CartModel
$oneSize['colorId']
=
$val['color_id']
;
$oneSize['name']
=
$sizeName
;
$oneSize['sizeNum']
= intval(
$one['storage_number']
);
$oneSize['sizeInfo']
=
$one['size_info']
;
$oneSize['sizeInfo']
=
isset(
$one['size_info']
) ?
$one['size_info']
: ''
;
$sizeList[$val['product_skc']][]
=
$oneSize
;
// 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色
$allSizeList[$sizeName]
= empty(
$allSizeList[$sizeName]['storage']
) ? array('storage' =>
$one['storage_number']
, 'id' =>
$one['size_id']
, 'sizeInfo' =>
$one
['size_info']
)
:
$allSizeList[$sizeName]
;
$allSizeList[$sizeName]
= empty(
$allSizeList[$sizeName]['storage']
) ? array('storage' =>
$one['storage_number']
, 'id' =>
$one['size_id']
, 'sizeInfo' =>
$one
Size['sizeInfo']
:
$allSizeList[$sizeName]
;
$colorNum
+= intval(
$one['storage_number']
);
...
...
Please
register
or
login
to post a comment