Authored by hf

Merge remote-tracking branch 'origin/develop'

@@ -159,6 +159,7 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { @@ -159,6 +159,7 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
159 $yohoPage.on('touchstart', '.color-list .block', function() { 159 $yohoPage.on('touchstart', '.color-list .block', function() {
160 var $this = $(this), 160 var $this = $(this),
161 index, 161 index,
  162 + curSizeBlock,
162 $preSiblingBlock, 163 $preSiblingBlock,
163 $curSizeRow, 164 $curSizeRow,
164 numArray, 165 numArray,
@@ -202,13 +203,14 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -202,13 +203,14 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
202 // 之前选中的尺码去掉勾选样式 203 // 之前选中的尺码去掉勾选样式
203 if ($preSiblingBlock.length > 0) { 204 if ($preSiblingBlock.length > 0) {
204 $preSiblingBlock.removeClass('chosed'); 205 $preSiblingBlock.removeClass('chosed');
205 - $curSizeBlock = $curSizeRow.children().get(curSizeIndex); 206 + curSizeBlock = $curSizeRow.children().get(curSizeIndex);
  207 + $curSizeBlock = $(curSizeBlock);
206 } 208 }
207 209
208 // 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在) 210 // 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在)
209 - if ($curSizeBlock) {  
210 - curGoodNum = $curSizeBlock.data('num');  
211 - $curSizeBlock.addClass('chosed'); 211 + if (curSizeBlock) {
  212 + curGoodNum = $(curSizeBlock).data('num');
  213 + $(curSizeBlock).addClass('chosed');
212 214
213 //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式 215 //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式
214 if (curGoodNum > 0) { 216 if (curGoodNum > 0) {
@@ -99,3 +99,7 @@ exports.showDialog = function(data, callback, callbackForLeft) { @@ -99,3 +99,7 @@ exports.showDialog = function(data, callback, callbackForLeft) {
99 event.srcEvent.stopPropagation(); 99 event.srcEvent.stopPropagation();
100 }); 100 });
101 }; 101 };
  102 +
  103 +exports.hideDialog = function() {
  104 + $('.dialog-wrapper').remove();
  105 +};
@@ -6,7 +6,8 @@ @@ -6,7 +6,8 @@
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 Hammer = require('yoho.hammer'), 8 Hammer = require('yoho.hammer'),
9 - lazyLoad = require('yoho.lazyload'); 9 + lazyLoad = require('yoho.lazyload'),
  10 + tip = require('../plugin/tip');
10 11
11 var $navLi = $('#order-nav > li'), 12 var $navLi = $('#order-nav > li'),
12 $orderContainer = $('#order-container'); 13 $orderContainer = $('#order-container');
@@ -132,23 +133,18 @@ orderHammer.on('tap', function(e) { @@ -132,23 +133,18 @@ orderHammer.on('tap', function(e) {
132 id: id 133 id: id
133 }, 134 },
134 success: function(data) { 135 success: function(data) {
  136 + dialog.hideDialog();
  137 + if (data.message) {
  138 + tip.show(data.message);
  139 + }
135 if (data.code === 200) { 140 if (data.code === 200) {
136 - dialog.showDialog({  
137 - dialogText: '删除订单成功',  
138 - autoHide: true,  
139 - fast: true  
140 - });  
141 141
142 //删除订单页面刷新 142 //删除订单页面刷新
143 - history.go(0); 143 + window.location.reload();
144 } 144 }
145 }, 145 },
146 error: function() { 146 error: function() {
147 - dialog.showDialog({  
148 - dialogText: '删除订单失败',  
149 - autoHide: true,  
150 - fast: true  
151 - }); 147 + tip.show('取消订单失败');
152 } 148 }
153 }); 149 });
154 }); 150 });
@@ -169,23 +165,17 @@ orderHammer.on('tap', function(e) { @@ -169,23 +165,17 @@ orderHammer.on('tap', function(e) {
169 id: id 165 id: id
170 }, 166 },
171 success: function(data) { 167 success: function(data) {
  168 + if (data.message) {
  169 + tip.show(data.message);
  170 + }
172 if (data.code === 200) { 171 if (data.code === 200) {
173 - dialog.showDialog({  
174 - dialogText: '取消订单成功',  
175 - autoHide: true,  
176 - fast: true  
177 - });  
178 172
179 //取消订单页面刷新 173 //取消订单页面刷新
180 - history.go(0); 174 + window.location.reload();
181 } 175 }
182 }, 176 },
183 error: function() { 177 error: function() {
184 - dialog.showDialog({  
185 - dialogText: '取消订单失败',  
186 - autoHide: true,  
187 - fast: true  
188 - }); 178 + tip.show('取消订单失败');
189 } 179 }
190 }); 180 });
191 }); 181 });