From ab73b001db3efe53ed4ddca2d318d0bae1be5e08 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 12 Sep 2019 18:31:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E6=A0=BC=E5=BF=AB=E6=8D=B7=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/default/js/goods.js | 40 ++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index 946b867c2..17ce8ebd4 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(); }); // 生成规格 -- GitLab