Showing
2 changed files
with
10 additions
and
12 deletions
@@ -20,18 +20,17 @@ function getProductInfo(skn, promotionId) { | @@ -20,18 +20,17 @@ function getProductInfo(skn, promotionId) { | ||
20 | skn: skn, | 20 | skn: skn, |
21 | promotionId: promotionId | 21 | promotionId: promotionId |
22 | }).then(function(res) { | 22 | }).then(function(res) { |
23 | - if (!res) { | ||
24 | - tip.show('网络错误'); | ||
25 | - return; | ||
26 | - } | ||
27 | if (res.code === 200) { | 23 | if (res.code === 200) { |
28 | chosePanel.show({ | 24 | chosePanel.show({ |
29 | - cartInfo: res.data | ||
30 | - }); | 25 | + cartInfo: res.data, |
26 | + cb: function(loc) { | ||
27 | + window.location.href = loc; | ||
28 | + } | ||
29 | + }); | ||
31 | } else { | 30 | } else { |
32 | - tip.show(res.message || '网络错误'); | 31 | + tip.show(res.message); |
33 | } | 32 | } |
34 | - }).fail(function() { | 33 | + }, function() { |
35 | tip.show('网络错误'); | 34 | tip.show('网络错误'); |
36 | }).always(function() { | 35 | }).always(function() { |
37 | loading.hideLoadingMask(); | 36 | loading.hideLoadingMask(); |
@@ -107,12 +107,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { | @@ -107,12 +107,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { | ||
107 | fast: true | 107 | fast: true |
108 | }); | 108 | }); |
109 | history.go(0); | 109 | history.go(0); |
110 | + } else { | ||
111 | + tip.show(data.message); | ||
110 | } | 112 | } |
111 | }, function() { | 113 | }, function() { |
112 | - dialog.showDialog({ | ||
113 | - autoHide: true, | ||
114 | - dialogText: '网络异常' | ||
115 | - }); | 114 | + tip.show('网络异常'); |
116 | }); | 115 | }); |
117 | }); | 116 | }); |
118 | 117 |
-
Please register or login to post a comment