Authored by hf

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -9,6 +9,7 @@ var $ = require('jquery'), @@ -9,6 +9,7 @@ var $ = require('jquery'),
9 Hammer = require('yoho.hammer'), 9 Hammer = require('yoho.hammer'),
10 Handlebars = require('yoho.handlebars'), 10 Handlebars = require('yoho.handlebars'),
11 tip = require('../plugin/tip'), 11 tip = require('../plugin/tip'),
  12 + loading = require('../plugin/loading'),
12 orderInfo = require('./order-info').orderInfo; 13 orderInfo = require('./order-info').orderInfo;
13 14
14 var dispatchModeHammer, 15 var dispatchModeHammer,
@@ -94,6 +95,7 @@ function orderCompute() { @@ -94,6 +95,7 @@ function orderCompute() {
94 } 95 }
95 96
96 function submitOrder() { 97 function submitOrder() {
  98 + loading.showLoadingMask();
97 $.ajax({ 99 $.ajax({
98 method: 'POST', 100 method: 'POST',
99 url: '/shoppingCart/orderSub', 101 url: '/shoppingCart/orderSub',
@@ -114,6 +116,7 @@ function submitOrder() { @@ -114,6 +116,7 @@ function submitOrder() {
114 var url; 116 var url;
115 117
116 if (!res) { 118 if (!res) {
  119 + loading.hideLoadingMask();
117 tip.show('网络出错'); 120 tip.show('网络出错');
118 return; 121 return;
119 } 122 }
@@ -125,11 +128,14 @@ function submitOrder() { @@ -125,11 +128,14 @@ function submitOrder() {
125 } else { 128 } else {
126 url = '/home/pay?order_code=' + res.data.order_code; 129 url = '/home/pay?order_code=' + res.data.order_code;
127 } 130 }
  131 + window.setCookie('order-info', '');
128 window.location.href = url; 132 window.location.href = url;
129 } else { 133 } else {
  134 + loading.hideLoadingMask();
130 tip.show(res.messege || '网络出错'); 135 tip.show(res.messege || '网络出错');
131 } 136 }
132 }).fail(function() { 137 }).fail(function() {
  138 + loading.hideLoadingMask();
133 tip.show('网络出错'); 139 tip.show('网络出错');
134 }); 140 });
135 } 141 }