商品规格操作优化
parent
9f805d6c60
commit
e418dff971
|
|
@ -585,18 +585,26 @@ $(function()
|
||||||
var spec = [];
|
var spec = [];
|
||||||
$('.spec-quick table tbody tr').each(function(k, v)
|
$('.spec-quick table tbody tr').each(function(k, v)
|
||||||
{
|
{
|
||||||
spec[k] = {
|
var title = $(this).find('td.am-text-middle input').val() || null;
|
||||||
"title": $(this).find('td.am-text-middle input').val(),
|
if(title != null)
|
||||||
"value": []
|
|
||||||
}
|
|
||||||
$(this).find('td.spec-quick-td-value .value-item').each(function(ks,vs)
|
|
||||||
{
|
{
|
||||||
var value = $(this).find('input').val() || null;
|
var temp_data = [];
|
||||||
if(value != null)
|
$(this).find('td.spec-quick-td-value .value-item').each(function(ks,vs)
|
||||||
{
|
{
|
||||||
spec[k]['value'][ks] = $(this).find('input').val();
|
var value = $(this).find('input').val() || null;
|
||||||
|
if(value != null)
|
||||||
|
{
|
||||||
|
temp_data.push(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(temp_data.length > 0)
|
||||||
|
{
|
||||||
|
spec.push({
|
||||||
|
"title": title,
|
||||||
|
"value": temp_data
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 是否存在规格
|
// 是否存在规格
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue