Authored by 梁志锋

修改颜色和尺码选

@@ -137,8 +137,6 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -137,8 +137,6 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
137 curSizeBlock, 137 curSizeBlock,
138 curGoodNum; 138 curGoodNum;
139 139
140 - var $siblingBlock = $this.closest('.block-list').siblings(':first');  
141 -  
142 $this.siblings('.chosed').removeClass('chosed'); 140 $this.siblings('.chosed').removeClass('chosed');
143 index = $this.index(); 141 index = $this.index();
144 142
@@ -150,16 +148,13 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -150,16 +148,13 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
150 $leftNum.val(0); 148 $leftNum.val(0);
151 hasChooseColor = false; 149 hasChooseColor = false;
152 150
153 - //if (!hasChooseSize) {  
154 -  
155 - //当前尺码行隐藏  
156 - $sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide'); 151 + //当前尺码行隐藏
  152 + $sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
157 153
158 - //目标尺码行显示  
159 - $sizeRowList.eq(0).removeClass('hide').addClass('show'); 154 + //目标尺码行显示
  155 + $sizeRowList.eq(0).removeClass('hide').addClass('show');
160 156
161 - curSizeIndex = 0;  
162 - //} 157 + curSizeIndex = 0;
163 158
164 //如果尺码已经是选择状态 159 //如果尺码已经是选择状态
165 if (curColorIndex) { 160 if (curColorIndex) {
@@ -184,6 +179,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -184,6 +179,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
184 // 之前选中的尺码去掉勾选样式,新尺码块勾选 179 // 之前选中的尺码去掉勾选样式,新尺码块勾选
185 if ($curSizeBlock && $curSizeBlock.length > 0) { 180 if ($curSizeBlock && $curSizeBlock.length > 0) {
186 $curSizeBlock.removeClass('chosed'); 181 $curSizeBlock.removeClass('chosed');
  182 +
187 //curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1); 183 //curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1);
188 curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1); 184 curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1);
189 $curSizeBlock = $(curSizeBlock); 185 $curSizeBlock = $(curSizeBlock);
@@ -233,8 +229,6 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -233,8 +229,6 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
233 curColorBlock, 229 curColorBlock,
234 curGoodNum; 230 curGoodNum;
235 231
236 - var $siblingBlock = $this.closest('.block-list').siblings(':first');  
237 -  
238 $this.siblings('.chosed').removeClass('chosed'); 232 $this.siblings('.chosed').removeClass('chosed');
239 index = $this.index(); 233 index = $this.index();
240 234
@@ -246,16 +240,13 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -246,16 +240,13 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
246 $leftNum.val(0); 240 $leftNum.val(0);
247 hasChooseSize = false; 241 hasChooseSize = false;
248 242
249 - //if (!hasChooseColor) {  
250 -  
251 - //当前颜色行隐藏  
252 - $colorRowList.eq(curColorIndex).removeClass('show').addClass('hide'); 243 + //当前颜色行隐藏
  244 + $colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
253 245
254 - //目标颜色行显示  
255 - $colorRowList.eq(0).removeClass('hide').addClass('show'); 246 + //目标颜色行显示
  247 + $colorRowList.eq(0).removeClass('hide').addClass('show');
256 248
257 - curColorIndex = 0;  
258 - //} 249 + curColorIndex = 0;
259 250
260 //如果颜色已经是选择状态 251 //如果颜色已经是选择状态
261 if (curSizeIndex) { 252 if (curSizeIndex) {
@@ -280,6 +271,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -280,6 +271,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
280 // 之前选中的颜色去掉勾选样式,新颜色块勾选 271 // 之前选中的颜色去掉勾选样式,新颜色块勾选
281 if ($curColorBlock && $curColorBlock.length > 0) { 272 if ($curColorBlock && $curColorBlock.length > 0) {
282 $curColorBlock.removeClass('chosed'); 273 $curColorBlock.removeClass('chosed');
  274 +
283 //curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1); 275 //curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1);
284 curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1); 276 curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
285 $curColorBlock = $(curColorBlock); 277 $curColorBlock = $(curColorBlock);
@@ -294,7 +286,6 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -294,7 +286,6 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
294 } else { 286 } else {
295 $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); 287 $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
296 } 288 }
297 -  
298 $leftNum.val(curGoodNum); 289 $leftNum.val(curGoodNum);
299 290
300 //数量小于0 291 //数量小于0