diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index 946b867c2151b76d8bfbbaa7d36fe038adda36f0..17ce8ebd4f9f9c3bd083763b5c3d319278f08888 100755 --- a/public/static/admin/default/js/goods.js +++ b/public/static/admin/default/js/goods.js @@ -233,7 +233,45 @@ $(function() return false; } - Prompt('hello'); + var html = ''; + html += ''; + html += '×'; + html += ''; + html += ''; + html += ''; + html += '
'; + html += '+添加规格值'; + html += '
'; + html += ''; + html += ''; + $('.spec-quick table tbody').append(html); + $('.spec-quick .goods-specifications').show(); + }); + + // 添加规格值 + $(document).on('click', '.spec-quick table .quick-spec-value-add', function() + { + var html = '
'; + html += ''; + html += '×'; + html += '
'; + $(this).parent().before(html); + }); + + // 规格名称移除 + $(document).on('click', '.spec-quick table .quick-title-remove', function() + { + $(this).parents('tr').remove(); + if($('.spec-quick table tbody tr').length <= 0) + { + $('.spec-quick .goods-specifications').hide(); + } + }); + + // 规格值移除 + $(document).on('click', '.spec-quick table .value-item .quick-value-remove', function() + { + $(this).parent().remove(); }); // 生成规格