Authored by 郭成尧

Merge branch 'feature/fcs' into release/5.7

... ... @@ -184,6 +184,7 @@ exports.orderSub = (req, res, next) => {
let couponCode = req.body.couponCode || null;
let yohoCoin = req.body.yohoCoin || 0;
let skuList = req.body.skuList || '';
let isPrintPrice = req.body.isPrintPrice || 'Y';
let orderInfo;
try {
... ... @@ -259,6 +260,7 @@ exports.orderSub = (req, res, next) => {
// 接口需要的其他参数
let otherParams = {
isPrintPrice: isPrintPrice,
unionKey: unionKey, // 友盟数据
userAgent: userAgent,
isWechat: req.yoho.isWechat,
... ...
... ... @@ -164,7 +164,8 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
payment_type: paymentType,
remark: remark,
uid: uid,
udid: otherParams.udid
udid: otherParams.udid,
is_print_price: otherParams.isPrintPrice
};
/* tar add 161130 结算优化 */
... ...
... ... @@ -150,6 +150,15 @@
<form id="msg" action="" method="post">
<input type="text" name="msg" value="{{msg}}" maxlength="40" placeholder="留言">
</form>
<ul class="sale-invoice">
<li class="no-print-price">
<span class="title">不打印价格</span>
<span class="desc">送朋友可不打印价格哦</span>
<span class="check">
<i class="iconfont checkbox{{#if isPrintPrice}} icon-radio{{else}} icon-cb-radio{{/if}}"></i>
</span>
</li>
</ul>
</section>
<section class="price-cal block">
<ul class="total">
... ...
... ... @@ -31,7 +31,9 @@ let $invoice = $('.invoice'),
buyNumber = $('#buyNumber').val(),
headerTop = $('#yoho-header').outerHeight(),
isYohoCoinClick = $coinLi.data('yoho-coin-click') * 1, // 判断有货币是否可以单击
addressTop = $('.address-wrap').outerHeight();
addressTop = $('.address-wrap').outerHeight(),
$message = $('#msg'),
$noPrintPrice = $('.no-print-price');
let orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info'));
let invoiceCont = {
... ... @@ -287,6 +289,7 @@ function submitOrder() {
invoiceType: orderInfo('invoice') ? ($invoice.find('.invoice-type').val() ||
orderInfo('invoiceType')) : null,
msg: msg,
isPrintPrice: orderInfo('isPrintPrice'),
paymentTypeId: orderInfo('paymentTypeId'),
paymentType: orderInfo('paymentType'), // 支付方式
couponCode: orderInfo('couponCode'),
... ... @@ -417,6 +420,17 @@ $invoice.on('touchend', '.checkbox', function(e) {
e.stopPropagation();
});
/**
* 是否打印价格
*/
$noPrintPrice.on('touchend', '.checkbox', function(e) {
let $this = $(this);
orderInfo('isPrintPrice', $this.hasClass('icon-cb-radio') ? 'N' : 'Y');
e.preventDefault();
e.stopPropagation();
});
$invoice.find('[name="invoice-title"]').on('blur', function() {
orderInfo('invoiceText', $(this).val());
}).end().find('.invoice-type').on('change', function() {
... ... @@ -554,6 +568,13 @@ $ticketsMobile.blur(function() {
// 初始化发票信息内容
invoiceInit();
// 留言点击滚动屏幕
$message.on('click', function() {
$('html,body').animate({
scrollTop: $message.offset().top
}, 500);
});
$(window).scroll(function() {
if ($(this).scrollTop() >= (headerTop + addressTop)) {
... ...
... ... @@ -59,6 +59,8 @@ $backBtn.on('touchend', function(e) {
// 提交表单请求
$addressForm.on('submit', function() {
let username = $(this).find('[name="consignee"]').val();
if (isSubmiting) {
return false;
}
... ... @@ -72,6 +74,19 @@ $addressForm.on('submit', function() {
tip.show('收件人不能为空');
return false;
}
username = username.replace(/(^\s+)|(\s+$)/g, '');
if (username && username.length > 20) {
tip.show('收货人姓名最多支持20个字');
return false;
}
if (username && /([^u4e00-\u9fa5])([^\p{P}])/gi.test(username)) {
tip.show('收货人姓名不支持特殊符号');
return false;
}
if (!$(this).find('[name="mobile"]').val()) {
tip.show('手机号不能为空');
return false;
... ...
... ... @@ -38,6 +38,20 @@ $area.on('click', function() {
* 提交表单
*/
$btnSure.on('click', function() {
let username = $areaForm.find('input[name=username]').val();
username = username.replace(/(^\s+)|(\s+$)/g, '');
if (username && username.length > 20) {
tip.show('收货人姓名最多支持20个字');
return false;
}
if (username && /([^u4e00-\u9fa5])([^\p{P}])/gi.test(username)) {
tip.show('收货人姓名不支持特殊符号');
return false;
}
$.post('/home/orders/changeAddress', $areaForm.serialize(), function(result) {
if (result && result.code === 200) {
if (result.data && result.data.is_modified === 'Y') {
... ...
... ... @@ -303,6 +303,35 @@
}
}
.no-print-price {
.title {
font-size: 34px;
color: #444;
}
.desc {
color: #999;
}
.check {
float: right;
color: #999;
.checkbox {
margin-left: 5px;
color: #000;
}
&.used {
color: #f00;
}
em {
color: #f00;
}
}
}
.address-bottom {
display: none;
position: fixed;
... ... @@ -619,6 +648,7 @@
#msg {
padding-top: 20px;
margin-bottom: 20px;
input {
margin: 0;
... ...
... ... @@ -245,6 +245,7 @@ function tranformPayment(data, orderInfo, cartType, skuList, orderComputeData) {
// 留言
orderInfo.msg && (result.msg = orderInfo.msg);
result.isPrintPrice = true; // 是否不打印价格,默认不勾选,预留
// 订单数据
if (data.shopping_cart_data) {
... ...