Authored by 郭成尧

Merge branch 'feature/buynow' into 'release/5.8.1'

COOKIE处理发票展示



See merge request !685
... ... @@ -47,6 +47,10 @@ class BuyNowController {
return next();
}
if (product_sku !== orderInfo.product_sku) {
orderInfo = {};
}
co(function * () {
let result = yield req.ctx(BuyNowModel).payment({
uid: req.user.uid,
... ...
... ... @@ -141,7 +141,7 @@
<span class="iconfont checkbox {{#if needInvoice}}icon-cb-radio{{else}}icon-radio{{/if}}"></span>
<a id="invoice" class="invoice-info" href="/cart/index/buynow/selectInvoice?product_sku={{@root.product_sku}}">
<span class="title">发票信息</span>
<span class="invoice-type">明细 <i class="iconfont">&#xe614;</i></span>
<span class="invoice-type">{{invoiceText}}<i class="iconfont">&#xe614;</i></span>
</a>
</li>
{{/if}}
... ...
... ... @@ -141,7 +141,7 @@
<span class="iconfont checkbox {{#if needInvoice}}icon-cb-radio{{else}}icon-radio{{/if}}"></span>
<a id="invoice" class="invoice-info" href="/cart/index/new/invoiceInfo">
<span class="title">发票信息</span>
<span class="invoice-type">明细 <i class="iconfont">&#xe614;</i></span>
<span class="invoice-type">{{invoiceText}}<i class="iconfont">&#xe614;</i></span>
</a>
</li>
{{/if}}
... ...
... ... @@ -40,17 +40,8 @@ require('common');
lazyLoad();
/**
* Cookie Init
*/
function orderInfoInit() {
let product_sku = qs.product_sku;
if (orderInfo('product_sku') !== product_sku) {
cookie.remove(['buynow_info']);
orderInfo('product_sku', product_sku);
}
}
// 存 COOKIE
orderInfo('product_sku', qs.product_sku);
function getQueryParam() {
let queryArray = location.search.substr(1).split('&'),
... ... @@ -525,4 +516,3 @@ $(window).scroll(function() {
$('.address-bottom').hide();
}
});
orderInfoInit();
... ...
... ... @@ -258,7 +258,16 @@ function tranformPayment(data, orderInfo, cartType, skuList, orderComputeData) {
if (orderInfo.invoice) {
result.needInvoice = orderInfo.invoice;
result.invoiceText = orderInfo.invoiceText;
if (orderInfo.invoices_title) {
if (orderInfo.invoices_title.length > 10) {
orderInfo.invoices_title = orderInfo.invoices_title.substring(0, 10) + '...';
}
result.invoiceText = `电子发票(${orderInfo.invoices_title})`;
} else {
result.invoiceText = '电子发票(个人)';
}
}
}
... ...