Authored by Your Name

Merge branch 'release/4.7' of http://git.yoho.cn/fe/YOHOBUYPC into release/4.7

... ... @@ -441,7 +441,7 @@
</div>
</div>
<div class="invoice-list invoice-phone hide">
<div class="invoice-list invoice-phone">
<span class="invoice-star">*</span>
<span class="invoice-list-type">收票人手机</span>
<div class="invoice-line first-line input-line">
... ...
... ... @@ -11,8 +11,11 @@ var $ = require('yoho.jquery'),
$eReceiptBtn = $('.receipt-type .e-receipt'),
$paperReceiptBtn = $('.receipt-type .paper-receipt');
var address = require('./address'),
receiptTitle = "个人";
receiptTitle = "个人",
receiptMobile = $('#input-mobile').val(),
receiptMobileStar;
var dialog = require('../common/dialog');
... ... @@ -876,17 +879,20 @@ $invoiceCheck.click(function(){
});
//电子发票
(function receiptMobileToStarString(numb) {
receiptMobileStar = numb.substr(0, 3) + '****' + numb.substr(7);
$('#input-mobile').val(receiptMobileStar);
}(receiptMobile));
function saveReceiptInfo() {
var passInfoVerify = true,
receiptType,
receiptContent,
receiptMobile,
verifymobile,
invoiceType,
receiptTypeID,
invoiceTypeInt;
invoiceType = '个人';
invoiceTypeInt,
finalReceiptMobile;
if ($eReceiptBtn.hasClass('receipt-type-selected')) {
receiptType = "电子发票";
... ... @@ -896,39 +902,49 @@ function saveReceiptInfo() {
invoiceTypeInt = '1';
}
if (receiptTitle !== "个人") {
invoiceType = '单位';
if (receiptTitle === "单位") {
$('.input-line').each(function(){
if ($(this).find('input').val() === '') {
$(this).find('.enpty-input').removeClass('hide');
passInfoVerify = false;
};
})
receiptMobile = $('#input-mobile').val();
verifymobile = /[*0-9]{11}/;
if (!verifymobile.test(receiptMobile)) {
};
finalReceiptMobile = $('#input-mobile').val();
if (finalReceiptMobile === receiptMobileStar) {
finalReceiptMobile = receiptMobile;
} else {
verifymobile = /[0-9]{11}/;
if (!verifymobile.test(finalReceiptMobile)) {
$('.invoice-phone .enpty-input').removeClass('hide');
if (finalReceiptMobile.length === 0) {
$('.invoice-phone .enpty-input').html('&#xe626; 请填写手机号码');
} else {
$('.invoice-phone .enpty-input').html('&#xe626; 手机号码不正确');
}
passInfoVerify = false;
};
if (!passInfoVerify) {
return;
} else {
$('.invoice-title .enpty-input').addClass('hide');
$('.invoice-phone .enpty-input').addClass('hide');
receiptTitle = $('#input-organization-name').val();
}
}
if (!passInfoVerify) {
return;
} else {
$('.invoice-title .enpty-input').addClass('hide');
$('.invoice-phone .enpty-input').addClass('hide');
receiptTitle = $('#input-organization-name').val();
}
receiptContent = $('input[name="content"]:checked').val();
receiptTypeID = $('input[name="content"]:checked').data('receiptid');
$('.invoice-type').html(receiptType);
$('.invoice-partment').html(invoiceType);
$('.invoice-partment').html(receiptTitle);
$('.invoice-kind').html(receiptContent);
$('.invoice-upload-type').html(invoiceTypeInt);
$('.invoice-upload-content').html(receiptTypeID);
$('.invoice-upload-mobile').html(receiptMobile);
$('.invoice-upload-mobile').html(finalReceiptMobile);
$('.invoice-upload-title').html(receiptTitle);
$receiptInfo.addClass('hide');
... ... @@ -971,11 +987,9 @@ $('.invoice-title').change(function(){
receiptTitle = "个人";
$('.invoice-title').addClass('invoice-title-personal-hight');
$('.invoice-title .input-line').addClass('hide');
$('.invoice-phone').addClass('hide');
} else {
receiptTitle = "单位";
$('.invoice-title').removeClass('invoice-title-personal-hight');
$('.invoice-title .input-line').removeClass('hide');
$('.invoice-phone').removeClass('hide');
}
})
... ...
... ... @@ -698,14 +698,14 @@ class CartModel
}
}
/* 发票类型 */
if (!empty($pay['data']['invoices']['invoices_type_list'])) {
$build = array();
foreach ($pay['data']['invoices']['invoices_type_list'] as $value) {
$build['id'] = $value['invoices_type_id'];
$build['name'] = $value['invoices_type_name'];
$result['piaoTypes'][] = $build;
/* 发票内容 */
if (!empty($pay['data']['invoices']['invoiceContentList'])) {
foreach ($pay['data']['invoices']['invoiceContentList'] as $value) {
$result['piaoTypes'][$value['invoices_type_id']]['id'] = $value['invoices_type_id'];
$result['piaoTypes'][$value['invoices_type_id']]['name'] = $value['invoices_type_name'];
}
ksort($result['piaoTypes']);
$result['piaoTypes'] = array_values($result['piaoTypes']);
$result['receiverMobile'] = isset($userInfo['data']['mobile']) && $userInfo['data']['mobile'] ? $userInfo['data']['mobile'] : '';
}
... ...