Authored by 王水玲

发票

... ... @@ -7,5 +7,6 @@
require('./cart');
require('./gift-advance');
require('./order-ensure');
require('./invoice-info');
require('./select-coupon');
require('./select-address');
... ...
... ... @@ -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
... ...
... ... @@ -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个汉字');
... ...
... ... @@ -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;
}
}
}
... ...
... ... @@ -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>
... ...
... ... @@ -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}}
... ...
... ... @@ -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,
... ...
... ... @@ -353,7 +353,8 @@ class IndexController extends AbstractAction
$data = array(
'invoiceInfoPage' => true,
'invoiceNotice' => '发票须知',
'phone' => '',
'phone' => '150****4536',
'completeTel' => '15050524536',
'invoiceCont' => '服装',
'content' => array(
array(
... ...