diff --git a/application/admin/view/default/goods/save_info.html b/application/admin/view/default/goods/save_info.html index 3357ea8121329f555216f79c64a4ceb854a5769c..64984e0a59cac1bfade3b88766e6973e2500a0f3 100755 --- a/application/admin/view/default/goods/save_info.html +++ b/application/admin/view/default/goods/save_info.html @@ -153,124 +153,117 @@ -
+
- +添加规格 -
- -
- - - - {{if !empty($specifications['type'])}} - {{foreach $specifications.type as $type_v}} - - {{/foreach}} - {{/if}} - - - - - - - - - - {{if empty($specifications['value'])}} +
+
+ +
+
- × - - 价格(元)库存规格编码条形码原价(元) 操作
+ - - - - - - + {{if !empty($specifications['type'])}} + {{foreach $specifications.type as $type_v}} + + {{/foreach}} + {{/if}} + + + + + + - {{/if}} + + + {{if empty($specifications['value'])}} + + + + + + + + + {{/if}} - {{if !empty($specifications['value'])}} - {{foreach $specifications.value as $line_k=>$line_v}} - - {{foreach $line_v as $v}} - {{if isset($v['data_type'])}} - {{switch v.data_type}} - {{case spec}} - - {{/case}} + {{if !empty($specifications['value'])}} + {{foreach $specifications.value as $line_k=>$line_v}} + + {{foreach $line_v as $v}} + {{if isset($v['data_type'])}} + {{switch v.data_type}} + {{case spec}} + + {{/case}} - {{case base}} - - - - - - - {{/case}} - {{/switch}} - {{/if}} + {{case base}} + + + + + + + {{/case}} + {{/switch}} + {{/if}} + {{/foreach}} + {{/foreach}} - - {{/foreach}} - {{/if}} - -
- - - - - - - - - - - - + × + + 价格(元)库存规格编码条形码原价(元) 操作
+ + + + + + + + + + + +
- -
+ + - - - - - - - - - - - {{if $line_k gt 0}} - 复制 - 移除 - {{else /}} - - {{/if}} - + + + + + + + + + + + {{if $line_k gt 0}} + 复制 + 移除 + {{else /}} + + {{/if}} +
- +添加一行 - + {{/if}} + + + +添加规格 + +添加一行 + +
diff --git a/application/admin/view/default/public/header.html b/application/admin/view/default/public/header.html index 7c00b0a19a0cb770c7e712f0f72c121f8c558188..6813703a8d9dd1e7d1c9f09b5781a29c6e260a6e 100755 --- a/application/admin/view/default/public/header.html +++ b/application/admin/view/default/public/header.html @@ -16,4 +16,7 @@ {{/if}} + \ No newline at end of file diff --git a/public/static/admin/default/css/goods.css b/public/static/admin/default/css/goods.css index 006cd13cb7252da4b831bb6d0059929c114b9fa3..d2bfa8899be6e0a817aac10599c85cd87f4e1cc5 100755 --- a/public/static/admin/default/css/goods.css +++ b/public/static/admin/default/css/goods.css @@ -66,8 +66,8 @@ } .spec-images-tips { position: absolute; - left: 100px; - top: 60px; + left: 9px; + top: 30px; z-index: 2; padding: 2px 5px; white-space: nowrap; @@ -101,10 +101,20 @@ .spec-images-tips .am-checkbox { margin: 0px; min-height: auto; + height: 15px; + line-height: 15px; +} +.spec-images-tips .am-ucheck-icons { + width: 15px; + height: 15px; + line-height: 15px; } .spec-images-tips .am-checkbox input[type="checkbox"] { margin: 0 0 0 -4px; } +.spec-images-tips .msg-tips { + vertical-align: super; +} .spec-images-list { border: 1px solid #eee; padding: 10px; @@ -112,6 +122,8 @@ } .spec-images-list li { display: inline-block; + width: 100px; + margin: 0 10px 3px 0; } /** diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index 31213e7629b5e4affb5a73288807c609c9b6a108..12e4980613f6501270ef7e3a3cc61af56450fb07 100755 --- a/public/static/admin/default/js/goods.js +++ b/public/static/admin/default/js/goods.js @@ -29,6 +29,9 @@ $(function() html += ''; html += ''; $('.value-start').before(html); + + // 规格图片 + SpecImagesHandle(); }); // 规格列移除 @@ -42,6 +45,9 @@ $(function() { $('.specifications-table tr.line-not-first').remove(); } + + // 规格图片 + SpecImagesHandle(); }); // 添加一行规格值 @@ -66,6 +72,9 @@ $(function() { $(this).attr('value', ''); }); + + // 规格图片 + SpecImagesHandle(); }); // 规格行复制 @@ -77,6 +86,9 @@ $(function() $(this).attr('value', $(this).val()); }); $parent.after($parent.prop('outerHTML')); + + // 规格图片 + SpecImagesHandle(); }); // 规格行移除 @@ -89,19 +101,62 @@ $(function() $('.specifications-table th.table-title').remove(); $('.specifications-table td.table-value').remove(); } + + // 规格图片 + SpecImagesHandle(); }); // 规格首列事件 $('.spec-images-tips').on('change', 'input', function() { - if($(this).prop('checked')) + // 规格图片 + SpecImagesHandle(); + }); + + // 规格第一列输入事件 + $('.specifications-table tbody tr').on('change', 'td:eq(0) input', function() + { + // 规格图片 + SpecImagesHandle(); + }); + + // 规格图片 + function SpecImagesHandle() + { + if($('.spec-images-tips input').prop('checked')) { - console.log(1); + var temp_spec_all = {}, spec_all = []; + $('.specifications-table tbody tr').each(function(k, v) + { + var value = $(this).find('td:eq(0) input').val(); + temp_spec_all[value] = value; + }); + spec_all = Object.keys(temp_spec_all); + if(spec_all.length > 0) + { + for(var i in spec_all) + { + var temp_class = 'spec-images-items-'+spec_all[i]; + if($('ul.spec-images-list').find('.'+temp_class).length <= 0) + { + var html = '
  • '; + html += '' + html += ''; + html += '
    +上传图片
    '; + html += '
  • '; + $('ul.spec-images-list').append(html); + } + } + } } else { - console.log(0); + $('ul.spec-images-list').html(''); } - - }); + } // 手机详情添加 $(document).on('click', '.content-app-items-add-sub', function()