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
王水玲
9 years ago
Commit
3f381f575589f0d81efe009b5b77ec54766d97ab
1 parent
90338fac
发票
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
132 additions
and
19 deletions
static/js/cart/entry.js
static/js/cart/invoice-info.js
static/js/cart/order-ensure.js
static/sass/me/_order-detail.css
template/m.yohobuy.com/actions/cart/index/invoice-info.phtml
template/m.yohobuy.com/actions/index/home/order-detail.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
static/js/cart/entry.js
View file @
3f381f5
...
...
@@ -7,5 +7,6 @@
require
(
'./cart'
);
require
(
'./gift-advance'
);
require
(
'./order-ensure'
);
require
(
'./invoice-info'
);
require
(
'./select-coupon'
);
require
(
'./select-address'
);
...
...
static/js/cart/invoice-info.js
View file @
3f381f5
...
...
@@ -4,10 +4,16 @@
* @date: 2016/6/14
*/
var
$
=
require
(
'jquery'
);
var
$
=
require
(
'jquery'
),
tip
=
require
(
'../plugin/tip'
),
dialog
=
require
(
'../me/dialog'
);
var
$invoiceNotice
=
$
(
'.invoice-notice'
),
$companyArea
=
$
(
'.company-area'
);
$companyArea
=
$
(
'.company-area'
),
$editFlag
=
$
(
'.edit-flag'
),
$tel
=
$
(
'.tel'
);
var
myreg
=
/^
(((
13
[
0-9
]{1})
|
(
15
[
0-9
]{1})
|
(
18
[
0-9
]{1}))
+
\d{8})
$/
;
require
(
'../common'
);
...
...
@@ -17,6 +23,8 @@ function chooseAction(pDom, dom) {
}
else
{
pDom
.
find
(
'.choose'
).
removeClass
(
'icon-cb-radio icon-radio'
).
addClass
(
'icon-radio'
);
dom
.
removeClass
(
'icon-radio'
).
addClass
(
'icon-cb-radio'
);
dom
.
parent
().
addClass
(
'on'
);
$editFlag
.
val
(
'true'
);
}
}
...
...
@@ -43,6 +51,7 @@ $('.invoice-type span').on('touchstart', function() {
return
;
}
else
{
$
(
this
).
addClass
(
'on'
).
siblings
().
removeClass
(
'on'
);
$editFlag
.
val
(
'true'
);
}
});
...
...
@@ -54,4 +63,56 @@ $('.invoice-btn').on('touchstart', function() {
$
(
'.think-ok, .mask-bg'
).
on
(
'touchstart'
,
function
()
{
$invoiceNotice
.
fadeOut
();
});
$
(
'.istel'
).
one
(
'input'
,
function
()
{
$
(
this
).
val
(
''
).
removeClass
(
'istel'
);
});
$tel
.
on
(
'input'
,
function
()
{
$
(
this
).
attr
(
'data-tel'
,
$
(
this
).
val
());
$editFlag
.
val
(
'true'
);
});
$
(
'.confirm-btn'
).
on
(
'touchstart'
,
function
()
{
if
(
$editFlag
.
val
()
===
'true'
)
{
if
(
!
myreg
.
test
(
$tel
.
data
(
'tel'
)))
{
tip
.
show
(
'请输入正确手机号'
);
$tel
.
focus
();
return
false
;
}
else
{
dialog
.
showDialog
({
dialogText
:
'确认保存修改内容?'
,
hasFooter
:
{
leftBtnText
:
'取消'
,
rightBtnText
:
'确定'
}
},
function
()
{
$
.
ajax
({
method
:
'post'
,
url
:
'/cart/index/del'
,
data
:
{
type
:
$
(
'.invoice-type'
).
find
(
'.on'
).
text
(),
title
:
$
(
'.invoice-top'
).
find
(
'.on'
).
text
()
}
}).
then
(
function
(
data
)
{
if
(
data
.
code
===
200
)
{
dialog
.
showDialog
({
dialogText
:
'修改成功'
,
autoHide
:
true
,
fast
:
true
});
window
.
location
.
href
=
'/cart/index/orderEnsure?cartType=ordinary'
;
}
else
{
tip
.
show
(
data
.
message
);
}
},
function
()
{
tip
.
show
(
'网络异常'
);
window
.
location
.
reload
();
});
},
function
()
{
window
.
location
.
href
=
'/cart/index/orderEnsure?cartType=ordinary'
;
});
}
}
});
\ No newline at end of file
...
...
static/js/cart/order-ensure.js
View file @
3f381f5
...
...
@@ -189,16 +189,16 @@ function submitOrder() {
if
(
isSubmiting
)
{
return
false
;
}
if
(
orderInfo
(
'invoice'
))
{
if
(
!
invoiceText
)
{
tip
.
show
(
'请输入发票抬头'
);
return
;
}
if
(
invoiceText
.
length
>
30
)
{
tip
.
show
(
'发票抬头不得超过30个汉字'
);
return
;
}
}
// 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个汉字'
);
...
...
static/sass/me/_order-detail.css
View file @
3f381f5
...
...
@@ -263,4 +263,28 @@
}
}
}
.invoice-info
{
margin
:
20px
0
;
border-top
:
1px
solid
#e0e0e0
;
border-bottom
:
1px
solid
#e0e0e0
;
background
:
#fff
;
padding
:
30px
;
box-sizing
:
border-box
;
overflow
:
hidden
;
span
{
font-size
:
28px
;
color
:
#444
;
line-height
:
40px
;
}
.invoice-fr
{
float
:
right
;
}
.invoice-see
{
color
:
#d0021b
;
}
}
}
...
...
template/m.yohobuy.com/actions/cart/index/invoice-info.phtml
View file @
3f381f5
...
...
@@ -19,11 +19,7 @@
<li>
<span class="title">*发票人手机:</span>
<span class="phone">
{{#if phone}}
{{.}}
{{else}}
<input type="text" name="tel" class="tel" value="" placeholder="可通过手机号在发票服务平台查询">
{{/if}}
<input type="text" name="tel" data-tel="{{completeTel}}" class="tel {{#phone}}istel{{/phone}}" value="{{phone}}" placeholder="可通过手机号在发票服务平台查询">
</span>
</li>
<li class="company-area"><input type="text" name="company" class="company" value="" placeholder="填写单位名称"></li>
...
...
@@ -39,7 +35,7 @@
{{/each}}
</ul>
<div class="btn-area"><span class="confirm-btn">确认</span><div>
<div class="btn-area"><span class="confirm-btn">确认</span><
/
div>
<div class="invoice-notice">
<div class="mask-bg"></div>
...
...
@@ -53,5 +49,7 @@
</div>
</div>
<input type="hidden" class="edit-flag" value="false" />
{{> layout/footer}}
</div>
...
...
template/m.yohobuy.com/actions/index/home/order-detail.phtml
View file @
3f381f5
...
...
@@ -92,6 +92,28 @@
</p>
{
{/if
}
}
{
{#invoiceInfo
}
}
<ul
class=
"invoice-info"
>
<li>
<span>发票信息</span>
<span
class=
"invoice-fr"
>
{
{#if
invoiceType
}
}电子发票
{
{else
}
}纸质发票
{
{/if
}
}</span>
</li>
<li>
<span>发票抬头</span>
<span
class=
"invoice-fr"
>
{
{invoiceTop
}
}</span>
</li>
<li>
<span>发票内容</span>
<span
class=
"invoice-fr"
>
{
{invoiceCont
}
}</span>
</li>
{
{#if
invoiceType
}
}
<li>
<a
href=
"{{invoiceSee}}"
><span
class=
"invoice-fr invoice-see"
>点击查看电子发票</span></a>
</li>
{
{/if
}
}
</ul>
{
{/invoiceInfo
}
}
<div
class=
"opt block"
>
{
{#unless
unreceived
}
}
{
{#unless
unpaid
}
}
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
3f381f5
...
...
@@ -1073,6 +1073,12 @@ class HomeController extends AbstractAction
$this
->
_view
->
display
(
'order-detail'
,
array
(
'orderDetailPage'
=>
true
,
'invoiceInfo'
=>
array
(
'invoiceType'
=>
true
,
'invoiceTop'
=>
'有货(商贸)服务有限公司'
,
'invoiceCont'
=>
'服装'
,
'invoiceSee'
=>
''
),
'serviceUrl'
=>
'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info='
,
'orderDetail'
=>
$orderDetail
,
'orderCode'
=>
$orderCode
,
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
3f381f5
...
...
@@ -353,7 +353,8 @@ class IndexController extends AbstractAction
$data
=
array
(
'invoiceInfoPage'
=>
true
,
'invoiceNotice'
=>
'发票须知'
,
'phone'
=>
''
,
'phone'
=>
'150****4536'
,
'completeTel'
=>
'15050524536'
,
'invoiceCont'
=>
'服装'
,
'content'
=>
array
(
array
(
...
...
Please
register
or
login
to post a comment