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
毕凯
9 years ago
Commit
15558b8a5ab4c2f55b87a80b9927e59f01e36aac
1 parent
6c1a4703
master
...
beta
develop
发票抬头 留言 优惠券使用优化
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
22 deletions
static/js/cart/order-ensure.js
static/sass/cart/_order-ensure.scss
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
static/js/cart/order-ensure.js
View file @
15558b8
...
...
@@ -16,6 +16,7 @@ var dispatchModeHammer,
dispatchTimeHammer
,
$invoice
=
$
(
'.invoice'
),
$price
=
$
(
'.price-cal'
),
$couponUse
=
$
(
'.coupon-use.used'
),
payType
,
priceTmpl
=
Handlebars
.
compile
(
$
(
'#tmpl-price'
).
html
()),
queryString
=
$
.
queryString
(),
...
...
@@ -27,6 +28,11 @@ if (window.getUid() !== orderInfo('uid')) {
order
.
init
();
}
if
(
$couponUse
.
data
(
'value'
)
!==
orderInfo
(
'couponValue'
))
{
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'couponValue'
,
null
);
}
function
dispacthTapEvt
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
);
...
...
@@ -110,9 +116,24 @@ function orderCompute() {
}
function
submitOrder
()
{
if
(
orderInfo
(
'invoice'
)
&&
!
orderInfo
(
'invoiceText'
))
{
tip
.
show
(
'请输入发票抬头'
);
return
;
var
invoiceText
=
$invoice
.
find
(
'[name="invoice-title"]'
).
val
()
||
orderInfo
(
'invoiceText'
),
msg
=
$
(
'#msg'
).
find
(
'input'
).
val
()
||
orderInfo
(
'msg'
);
if
(
orderInfo
(
'invoice'
))
{
if
(
!
invoiceText
)
{
tip
.
show
(
'请输入发票抬头'
);
return
;
}
if
(
invoiceText
.
length
>
30
)
{
tip
.
show
(
'发票抬头不得超过30个汉字'
);
return
;
}
}
if
(
msg
)
{
if
(
msg
.
length
>
40
)
{
tip
.
show
(
'留言不得超过40个汉字'
);
return
;
}
}
loading
.
showLoadingMask
();
$
.
ajax
({
...
...
@@ -123,9 +144,9 @@ function submitOrder() {
cartType
:
queryString
.
cartType
||
queryString
.
carttype
||
'ordinary'
,
deliveryId
:
orderInfo
(
'deliveryId'
),
deliveryTimeId
:
orderInfo
(
'deliveryTimeId'
),
invoiceText
:
$invoice
.
find
(
'[name="invoice-title"]'
).
val
()
||
orderInfo
(
'invoiceText'
)
,
invoiceText
:
invoiceText
,
invoiceType
:
$invoice
.
find
(
'.invoice-type'
).
val
()
||
orderInfo
(
'invoiceType'
),
msg
:
$
(
'#msg'
).
find
(
'input'
).
val
()
||
orderInfo
(
'msg'
)
,
msg
:
msg
,
paymentTypeId
:
orderInfo
(
'paymentTypeId'
),
paymentType
:
orderInfo
(
'paymentType'
),
//支付方式
couponCode
:
orderInfo
(
'couponCode'
),
...
...
@@ -198,7 +219,7 @@ $invoice.find('[name="invoice-title"]').on('blur', function() {
orderInfo
(
'invoiceType'
,
$
(
this
).
val
());
});
$
(
'#msg'
).
find
(
'
input
'
).
on
(
'blur'
,
function
()
{
$
(
'#msg'
).
find
(
'
textarea
'
).
on
(
'blur'
,
function
()
{
orderInfo
(
'msg'
,
$
(
this
).
val
());
});
...
...
static/sass/cart/_order-ensure.scss
View file @
15558b8
...
...
@@ -166,19 +166,26 @@
}
}
.block
input
{
box-sizing
:
border-box
;
margin
:
pxToRem
(
20px
)
0
;
padding
:
0
pxToRem
(
12px
);
width
:
100%
;
height
:
pxToRem
(
60px
);
color
:
#444
;
background
:
#efefef
;
font-size
:
pxToRem
(
16px
);
line-height
:
1
;
outline
:
0
;
border
:
0
;
@include
border-radius
(
4px
);
.block
{
input
,
textarea
{
box-sizing
:
border-box
;
margin
:
pxToRem
(
20px
)
0
;
padding
:
0
pxToRem
(
12px
);
width
:
100%
;
height
:
pxToRem
(
60px
);
color
:
#444
;
background
:
#efefef
;
font-size
:
pxToRem
(
16px
);
line-height
:
1
;
outline
:
0
;
border
:
0
;
@include
border-radius
(
4px
);
}
textarea
{
padding
:
pxToRem
(
12px
);
height
:
auto
;
resize
:
none
;
}
}
#invoice
{
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
15558b8
...
...
@@ -50,7 +50,7 @@
</span>
{
{#if
value
}
}
<span
class=
"used coupon-use"
>
<span
class=
"used coupon-use"
data-value=
"{{value}}"
>
-¥
{
{value
}
}
<i
class=
"iconfont"
>
614
;</i>
</span>
...
...
@@ -77,7 +77,7 @@
<span
class=
"title"
>发票</span>
<span
class=
"iconfont checkbox {{#if needInvoice}}icon-cb-checked{{else}}icon-checkbox{{/if}}"
></span>
<form
id=
"invoice"
>
<input
type=
"text"
name=
"invoice-title"
value=
"{{invoiceText}}"
placeholder=
"发票抬头"
>
<input
type=
"text"
name=
"invoice-title"
value=
"{{invoiceText}}"
maxlength=
"30"
placeholder=
"发票抬头"
>
<label>
发票类型
<select
class=
"invoice-type"
name=
"invoice-type"
>
...
...
@@ -92,7 +92,7 @@
</ul>
<form
id=
"msg"
action=
""
method=
"post"
>
<
input
type=
"text"
name=
"msg"
value=
"{{msg}}"
placeholder=
"留言"
>
<
textarea
name=
"msg"
rows=
"2"
maxlength=
"40"
placeholder=
"留言"
>
{
{msg
}
}</textarea
>
</form>
</section>
...
...
Please
register
or
login
to post a comment