Authored by 王水玲

发票手机号选择修改

... ... @@ -18,7 +18,9 @@ var $invoiceNotice = $('.invoice-notice'),
$company = $('.company'),
$telArea = $('.tel-area'),
orderInfo = order.orderInfo,
$chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent();
$chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent(),
$copyTel = $('.copy-tel'),
isModifyTel = false;
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/,
linkUrl = '/cart/index/orderEnsure?cartType=ordinary';
... ... @@ -78,6 +80,12 @@ function confirmAction() {
orderInfo('invoicesType', type);
orderInfo('invoiceTitle', title);
if (isModifyTel && $copyTel !== tel) {
orderInfo('isModifyTel', true);
} else {
orderInfo('isModifyTel', false);
}
dialog.showDialog({
dialogText: '保存成功',
autoHide: true,
... ... @@ -148,6 +156,7 @@ $('.istel').one('input', function() {
$tel.on('input', function() {
$(this).attr('data-tel', $(this).val());
$editFlag.val('true');
isModifyTel = true;
});
$company.on('input', function() {
... ...
... ... @@ -23,6 +23,7 @@ function init() {
invoiceType: null,
invoiceTitle: null,
receiverMobile: null,
isModifyTel: false,
invoicesType: null,
msg: null,
cartType: 'ordinary'
... ...
... ... @@ -21,6 +21,7 @@
<li {{#isPaper}}style="display: none;"{{/isPaper}} class="tel-area">
<span class="title"><i class="txt-point">*</i>发票人手机:</span>
<span class="phone">
<input type="hidden" class="copy-tel" value="{{completeTel}}">
<input type="text" name="tel" data-tel="{{completeTel}}" class="tel {{#phone}}istel{{/phone}}" value="{{phone}}" placeholder="可通过手机号在发票服务平台查询">
</span>
</li>
... ...
... ... @@ -371,19 +371,29 @@ class IndexController extends AbstractAction
$cookieData = $this->getCookie('order-info', null); //从缓存中获取电子发票信息
$orderInfo = json_decode($cookieData, true);
$addresslist = UserData::addressTextData($uid); //获取地址列表
if (!empty($orderInfo['receiverMobile']) && !empty($orderInfo['invoiceType']) && !empty($orderInfo['invoiceTitle'])) {
if (!empty($orderInfo['receiverMobile']) && $orderInfo['isModifyTel'] == true) {
$mobile = $orderInfo['receiverMobile']; //用户号码
} else {
//获取用户所选地址的手机号码
foreach ($addresslist['data'] as $addresskey) {
if ($addresskey['address_id'] == $orderInfo['address']['address_id'])
$mobile = $addresskey['mobile'];
}
}
if (!empty($orderInfo['invoiceType']) && !empty($orderInfo['invoiceTitle'])) {
$invoiceType = $orderInfo['invoiceType']; //发票类型ID
$invoices_type = $orderInfo['invoicesType'] * 1; //发票类型 /**纸质 1 ,电子 2 */
$mobile = $orderInfo['receiverMobile']; //用户号码
//$mobile = $orderInfo['receiverMobile']; //用户号码
$invoices_title = $orderInfo['invoiceText']; //发票抬头
$invoice_Top = $orderInfo['invoiceTitle']; //单位 个人
}
else {
//获取用户所选地址的手机号码
foreach ($addresslist['data'] as $addresskey) {
if ($addresskey['address_id'] == $orderInfo['address']['address_id'])
$mobile = $addresskey['mobile'];
}
// foreach ($addresslist['data'] as $addresskey) {
// if ($addresskey['address_id'] == $orderInfo['address']['address_id'])
// $mobile = $addresskey['mobile'];
// }
$invoices_title = '';
$invoiceType = '7'; //发票类型ID
$invoices_type = '2'; //发票类型 /**纸质 1 ,电子 2 */
... ...