Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
8ac969d021d5203e5cd7300fa463b2060aa9d380
1 parent
251e35ef
购物车面板代码修改 --code reviewed by LZF
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
20 deletions
docs/data-structure.md
static/js/shopping-cart/chose-panel.js
static/sass/shopping-cart/_chose-panel.scss
template/m.yohobuy.com/partials/shopping-cart/chose-panel.phtml
docs/data-structure.md
View file @
8ac969d
...
...
@@ -1245,10 +1245,9 @@
'notForSale':'非卖品',
thumb: [
thumb
s
: [
{
id:1,
url : ''
img : ''
},
...
],
...
...
@@ -1256,28 +1255,29 @@
price: '',
salePrice: '',
colors: [
{
id: 1,
chosed: true,
name: '黄色',
colorNum:10,
sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
},
...
],
{
id: 1,
skcId:,
chosed: true,
name: '黄色',
colorNum:10,
sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
},
...
],
sizes: [
{
id: 2,
skuId:,
goodId:,
chosed: true,
name: 'X',
sizeNum: 2,
colorNumStr:'10/20/30' //对应的商品颜色数目用斜杠分割
},
...
],
totalNum: 20
]
},
'introUrl' : '',
'id' : '',
...
...
static/js/shopping-cart/chose-panel.js
View file @
8ac969d
...
...
@@ -78,7 +78,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
//根据颜色切换图片
if
(
$this
.
closest
(
'.block-list'
).
hasClass
(
'color-list'
))
{
$
(
'.chose-panel
.basic-info
'
).
find
(
'.thumb'
).
addClass
(
'hide'
).
eq
(
index
).
removeClass
(
'hide'
);
$
(
'.chose-panel'
).
find
(
'.thumb'
).
addClass
(
'hide'
).
eq
(
index
).
removeClass
(
'hide'
);
}
if
(
$chosed
.
length
===
0
)
{
...
...
@@ -120,6 +120,10 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
}
numArray
=
$siblingBlock
.
find
(
'.chosed'
).
data
(
'numstr'
).
split
(
'/'
);
$that
.
find
(
'.num .left-num'
).
html
(
'剩余'
+
numArray
[
index
]
+
'件'
);
if
(
2
===
$chosed
.
closest
(
'.zero-stock'
).
length
)
{
$
(
'#chose-btn-sure'
).
css
(
'background-color'
,
'#c0c0c0'
);
$
(
'#chose-btn-sure'
).
html
(
'已售罄'
);
}
}
}).
on
(
'touchstart'
,
'.btn-minus'
,
function
()
{
...
...
static/sass/shopping-cart/_chose-panel.scss
View file @
8ac969d
...
...
@@ -113,7 +113,7 @@
border-color
:
#e0e0e0
;
background
:
none
;
color
:
#e0e0e0
;
background-color
:
#
f0f0f
0
;
background-color
:
#
c0c0c
0
;
}
}
...
...
template/m.yohobuy.com/partials/shopping-cart/chose-panel.phtml
View file @
8ac969d
...
...
@@ -25,7 +25,7 @@
<span>颜色</span>
<ul
class=
"clearfix"
data-type=
"color"
>
{
{#
colors
}
}
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}"
data-num=
"{{colorNum}}"
data-numstr=
"{{sizeNumStr}}"
>
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}"
data-num=
"{{colorNum}}"
data-numstr=
"{{sizeNumStr}}"
data-skcid=
"{{skcId}}"
>
{
{name
}
}
</li>
{
{/
colors
}
}
...
...
@@ -35,7 +35,7 @@
<span>尺码</span>
<ul
class=
"clearfix"
data-type=
"size"
>
{
{#
sizes
}
}
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-id=
{
{id
}
}
data-num=
"{{sizeNum}}"
data-numstr=
"{{colorNumStr}}"
>
<li
class=
"block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}"
data-id=
{
{id
}
}
data-num=
"{{sizeNum}}"
data-numstr=
"{{colorNumStr}}"
data-skuid=
"{{skuId}}"
data-goodid=
"{{goodId}}"
>
{
{name
}
}
</li>
{
{/
sizes
}
}
...
...
Please
register
or
login
to post a comment