Authored by 毕凯

增加提交表单的默认值

... ... @@ -99,11 +99,11 @@ function submitOrder() {
data: {
addressId: orderInfo('addressId'),
cartType: orderInfo('cartType'),
deliveryId: orderInfo('deliveryId'),
deliveryTimeId: orderInfo('deliveryTimeId'),
invoiceText: orderInfo('invoiceText'),
invoiceType: orderInfo('invoiceType'),
msg: orderInfo('msg'),
deliveryId: orderInfo('deliveryId') || 1,
deliveryTimeId: orderInfo('deliveryTimeId') || 2,
invoiceText: $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'),
msg: $('#msg').find('input').val() || orderInfo('msg'),
paymentTypeId: orderInfo('paymentTypeId'),
paymentType: orderInfo('paymentType'), //支付方式
couponCode: orderInfo('couponCode'),
... ... @@ -134,6 +134,10 @@ function submitOrder() {
}
// 界面点击,状态存 cookie
if (!orderInfo('addressId')) {
orderInfo('addressId', $('.address-wrap').data('id'));
}
$('.dispatch-mode').on('touchend', 'li', function() {
orderInfo('deliveryId', $(this).data('id'));
orderCompute();
... ...
... ... @@ -22,6 +22,7 @@ try {
invoiceType: null,
msg: null
};
window.setCookie('order-info', JSON.stringify(info));
}
exports.orderInfo = function(key, value) {
... ...
{{> layout/header}}
<div class="order-ensure-page yoho-page">
{{# orderEnsure}}
<a class="address-wrap block" href="/shoppingCart/selectAddress">
<a class="address-wrap block" data-id="{{addressId}}" href="/shoppingCart/selectAddress">
<p class="infos">
收货地址
<span class="per-info">{{name}} {{phoneNum}}</span>
... ...