Authored by 郭成尧

dialog

@@ -392,12 +392,24 @@ $reaMask.find('.box-cmp').on('touchend', function() { @@ -392,12 +392,24 @@ $reaMask.find('.box-cmp').on('touchend', function() {
392 if ($.type(res) !== 'object') { 392 if ($.type(res) !== 'object') {
393 return; 393 return;
394 } 394 }
  395 +
  396 + if (res.code === 200) {
  397 + dialog.showDialog({
  398 + dialogText: '您的取消订单申请已提交,请耐心等待',
  399 + hasFooter: {
  400 + leftBtnText: '返回',
  401 + rightBtnText: '确定'
  402 + }
  403 + }, function() {
  404 + window.location.href = '/home/orders';
  405 + });
  406 +
  407 + return false;
  408 + }
  409 +
395 if (res.message) { 410 if (res.message) {
396 tip.show(res.message); 411 tip.show(res.message);
397 } 412 }
398 - setTimeout(function() {  
399 - window.location.href = '/home/orders';  
400 - }, 2000);  
401 }).fail(function() { 413 }).fail(function() {
402 tip.show('网络错误'); 414 tip.show('网络错误');
403 }); 415 });
@@ -422,12 +434,24 @@ $refundReaMask.find('.box-cmp').on('touchend', function() { @@ -422,12 +434,24 @@ $refundReaMask.find('.box-cmp').on('touchend', function() {
422 if ($.type(res) !== 'object') { 434 if ($.type(res) !== 'object') {
423 return; 435 return;
424 } 436 }
  437 +
  438 + if (res.code === 200) {
  439 + dialog.showDialog({
  440 + dialogText: '您的退款申请已提交,请耐心等待退款',
  441 + hasFooter: {
  442 + leftBtnText: '返回',
  443 + rightBtnText: '确定'
  444 + }
  445 + }, function() {
  446 + window.location.href = '/home/orders';
  447 + });
  448 +
  449 + return false;
  450 + }
  451 +
425 if (res.message) { 452 if (res.message) {
426 tip.show(res.message); 453 tip.show(res.message);
427 } 454 }
428 - setTimeout(function() {  
429 - window.location.href = '/home/orders';  
430 - }, 2000);  
431 }).fail(function() { 455 }).fail(function() {
432 tip.show('网络错误'); 456 tip.show('网络错误');
433 }); 457 });
@@ -266,12 +266,23 @@ $reaMask.find('.box-cmp').on('touchend', function() { @@ -266,12 +266,23 @@ $reaMask.find('.box-cmp').on('touchend', function() {
266 if ($.type(res) !== 'object') { 266 if ($.type(res) !== 'object') {
267 return; 267 return;
268 } 268 }
  269 +
  270 + if (res.code === 200) {
  271 + dialog.showDialog({
  272 + dialogText: '您的取消订单申请已提交,请耐心等待',
  273 + hasFooter: {
  274 + leftBtnText: '返回',
  275 + rightBtnText: '确定'
  276 + }
  277 + }, function() {
  278 + window.location.href = '/home/orders';
  279 + });
  280 +
  281 + return false;
  282 + }
269 if (res.message) { 283 if (res.message) {
270 tip.show(res.message); 284 tip.show(res.message);
271 } 285 }
272 - setTimeout(function() {  
273 - window.location.href = '/home/orders';  
274 - }, 2000);  
275 }).fail(function() { 286 }).fail(function() {
276 tip.show('网络错误'); 287 tip.show('网络错误');
277 }); 288 });
@@ -296,12 +307,23 @@ $refundReaMask.find('.box-cmp').on('touchend', function() { @@ -296,12 +307,23 @@ $refundReaMask.find('.box-cmp').on('touchend', function() {
296 if ($.type(res) !== 'object') { 307 if ($.type(res) !== 'object') {
297 return; 308 return;
298 } 309 }
  310 +
  311 + if (res.code === 200) {
  312 + dialog.showDialog({
  313 + dialogText: '您的退款申请已提交,请耐心等待退款',
  314 + hasFooter: {
  315 + leftBtnText: '返回',
  316 + rightBtnText: '确定'
  317 + }
  318 + }, function() {
  319 + window.location.href = '/home/orders';
  320 + });
  321 +
  322 + return false;
  323 + }
299 if (res.message) { 324 if (res.message) {
300 tip.show(res.message); 325 tip.show(res.message);
301 } 326 }
302 - setTimeout(function() {  
303 - window.location.href = '/home/orders';  
304 - }, 2000);  
305 }).fail(function() { 327 }).fail(function() {
306 tip.show('网络错误'); 328 tip.show('网络错误');
307 }); 329 });