...
|
...
|
@@ -76,16 +76,26 @@ var sizeTpl = require('../../tpl/me/size-list.hbs'); |
|
|
|
|
|
function setActive($item) {
|
|
|
var color = $item.find('.color-text').data('color');
|
|
|
var size = $item.find('.size-text').data('size');
|
|
|
|
|
|
// var size = $item.find('.size-text').data('size');
|
|
|
var $colorList = $item.find('.color-list');
|
|
|
var $sizeList = $item.find('.size-list');
|
|
|
|
|
|
console.log(color);
|
|
|
$colorList.find('.img-box').each(function(i, box) {
|
|
|
var $box = $(box);
|
|
|
|
|
|
if ($box.find('img').data('color') === color) {
|
|
|
$box.find('.img-box').eq(i).addClass('active');
|
|
|
$colorList.find('.img-box').eq(i).addClass('active');
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$sizeList.find('span').each(function(i, s) {
|
|
|
var $size = $(s);
|
|
|
|
|
|
if ($size.data('size') === size) {
|
|
|
$sizeList.find('span').eq(i).addClass('active');
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -180,7 +190,6 @@ function getProductInfo() { |
|
|
productSkn: skn
|
|
|
}
|
|
|
}).done(function(result) {
|
|
|
console.log(result);
|
|
|
if (result.code === 200) {
|
|
|
renderList(result.data);
|
|
|
initSizeId();
|
...
|
...
|
|