Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
biao
9 years ago
Commit
0d2f439eac8af77601d5b41902c4c3af49d45473
2 parents
08e07b49
15873db7
Merge branch 'release/1.0' of
http://git.yoho.cn/fe/yoho-blk
into release/1.0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
19 deletions
apps/shopping/views/partial/cart/cart-list-body.hbs
public/js/shopping/cart/cart.js
public/js/shopping/order/address.js
public/scss/shopping/_removed-products.css
public/tpl/shopping/edit-color-size.hbs
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
0d2f439
...
...
@@ -79,7 +79,7 @@
</a>
</li>
<li
class=
"pro-info"
>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
target=
"_blank"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank"
>
{{
product_name
}}
</a></div>
<div
class=
"color-size editable"
data-productId=
"
{{
product_id
}}
"
id=
"edit_
{{
product_id
}}
"
data-productSkn=
"
{{
product_skn
}}
"
>
{{#if
color_name
}}
...
...
@@ -124,7 +124,7 @@
</a>
</li>
<li
class=
"pro-info"
>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
target=
"_blank"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"javascript:void(0)"
>
{{
product_name
}}
</a></div>
<div>
{{#if
color_name
}}
...
...
public/js/shopping/cart/cart.js
View file @
0d2f439
...
...
@@ -474,7 +474,7 @@ Cart = {
return
false
;
});
editTarget
.
find
(
'.
current-sizes .
size-item'
).
click
(
function
()
{
editTarget
.
find
(
'.size-item'
).
click
(
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'current'
))
{
...
...
@@ -484,6 +484,13 @@ Cart = {
$
(
this
).
addClass
(
'current'
).
siblings
(
'.current'
).
removeClass
(
'current'
);
newProductSku
=
$
(
this
).
attr
(
'data-sku'
);
});
// 初始化size list选中项(其他颜色中第一个尺码)
editTarget
.
find
(
'.sizes-list.mb10'
).
each
(
function
()
{
if
(
$
(
this
).
find
(
'.current'
).
length
===
0
)
{
$
(
this
).
find
(
'.size-item'
).
first
().
addClass
(
'current'
);
}
});
},
fail
:
function
()
{
new
_alert
(
'此商品无法编辑颜色和尺寸'
).
show
();
...
...
public/js/shopping/order/address.js
View file @
0d2f439
...
...
@@ -50,7 +50,7 @@ addressDialogTpl = require('../../../tpl/shopping/address-dialog.hbs');
addressTpl
=
require
(
'../../../tpl/shopping/address-list.hbs'
);
// address dialog 数据验证
function
validateAddress
(
$el
)
{
function
validateAddress
(
$el
,
isUpdate
)
{
var
field
=
{
name
:
[
{
...
...
@@ -72,10 +72,6 @@ function validateAddress($el) {
{
noEmpty
:
true
,
err
:
'手机号码不能为空'
},
{
regx
:
/^
\d{3}(\d
|
\*){4}\d{4}
$/
,
// 验证正常数字或者****
err
:
'手机号码格式不正确'
}
],
phone
:
[
...
...
@@ -95,6 +91,19 @@ function validateAddress($el) {
var
pass
=
true
;
// 新增情况下须验证正确的手机号;编辑情况下可通过****的验证
if
(
isUpdate
)
{
field
.
mobile
.
push
({
regx
:
/^
\d{3}(\d
|
\*){4}\d{4}
$/
,
// 验证正常数字或者****
err
:
'手机号码格式不正确'
});
}
else
{
field
.
mobile
.
push
({
regx
:
/^
\d{11}
$/
,
err
:
'手机号码格式不正确'
});
}
for
(
key
in
field
)
{
if
(
field
.
hasOwnProperty
(
key
))
{
$cur
=
$el
.
find
(
'.address-'
+
key
);
...
...
@@ -160,7 +169,7 @@ function addressDialogFactory(opt, $the) {
areaCode
;
// 验证输入
if
(
validateAddress
(
address
.
$el
))
{
if
(
validateAddress
(
address
.
$el
,
opt
&&
opt
.
id
))
{
// form value
consignee
=
$el
.
find
(
'.address-name'
).
val
();
...
...
public/scss/shopping/_removed-products.css
View file @
0d2f439
...
...
@@ -26,9 +26,19 @@
margin-right
:
20px
;
}
span
{
span
:hover
{
cursor
:
pointer
;
color
:
#379ed6
;
}
a
{
display
:
block
;
width
:
100%
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
&:hover
{
cursor
:
pointer
;
color
:
#379ed6
;
}
}
...
...
public/tpl/shopping/edit-color-size.hbs
View file @
0d2f439
...
...
@@ -12,7 +12,7 @@
style=
"background:
{{
rgb
}}
"
data-imageurl=
"
{{
image
pic
100
134
}}
"
data-target=
"
{{
proId
}}
-color-
{{
@index
}}
"
data-title=
"
{{
color
}}
"
>
data-title=
"
{{
color
}}
"
title=
"
{{
color
}}
"
>
<span
class=
"inner"
></span>
</span>
{{/
each
}}
...
...
@@ -26,13 +26,8 @@
<div
class=
"sizes-list mb10"
>
{{#
each
sizes
}}
{{#
isEqual
..
/
..
/
defaultSize
name
}}
<span
class=
"size-item mr10 mb10 current
{{#
isEqual
num
0
}}
disabled
{{/
isEqual
}}
"
data-sku=
"
{{
sku
}}
"
>
{{
name
}}
</span>
{{^}}
<span
class=
"size-item mr10 mb10
{{#
isEqual
num
0
}}
disabled
{{/
isEqual
}}
"
data-sku=
"
{{
sku
}}
"
>
{{
name
}}
</span>
{{/
isEqual
}}
<span
class=
"size-item mr10 mb10
{{#
isEqual
..
/
..
/
defaultSize
name
}}
current
{{/
isEqual
}}{{#
isEqual
num
0
}}
disabled
{{/
isEqual
}}
"
data-sku=
"
{{
sku
}}
"
>
{{
name
}}
</span>
{{/
each
}}
</div>
</div>
...
...
Please
register
or
login
to post a comment