商品规格图片
parent
f78bc4fed3
commit
7790be58eb
|
|
@ -156,6 +156,12 @@
|
|||
<div id="goods-nav-operations" class="division-block goods-specifications">
|
||||
<label class="block nav-detail-title">商品规格</label>
|
||||
<span class="business-operations-submit specifications-nav-title-add">+添加规格</span>
|
||||
<div class="spec-images-tips">
|
||||
<label class="am-checkbox c-p">
|
||||
<input type="checkbox" value="1" data-am-ucheck />
|
||||
<span class="fs-12">首个规格选择添加图片</span>
|
||||
</label>
|
||||
</div>
|
||||
<table class="am-table am-table-bordered am-table-centered specifications-table m-t-10 m-b-10">
|
||||
<thead class="title-nav">
|
||||
<tr>
|
||||
|
|
@ -206,7 +212,7 @@
|
|||
{{if isset($v['data_type'])}}
|
||||
{{switch v.data_type}}
|
||||
{{case spec}}
|
||||
<td class="table-value-{{$v.data.key}}">
|
||||
<td class="table-value table-value-{{$v.data.key}}">
|
||||
<input type="text" name="specifications_value_{{$v.data.key}}[]" placeholder="规格值" value="{{$v.data.value}}" />
|
||||
</td>
|
||||
{{/case}}
|
||||
|
|
@ -245,6 +251,26 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<span class="business-operations-submit specifications-line-add">+添加一行</span>
|
||||
<ul class="spec-images-list">
|
||||
<li>
|
||||
<ul class="plug-file-upload-view spec-images-view" data-form-name="spec_images[]" data-max-number="1" data-dialog-type="images">
|
||||
<li>
|
||||
<input type="hidden" name="spec_images[]" value="" />
|
||||
<img src="{{$image_host}}/static/admin/default/images/default-images.png" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view">+上传图片</div>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="plug-file-upload-view spec-images-view" data-form-name="spec_images[]" data-max-number="1" data-dialog-type="images">
|
||||
<li>
|
||||
<input type="hidden" name="spec_images[]" value="" />
|
||||
<img src="{{$image_host}}/static/admin/default/images/default-images.png" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view">+上传图片</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 相册 -->
|
||||
|
|
@ -348,11 +374,5 @@ $(function()
|
|||
$('ul.attribute-items-ul-{{$v.id}}').dragsort({ dragSelector: 'i.drag-sort-submit', placeHolderTemplate: '<li class="drag-sort-dotted"></li>'});
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if !empty($data['content_app'])}}
|
||||
{{foreach $data.content_app as $v}}
|
||||
ImageFileUploadShow('.images-file-tag-{{$v.id}}');
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
});
|
||||
</script>
|
||||
|
|
@ -61,6 +61,58 @@
|
|||
.specifications-table > tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#goods-nav-operations {
|
||||
position: relative;
|
||||
}
|
||||
.spec-images-tips {
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 60px;
|
||||
z-index: 2;
|
||||
padding: 2px 5px;
|
||||
white-space: nowrap;
|
||||
border: solid 1px #FDEF9D;
|
||||
border-radius: 2px;
|
||||
background-color: #FEFBE6;
|
||||
color: #593C07;
|
||||
box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
|
||||
}
|
||||
.spec-images-tips::before {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
left: 15px;
|
||||
bottom: -5px;
|
||||
overflow: hidden;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
margin-top: -54px;
|
||||
background-color: #FEFBE6;
|
||||
border-style: solid;
|
||||
border-width: 0 1px 1px 0;
|
||||
border-color: #FDEF9D;
|
||||
font-size: 0;
|
||||
content: "";
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
|
||||
}
|
||||
.spec-images-tips .am-checkbox {
|
||||
margin: 0px;
|
||||
min-height: auto;
|
||||
}
|
||||
.spec-images-tips .am-checkbox input[type="checkbox"] {
|
||||
margin: 0 0 0 -4px;
|
||||
}
|
||||
.spec-images-list {
|
||||
border: 1px solid #eee;
|
||||
padding: 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.spec-images-list li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 属性
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ $(function()
|
|||
$('.title-start').before(html);
|
||||
|
||||
// value
|
||||
html = '<td class="table-value-'+index+'">';
|
||||
html = '<td class="table-value table-value-'+index+'">';
|
||||
html += '<input type="text" name="specifications_value_'+index+'[]" placeholder="规格值" />';
|
||||
html += '</td>';
|
||||
$('.value-start').before(html);
|
||||
|
|
@ -83,6 +83,24 @@ $(function()
|
|||
$('.specifications-table').on('click', '.line-remove', function()
|
||||
{
|
||||
$(this).parents('tr').remove();
|
||||
|
||||
if($('.specifications-table tbody tr').length <= 1)
|
||||
{
|
||||
$('.specifications-table th.table-title').remove();
|
||||
$('.specifications-table td.table-value').remove();
|
||||
}
|
||||
});
|
||||
|
||||
// 规格首列事件
|
||||
$('.spec-images-tips').on('change', 'input', function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
console.log(1);
|
||||
} else {
|
||||
console.log(0);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 手机详情添加
|
||||
|
|
@ -123,7 +141,6 @@ $(function()
|
|||
$content_tag.append(html);
|
||||
$content_tag.attr('index', index);
|
||||
$(this).attr('index', i+1);
|
||||
ImageFileUploadShow('.images-file-tag-'+index);
|
||||
});
|
||||
|
||||
// 手机详情删除
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ ul.plug-file-upload-view li {
|
|||
float: left;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: 0 10px 10px 0;
|
||||
margin: 0 10px 3px 0;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
border: 1px dashed #c2c2c2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue