Authored by 毕凯

修正订单确认提交数据

framework @ 75bbc3b0
Subproject commit e9d066dd88a8e7e37103021c427a205a5cfcdcec
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -15,6 +15,7 @@ var dispatchModeHammer,
dispatchTimeHammer,
$invoice = $('.invoice'),
$price = $('.price-cal'),
payType,
priceTmpl = Handlebars.compile($('#tmpl-price').html());
lazyLoad();
... ... @@ -109,7 +110,24 @@ function submitOrder() {
yohoCoin: orderInfo('yohoCoin')
}
}).then(function(res) {
console.log(res);
var url;
if (!res) {
tip.show('网络出错');
return;
}
if (res.code === 200) {
if (payType === 2) {
// 货到付款的进入订单页面
url = '/home/orderDetail?order_code=' + res.data.order_code;
} else {
url = '/home/pay?order_code=' + res.data.order_code;
}
window.location.href = url;
} else {
tip.show(res.messege || '网络出错');
}
}).fail(function() {
tip.show('网络出错');
});
... ... @@ -155,7 +173,10 @@ $('#msg').find('input').on('blur', function() {
});
$('.pay-mode').on('click', 'li', function() {
orderInfo('paymentTypeId', $(this).data('pay-id'));
orderInfo('paymentType', $(this).data('pay-type'));
var $this = $(this);
orderInfo('paymentTypeId', $this.data('pay-id'));
orderInfo('paymentType', $this.data('pay-type'));
payType = $this.data('pay-type');
submitOrder();
});
... ...
... ... @@ -67,16 +67,14 @@
</li>
{{/if}}
{{# yohoCoin}}
<li class="coin" data-yoho-coin="{{.}}">
<span class="title">YOHO币</span>
<span class="desc">可抵用¥{{.}}</span>
<span class="coin-check">
<em>- ¥ {{.}}</em>
<i class="iconfont checkbox icon-cb-checked"></i>
</span>
</li>
{{/ yohoCoin}}
<li class="coin" data-yoho-coin="{{yohoCoin}}">
<span class="title">YOHO币</span>
<span class="desc">可抵用¥{{yohoCoin}}</span>
<span class="coin-check">
<em>- ¥ {{yohoCoin}}</em>
<i class="iconfont checkbox icon-cb-checked"></i>
</span>
</li>
{{#if invoice}}
<li class="invoice {{#if needInvoice}}focus{{/if}}">
... ...
... ... @@ -586,7 +586,7 @@ class CartModel
$result['message'] = '请选择配送方式';
} else {
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
if ($orderSubRes && isset($orderSubRes['code'])) {
if ($orderSubRes && isset($orderSubRes['code'])) {
$result = $orderSubRes;
}
}
... ...