|
@@ -5,7 +5,9 @@ |
|
@@ -5,7 +5,9 @@ |
5
|
* @date: 2015/10/21
|
5
|
* @date: 2015/10/21
|
6
|
*/
|
6
|
*/
|
7
|
|
7
|
|
8
|
-var $ = require('jquery');
|
8
|
+var $ = require('jquery'),
|
|
|
9
|
+ tip = require('../plugin/tip'),
|
|
|
10
|
+ loading = require('../plugin/loading');
|
9
|
|
11
|
|
10
|
// Handlebars = require('yoho.handlebars');
|
12
|
// Handlebars = require('yoho.handlebars');
|
11
|
|
13
|
|
|
@@ -24,7 +26,6 @@ var $num, |
|
@@ -24,7 +26,6 @@ var $num, |
24
|
$sizeList.each(function() {
|
26
|
$sizeList.each(function() {
|
25
|
colorIndex = $(this).data('colorid');
|
27
|
colorIndex = $(this).data('colorid');
|
26
|
|
28
|
|
27
|
-
|
|
|
28
|
if (colorIndex === firstColorId) {
|
29
|
if (colorIndex === firstColorId) {
|
29
|
$(this).removeClass('hide');
|
30
|
$(this).removeClass('hide');
|
30
|
}
|
31
|
}
|
|
@@ -79,41 +80,44 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
|
@@ -79,41 +80,44 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
79
|
remove();
|
80
|
remove();
|
80
|
}).on('touchstart', '#chose-btn-sure', function() {
|
81
|
}).on('touchstart', '#chose-btn-sure', function() {
|
81
|
|
82
|
|
82
|
- // var productSku,
|
|
|
83
|
- // buyNumber = $('#good-num') - 0;
|
|
|
84
|
- // promotionId,
|
|
|
85
|
- // goodsType,
|
|
|
86
|
- // isEdit;
|
|
|
87
|
-
|
|
|
88
|
- // //确定
|
|
|
89
|
- // $chosed = $('.block-list>ul>li.chosed');
|
|
|
90
|
-
|
|
|
91
|
- // if (2 === $chosed.length && 2 !== $chosed.closest('.zero-stock').length) {
|
|
|
92
|
-
|
|
|
93
|
- // if (confirm) {
|
|
|
94
|
- // return false;
|
|
|
95
|
- // }
|
|
|
96
|
-
|
|
|
97
|
- // confirm = true;
|
|
|
98
|
- // loading.showLoadingMask();
|
|
|
99
|
- // $.ajax({
|
|
|
100
|
- // method: 'POST',
|
|
|
101
|
- // url: '/cart/index/add',
|
|
|
102
|
- // data: {
|
|
|
103
|
- // product_id: productId,
|
|
|
104
|
- // content: content
|
|
|
105
|
- // }
|
|
|
106
|
- // }).done(function(res) {
|
|
|
107
|
- // if (res.code === 200) {
|
|
|
108
|
- // loading.hideLoadingMask();
|
|
|
109
|
- // confirm = false;
|
|
|
110
|
- // remove();
|
|
|
111
|
- // }
|
|
|
112
|
- // }).fail(function() {
|
|
|
113
|
- // tip.show('网络出了点问题~');
|
|
|
114
|
- // confirm = false;
|
|
|
115
|
- // });
|
|
|
116
|
- // }
|
83
|
+ var productSku,
|
|
|
84
|
+ buyNumber = $('#good-num') - 0;
|
|
|
85
|
+
|
|
|
86
|
+ // promotionId,
|
|
|
87
|
+ // goodsType,
|
|
|
88
|
+ // isEdit;
|
|
|
89
|
+
|
|
|
90
|
+ $chosed = $('.block-list>ul>li.chosed');
|
|
|
91
|
+
|
|
|
92
|
+ if (2 === $chosed.length && 0 === $chosed.closest('.zero-stock').length) {
|
|
|
93
|
+ productSku = $sizeList.closest('.chosed').data('skuid');
|
|
|
94
|
+
|
|
|
95
|
+ // if (confirm) {
|
|
|
96
|
+ // return false;
|
|
|
97
|
+ // }
|
|
|
98
|
+
|
|
|
99
|
+ // confirm = true;
|
|
|
100
|
+ loading.showLoadingMask();
|
|
|
101
|
+ $.ajax({
|
|
|
102
|
+ method: 'POST',
|
|
|
103
|
+ url: '/cart/index/add',
|
|
|
104
|
+ data: {
|
|
|
105
|
+ productSku: productSku,
|
|
|
106
|
+ buyNumber: buyNumber
|
|
|
107
|
+ }
|
|
|
108
|
+ }).done(function(res) {
|
|
|
109
|
+ if (res.code === 200) {
|
|
|
110
|
+ loading.hideLoadingMask();
|
|
|
111
|
+
|
|
|
112
|
+ // confirm = false;
|
|
|
113
|
+ remove();
|
|
|
114
|
+ }
|
|
|
115
|
+ }).fail(function() {
|
|
|
116
|
+ tip.show('网络出了点问题~');
|
|
|
117
|
+
|
|
|
118
|
+ // confirm = false;
|
|
|
119
|
+ });
|
|
|
120
|
+ }
|
117
|
|
121
|
|
118
|
}).on('touchstart', '.block', function(e) {
|
122
|
}).on('touchstart', '.block', function(e) {
|
119
|
var $this = $(this),
|
123
|
var $this = $(this),
|