mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-07-07 06:15:29 +08:00
商品规格新增排序操作+优化、商品参数优化
This commit is contained in:
@ -183,250 +183,7 @@
|
||||
<!-- 规格 -->
|
||||
<div id="goods-nav-operations" class="division-block" data-spec-add-max-number="{{:MyC('common_spec_add_max_number', 3, true)}}">
|
||||
<label class="block nav-detail-title">商品规格</label>
|
||||
<!-- 规格快捷操作 -->
|
||||
<div class="spec-quick am-margin-bottom-lg">
|
||||
<div class="am-alert am-alert-warning am-radius" data-am-alert>
|
||||
快捷操作可以快速创建商品SKU,大量节省SKU编辑时间,快捷操作数据不影响SKU数据,仅生成的时候重新覆盖SKU。
|
||||
</div>
|
||||
<span class="business-operations-submit quick-spec-title-add">+快捷操作</span>
|
||||
<span class="business-operations-submit am-margin-left-sm am-icon-gg quick-spec-created">生成规格</span>
|
||||
<div class="goods-specifications business-form-group" {{if empty($data['spec_base'])}}style="display: none;"{{/if}}>
|
||||
<table class="am-table am-table-bordered am-table-centered am-table-striped am-table-hover table-thead-beautify">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="spec-quick-th-title">规格名</th>
|
||||
<th class="spec-quick-th-value">规格值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($data['spec_base'])}}
|
||||
{{foreach $data.spec_base as $spec_base_key=>$spec_base}}
|
||||
<tr>
|
||||
<td class="am-text-middle">
|
||||
<i class="am-close am-close-spin quick-title-remove">×</i>
|
||||
<input type="text" value="{{$spec_base.title}}" name="spec_base_title_{{$spec_base_key}}" placeholder="规格名" />
|
||||
</td>
|
||||
<td class="spec-quick-td-value am-cf">
|
||||
{{if !empty($spec_base['value'])}}
|
||||
{{foreach $spec_base.value as $value}}
|
||||
<div class="am-fl am-margin-xs value-item">
|
||||
<input type="text" class="am-fl" name="spec_base_value_{{$spec_base_key}}[]" value="{{$value}}" placeholder="规格值" />
|
||||
<i class="am-close quick-value-remove">×</i>
|
||||
</div>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
<div class="am-fl am-margin-xs value-item am-text-left"><span class="business-operations-submit quick-spec-value-add" data-index="{{$spec_base_key}}">+添加规格值</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 规格常规操作 -->
|
||||
<span class="business-operations-submit specifications-nav-title-add">+添加规格</span>
|
||||
<span class="business-operations-submit am-margin-left-sm specifications-nav-set-all am-icon-cogs" data-am-modal="{target: '#spec-popup-all-operation'}"> 高级批量设置</span>
|
||||
<div class="goods-specifications business-form-group am-form-group-refreshing am-padding-top-sm">
|
||||
<!-- 所有规格批量操作弹层 -->
|
||||
<div class="am-popup" id="spec-popup-all-operation">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">高级批量设置</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<div class="am-alert am-alert-secondary spec-title-container"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">销售价格</label>
|
||||
<input type="text" placeholder="价格" class="am-radius popup_all_price" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的销售金额" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">重量</label>
|
||||
<input type="number" placeholder="重量" class="am-radius popup_all_weight" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">编码</label>
|
||||
<input type="text" placeholder="编码" class="am-radius popup_all_coding" maxlength="80" data-validation-message="规格编码最多80个字符" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">条形码</label>
|
||||
<input type="text" placeholder="条形码" class="am-radius popup_all_barcode" maxlength="80" data-validation-message="条形码最多80个字符" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">原价</label>
|
||||
<input type="text" placeholder="原价" class="am-radius popup_all_original_price" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing am-text-center">
|
||||
<button type="button" class="am-btn am-btn-warning am-radius am-btn-sm am-margin-right-lg" data-am-modal-close>取消</button>
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm am-margin-left-lg">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 单个规格批量操作弹层 -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="spec-modal-all-operation">
|
||||
<div class="am-modal-dialog">
|
||||
<div class="am-modal-hd">批量操作
|
||||
<a href="javascript: void(0)" class="am-close" data-am-modal-close>×</a>
|
||||
</div>
|
||||
<div class="am-modal-bd">
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="text" class="am-form-field" placeholder="批量设置的值" />
|
||||
<span class="am-input-group-btn">
|
||||
<button type="button" class="am-btn am-btn-default">确认</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 规格列表 -->
|
||||
<table class="am-table am-table-bordered am-table-centered specifications-table am-margin-bottom-sm am-table-striped am-table-hover table-thead-beautify">
|
||||
<thead class="title-nav">
|
||||
<tr>
|
||||
{{if !empty($specifications['type'])}}
|
||||
{{foreach $specifications.type as $type_v}}
|
||||
<th class="table-title table-title-{{$type_v.id}}">
|
||||
<i class="am-close title-nav-remove" data-index="{{$type_v.id}}">×</i>
|
||||
<input type="text" name="specifications_name_{{$type_v.id}}" placeholder="规格名" value="{{$type_v.name}}" data-validation-message="请填写规格名" required />
|
||||
</th>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
<th class="title-start">
|
||||
<span>价格(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>重量(kg)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>规格编码</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>条形码</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>原价(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th class="extend-btn">扩展</th>
|
||||
<th class="operation-btn">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if empty($specifications['value'])}}
|
||||
<tr class="line-0" data-line-tag=".line-0">
|
||||
<td class="am-text-middle value-start">
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的销售金额" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="80" data-validation-message="条形码最多80个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_original_price[]" placeholder="原价" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="hidden" name="specifications_extends[]" value="" class="line-extend-input" />
|
||||
<span class="am-text-xs cr-blue c-p line-extend-btn">编辑</span>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<!--operation-->
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
|
||||
{{if !empty($specifications['value'])}}
|
||||
{{foreach $specifications.value as $line_k=>$line_v}}
|
||||
<tr class="line-{{$line_k}} {{if $line_k gt 0}} line-not-first{{/if}}" data-line-tag=".line-{{$line_k}}">
|
||||
{{foreach $line_v as $v}}
|
||||
{{if isset($v['data_type'])}}
|
||||
{{switch v.data_type}}
|
||||
{{case spec}}
|
||||
<td class="am-text-middle table-value table-value-{{$v.data.key}}">
|
||||
<input type="text" name="specifications_value_{{$v.data.key}}[]" placeholder="规格值" value="{{$v.data.value}}" data-validation-message="请填写规格值" required />
|
||||
</td>
|
||||
{{/case}}
|
||||
|
||||
{{case base}}
|
||||
<td class="am-text-middle value-start">
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的销售金额" value="{{$v.data.price}}" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" value="{{if $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" value="{{$v.data.coding}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="80" data-validation-message="条形码最多80个字符" value="{{$v.data.barcode}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_original_price[]" placeholder="原价" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" value="{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="hidden" name="specifications_extends[]" value="{{$v.data.extends}}" class="line-extend-input" />
|
||||
<span class="am-text-xs cr-blue c-p line-extend-btn">编辑</span>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
{{if $line_k gt 0}}
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-xs line-copy">复制</span>
|
||||
<span class="am-text-xs cr-red c-p line-remove">移除</span>
|
||||
{{else /}}
|
||||
<!--operation-->
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/case}}
|
||||
{{/switch}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="business-operations-submit specifications-line-add">+添加一行</span>
|
||||
<ul class="spec-images-list">
|
||||
<div class="am-alert am-alert-warning am-radius" data-am-alert>
|
||||
规格名称与规格值保持一致,相同规格名称添加一次即可,重复添加则后面覆盖前面,顺序不影响前端展示效果。
|
||||
<span class="business-operations-submit specifications-line-images-add">+添加规格图片</span>
|
||||
<span class="business-operations-submit specifications-line-images-auto-add am-margin-left-sm am-icon-dot-circle-o"> 第<input type="text" class="am-inline-block am-text-center am-margin-horizontal-xs am-radius" value="1" />列规格自动生成</span>
|
||||
</div>
|
||||
{{if !empty($specifications['type'])}}
|
||||
{{foreach $specifications.type as $type}}
|
||||
{{if !empty($type['value'])}}
|
||||
{{foreach $type.value as $spec_key=>$spec}}
|
||||
{{if !empty($spec['images'])}}
|
||||
<li class="spec-images-items spec-images-items-{{$type.id}}{{$spec_key}}">
|
||||
<input type="text" name="spec_images_name[{{$type.id}}{{$spec_key}}]" placeholder="规格名称" class="am-radius t-c" data-validation-message="请填写规格名称" value="{{$spec.name}}" required >
|
||||
<ul class="plug-file-upload-view spec-images-view-{{$type.id}}{{$spec_key}}" data-form-name="spec_images[{{$type.id}}{{$spec_key}}]" data-max-number="1" data-delete='0' data-dialog-type="images">
|
||||
<li>
|
||||
<input type="hidden" name="spec_images[{{$type.id}}{{$spec_key}}]" value="{{$spec.images_old}}" data-validation-message="请上传规格图片" required />
|
||||
<img src="{{$spec.images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view-{{$type.id}}{{$spec_key}}">+上传图片</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
{{include file="goods/spec" /}}
|
||||
</div>
|
||||
|
||||
<!-- 参数 -->
|
||||
|
||||
248
application/admin/view/default/goods/spec.html
Normal file
248
application/admin/view/default/goods/spec.html
Normal file
@ -0,0 +1,248 @@
|
||||
<!-- 规格快捷操作 -->
|
||||
<div class="spec-quick am-margin-bottom-lg">
|
||||
<div class="am-alert am-alert-warning am-radius" data-am-alert>
|
||||
快捷操作可以快速创建商品SKU,大量节省SKU编辑时间,快捷操作数据不影响SKU数据,仅生成的时候重新覆盖SKU。
|
||||
</div>
|
||||
<span class="business-operations-submit quick-spec-title-add">+快捷操作</span>
|
||||
<span class="business-operations-submit am-margin-left-sm am-icon-gg quick-spec-created">生成规格</span>
|
||||
<div class="goods-specifications business-form-group" {{if empty($data['spec_base'])}}style="display: none;"{{/if}}>
|
||||
<table class="am-table am-table-bordered am-table-centered am-table-striped am-table-hover table-thead-beautify">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="spec-quick-th-title">规格名</th>
|
||||
<th class="spec-quick-th-value">规格值</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($data['spec_base'])}}
|
||||
{{foreach $data.spec_base as $spec_base_key=>$spec_base}}
|
||||
<tr>
|
||||
<td class="am-text-middle">
|
||||
<i class="am-close am-close-spin quick-title-remove">×</i>
|
||||
<input type="text" value="{{$spec_base.title}}" name="spec_base_title_{{$spec_base_key}}" placeholder="规格名" />
|
||||
</td>
|
||||
<td class="spec-quick-td-value am-cf">
|
||||
{{if !empty($spec_base['value'])}}
|
||||
{{foreach $spec_base.value as $value}}
|
||||
<div class="am-fl am-margin-xs value-item">
|
||||
<input type="text" class="am-fl" name="spec_base_value_{{$spec_base_key}}[]" value="{{$value}}" placeholder="规格值" />
|
||||
<i class="am-close quick-value-remove">×</i>
|
||||
</div>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
<div class="am-fl am-margin-xs value-item am-text-left"><span class="business-operations-submit quick-spec-value-add" data-index="{{$spec_base_key}}">+添加规格值</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 规格常规操作 -->
|
||||
<span class="business-operations-submit specifications-nav-title-add">+添加规格</span>
|
||||
<span class="business-operations-submit am-margin-left-sm specifications-nav-set-all am-icon-cogs" data-am-modal="{target: '#spec-popup-all-operation'}"> 高级批量设置</span>
|
||||
<div class="goods-specifications business-form-group am-form-group-refreshing am-padding-top-sm">
|
||||
<!-- 规格列表 -->
|
||||
<div class="specifications-container am-scrollable-horizontal">
|
||||
<table class="am-table am-table-bordered am-table-centered specifications-table am-margin-bottom-sm am-table-striped am-table-hover table-thead-beautify am-margin-bottom-0">
|
||||
<thead class="title-nav">
|
||||
<tr>
|
||||
{{if !empty($specifications['type'])}}
|
||||
{{foreach $specifications.type as $type_v}}
|
||||
<th class="table-title table-title-{{$type_v.id}}">
|
||||
<i class="am-close title-nav-remove" data-index="{{$type_v.id}}">×</i>
|
||||
<input type="text" name="specifications_name_{{$type_v.id}}" placeholder="规格名" value="{{$type_v.name}}" data-validation-message="请填写规格名" required />
|
||||
</th>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
<th class="title-start">
|
||||
<span>价格(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>重量(kg)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>规格编码</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>条形码</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th>
|
||||
<span>原价(元)</span>
|
||||
<i class="am-icon-edit"></i>
|
||||
</th>
|
||||
<th class="extend-btn">扩展</th>
|
||||
<th class="operation-btn">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if empty($specifications['value'])}}
|
||||
<tr class="line-0" data-line-tag=".line-0">
|
||||
<td class="am-text-middle value-start">
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的销售金额" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="80" data-validation-message="条形码最多80个字符" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_original_price[]" placeholder="原价" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="hidden" name="specifications_extends[]" value="" class="line-extend-input" />
|
||||
<span class="am-text-xs cr-blue c-p line-extend-btn">编辑</span>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<!--operation-->
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
|
||||
{{if !empty($specifications['value'])}}
|
||||
{{foreach $specifications.value as $line_k=>$line_v}}
|
||||
<tr class="line-{{$line_k}} {{if $line_k gt 0}} line-not-first{{/if}}" data-line-tag=".line-{{$line_k}}">
|
||||
{{foreach $line_v as $v}}
|
||||
{{if isset($v['data_type'])}}
|
||||
{{switch v.data_type}}
|
||||
{{case spec}}
|
||||
<td class="am-text-middle table-value table-value-{{$v.data.key}}">
|
||||
<input type="text" name="specifications_value_{{$v.data.key}}[]" placeholder="规格值" value="{{$v.data.value}}" data-validation-message="请填写规格值" required />
|
||||
</td>
|
||||
{{/case}}
|
||||
|
||||
{{case base}}
|
||||
<td class="am-text-middle value-start">
|
||||
<input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的销售金额" value="{{$v.data.price}}" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="number" name="specifications_weight[]" placeholder="重量" class="am-radius" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" value="{{if $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_coding[]" placeholder="编码" class="am-radius" maxlength="80" data-validation-message="规格编码最多80个字符" value="{{$v.data.coding}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_barcode[]" placeholder="条形码" class="am-radius" maxlength="80" data-validation-message="条形码最多80个字符" value="{{$v.data.barcode}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="specifications_original_price[]" placeholder="原价" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" value="{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="hidden" name="specifications_extends[]" value="{{$v.data.extends}}" class="line-extend-input" />
|
||||
<span class="am-text-xs cr-blue c-p line-extend-btn">编辑</span>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="top">上移</span>
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="bottom">下移</span>
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-xs line-copy">复制</span>
|
||||
<span class="am-text-xs cr-red c-p line-remove">移除</span>
|
||||
</td>
|
||||
{{/case}}
|
||||
{{/switch}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="am-margin-top-sm">
|
||||
<span class="business-operations-submit specifications-line-add">+添加一行</span>
|
||||
</div>
|
||||
<div class="spec-images-list">
|
||||
<div class="am-alert am-alert-warning am-radius" data-am-alert>
|
||||
规格名称与规格值保持一致,相同规格名称添加一次即可,重复添加则后面覆盖前面,顺序不影响前端展示效果。
|
||||
<span class="business-operations-submit specifications-line-images-add">+添加规格图片</span>
|
||||
<span class="business-operations-submit specifications-line-images-auto-add am-margin-left-sm am-icon-dot-circle-o"> 第<input type="text" class="am-inline-block am-text-center am-margin-horizontal-xs am-radius" value="1" />列规格自动生成</span>
|
||||
</div>
|
||||
<ul class="spec-images-content">
|
||||
{{if !empty($specifications['type'])}}
|
||||
{{foreach $specifications.type as $type}}
|
||||
{{if !empty($type['value'])}}
|
||||
{{foreach $type.value as $spec_key=>$spec}}
|
||||
{{if !empty($spec['images'])}}
|
||||
<li class="spec-images-items spec-images-items-{{$type.id}}{{$spec_key}}">
|
||||
<input type="text" name="spec_images_name[{{$type.id}}{{$spec_key}}]" placeholder="规格名称" class="am-radius t-c" data-validation-message="请填写规格名称" value="{{$spec.name}}" required >
|
||||
<ul class="plug-file-upload-view spec-images-view-{{$type.id}}{{$spec_key}}" data-form-name="spec_images[{{$type.id}}{{$spec_key}}]" data-max-number="1" data-delete='0' data-dialog-type="images">
|
||||
<li>
|
||||
<input type="hidden" name="spec_images[{{$type.id}}{{$spec_key}}]" value="{{$spec.images_old}}" data-validation-message="请上传规格图片" required />
|
||||
<img src="{{$spec.images}}" />
|
||||
<i>×</i>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view-{{$type.id}}{{$spec_key}}">+上传图片</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 所有规格批量操作弹层 -->
|
||||
<div class="am-popup" id="spec-popup-all-operation">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">高级批量设置</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<div class="am-alert am-alert-secondary spec-title-container"></div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">销售价格</label>
|
||||
<input type="text" placeholder="价格" class="am-radius popup_all_price" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的销售金额" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">重量</label>
|
||||
<input type="number" placeholder="重量" class="am-radius popup_all_weight" maxlength="80" min="0.00" max="100000000.00" step="0.01" data-validation-message="规格重量 0.00~100000000.00" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">编码</label>
|
||||
<input type="text" placeholder="编码" class="am-radius popup_all_coding" maxlength="80" data-validation-message="规格编码最多80个字符" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">条形码</label>
|
||||
<input type="text" placeholder="条形码" class="am-radius popup_all_barcode" maxlength="80" data-validation-message="条形码最多80个字符" />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">原价</label>
|
||||
<input type="text" placeholder="原价" class="am-radius popup_all_original_price" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" />
|
||||
</div>
|
||||
<div class="am-form-group am-form-group-refreshing am-text-center">
|
||||
<button type="button" class="am-btn am-btn-warning am-radius am-btn-sm am-margin-right-lg" data-am-modal-close>取消</button>
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm am-margin-left-lg">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 单个规格批量操作弹层 -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="spec-modal-all-operation">
|
||||
<div class="am-modal-dialog">
|
||||
<div class="am-modal-hd">批量操作
|
||||
<a href="javascript: void(0)" class="am-close" data-am-modal-close>×</a>
|
||||
</div>
|
||||
<div class="am-modal-bd">
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="text" class="am-form-field" placeholder="批量设置的值" />
|
||||
<span class="am-input-group-btn">
|
||||
<button type="button" class="am-btn am-btn-default">确认</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -27,7 +27,8 @@
|
||||
<p class="am-margin-left-lg">2.1 Config 配置方法</p>
|
||||
<p class="am-margin-left-lg">2.2 Pay 支付方法</p>
|
||||
<p class="am-margin-left-lg">2.3 Respond 回调方法</p>
|
||||
<p class="am-margin-left-lg">2.4 Refund 退款方法(可选)</p>
|
||||
<p class="am-margin-left-lg">2.4 Notify 异步回调方法(可选、未定义则调用Respond方法)</p>
|
||||
<p class="am-margin-left-lg">2.5 Refund 退款方法(可选、未定义则不能发起原路退款)</p>
|
||||
<p>3 可自定义输出内容方法</p>
|
||||
<p class="am-margin-left-lg">3.1 SuccessReturn 支付成功(可选)</p>
|
||||
<p class="am-margin-left-lg">3.2 ErrorReturn 支付失败(可选)</p>
|
||||
|
||||
@ -13,44 +13,48 @@
|
||||
</div>
|
||||
|
||||
<!--表列表数据 -->
|
||||
<div class="parameters-content business-form-group am-form-group-refreshing am-padding-top-0 am-margin-top-sm">
|
||||
<table class="am-table am-table-bordered am-table-centered am-table-striped am-table-hover am-margin-bottom-sm parameters-table table-thead-beautify">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="spec-quick-th-title">展示范围</th>
|
||||
<th class="spec-quick-th-title">参数名称</th>
|
||||
<th class="spec-quick-th-value">参数值</th>
|
||||
<th class="spec-quick-th-value">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($parameters) and is_array($parameters)}}
|
||||
{{foreach $parameters as $pv}}
|
||||
<tr>
|
||||
<td class="am-text-middle">
|
||||
<select name="parameters_type[]" class="am-radius chosen-select" data-validation-message="请选择商品参数展示类型">
|
||||
{{if !empty($common_goods_parameters_type_list)}}
|
||||
{{foreach $common_goods_parameters_type_list as $v}}
|
||||
<option value="{{$v.value}}" {{if $pv['type'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</select>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="parameters_name[]" placeholder="参数名称" value="{{$pv.name}}" data-validation-message="请填写参数名称" maxlength="160" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="parameters_value[]" placeholder="参数值" value="{{$pv.value}}" maxlength="200" data-validation-message="请填写参数值" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="top">上移</span>
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="bottom">下移</span>
|
||||
<span class="am-text-xs cr-red c-p line-remove">移除</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="business-operations-submit parameters-line-add">+添加一行</span>
|
||||
<div class="business-form-group am-padding-top-0">
|
||||
<div class="parameters-container am-margin-top-sm am-scrollable-horizontal">
|
||||
<table class="am-table am-table-bordered am-table-centered am-table-striped am-table-hover am-margin-bottom-sm parameters-table table-thead-beautify am-margin-bottom-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="spec-quick-th-title">展示范围</th>
|
||||
<th class="spec-quick-th-title">参数名称</th>
|
||||
<th class="spec-quick-th-value">参数值</th>
|
||||
<th class="spec-quick-th-value">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($parameters) and is_array($parameters)}}
|
||||
{{foreach $parameters as $pv}}
|
||||
<tr>
|
||||
<td class="am-text-middle">
|
||||
<select name="parameters_type[]" class="am-radius chosen-select" data-validation-message="请选择商品参数展示类型">
|
||||
{{if !empty($common_goods_parameters_type_list)}}
|
||||
{{foreach $common_goods_parameters_type_list as $v}}
|
||||
<option value="{{$v.value}}" {{if $pv['type'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</select>
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="parameters_name[]" placeholder="参数名称" value="{{$pv.name}}" data-validation-message="请填写参数名称" maxlength="160" required />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<input type="text" name="parameters_value[]" placeholder="参数值" value="{{$pv.value}}" maxlength="200" data-validation-message="请填写参数值" />
|
||||
</td>
|
||||
<td class="am-text-middle">
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="top">上移</span>
|
||||
<span class="am-text-xs cr-blue c-p am-margin-right-sm line-move" data-type="bottom">下移</span>
|
||||
<span class="am-text-xs cr-red c-p line-remove">移除</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="am-margin-top-sm">
|
||||
<span class="business-operations-submit parameters-line-add">+添加一行</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -590,7 +590,15 @@ class OrderService
|
||||
|
||||
// 支付数据校验
|
||||
$pay_name = 'payment\\'.PAYMENT_TYPE;
|
||||
$pay_ret = (new $pay_name($payment['config']))->Respond(array_merge(input('get.'), input('post.')));
|
||||
if(!class_exists($pay_name))
|
||||
{
|
||||
return DataReturn('支付方式不存在['.PAYMENT_TYPE.']', -1);
|
||||
}
|
||||
$payment_obj = new $pay_name($payment['config']);
|
||||
|
||||
// 是否存在异步方法
|
||||
$method = method_exists($payment_obj, 'Notify') ? 'Notify' : 'Respond';
|
||||
$pay_ret = $payment_obj->$method(array_merge(input('get.'), input('post.')));
|
||||
if(!isset($pay_ret['code']) || $pay_ret['code'] != 0)
|
||||
{
|
||||
return $pay_ret;
|
||||
|
||||
@ -3,6 +3,19 @@
|
||||
+=========================================================+
|
||||
全局
|
||||
1. 新增签到插件
|
||||
2. 新增积分商城插件
|
||||
3. 支付插件支持定义Notify独立异步方法
|
||||
4. 用户地址坐标与身份证信息优化
|
||||
5. 动态数据列表组件条件新增气泡式弹出层
|
||||
6. 支付宝支付插件异步处理优化
|
||||
7. 地区新增全量数据接口
|
||||
8. 公共动态数据表单参数优化
|
||||
9. 友情链接新增手机端显隐控制
|
||||
10. 商品详情新增icon+面板公共信息
|
||||
11. 微信小程序登录授权循环bug修复
|
||||
12. 插件缓存数据优化、重新安装保留配置信息
|
||||
13. 小程序商品标题两行显示优化
|
||||
14. 首页手动模式配置下商品缺失修复
|
||||
|
||||
web端
|
||||
|
||||
@ -14,6 +27,7 @@ web端
|
||||
插件
|
||||
|
||||
|
||||
|
||||
+=========================================================+
|
||||
ShopXO 1.9.2 Release 20201210 http://shopxo.net
|
||||
+=========================================================+
|
||||
|
||||
@ -612,6 +612,39 @@ table.am-table .am-btn-danger:hover {
|
||||
#parameters-quick-container .am-dropdown-content {
|
||||
width: 260px;
|
||||
}
|
||||
.parameters-container {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.parameters-table {
|
||||
border: 0;
|
||||
}
|
||||
.parameters-table thead tr > th:first-child,
|
||||
.parameters-table tbody tr > td:first-child {
|
||||
border-left: 0;
|
||||
}
|
||||
.parameters-table thead tr > th:last-child,
|
||||
.parameters-table tbody tr > td:last-child {
|
||||
position: sticky;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0px 0px 1px #ddd;
|
||||
-moz-box-shadow: 0px 0px 1px #ddd;
|
||||
box-shadow: 0px 0px 1px #ddd;
|
||||
-webkit-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
-moz-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
}
|
||||
.parameters-table thead tr > th {
|
||||
min-width: 100px;
|
||||
}
|
||||
.parameters-table thead tr > th:last-child {
|
||||
width: 120px;
|
||||
min-width: 120px;
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 动态数据列表
|
||||
|
||||
@ -74,11 +74,14 @@
|
||||
right: 0px;
|
||||
z-index: 2;
|
||||
}
|
||||
.specifications-table th {
|
||||
min-width: 100px;
|
||||
}
|
||||
.specifications-table th.operation-btn {
|
||||
width: 80px;
|
||||
min-width: 150px;
|
||||
}
|
||||
.specifications-table th.extend-btn {
|
||||
width: 45px;
|
||||
min-width: 45px;
|
||||
}
|
||||
#goods-nav-operations {
|
||||
position: relative;
|
||||
@ -96,6 +99,16 @@
|
||||
width: 100px;
|
||||
margin: 5px 10px 10px 0;
|
||||
}
|
||||
.specifications-container {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.specifications-table {
|
||||
border: 0;
|
||||
}
|
||||
.specifications-table thead tr > th:first-child,
|
||||
.specifications-table tbody tr > td:first-child {
|
||||
border-left: 0;
|
||||
}
|
||||
.specifications-table thead th i {
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -103,10 +116,26 @@
|
||||
width: 30px !important;
|
||||
padding: 1px !important;
|
||||
}
|
||||
|
||||
.specifications-table thead tr > th:nth-last-child(-n+2),
|
||||
.specifications-table tbody tr > td:nth-last-child(-n+2) {
|
||||
position: sticky;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
}
|
||||
.specifications-table thead tr > th:nth-last-child(2),
|
||||
.specifications-table tbody tr > td:nth-last-child(2) {
|
||||
right: 150px;
|
||||
-webkit-box-shadow: 0px 0px 1px #ddd;
|
||||
-moz-box-shadow: 0px 0px 1px #ddd;
|
||||
box-shadow: 0px 0px 1px #ddd;
|
||||
-webkit-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
-moz-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
|
||||
}
|
||||
|
||||
/**
|
||||
* 属性
|
||||
* app详情
|
||||
*/
|
||||
i.drag-sort-submit {
|
||||
|
||||
@ -77,16 +77,8 @@ function FormTableHeightHandle()
|
||||
|
||||
$(function()
|
||||
{
|
||||
// 商品参数添加
|
||||
var $parameters_table = $('.parameters-table');
|
||||
$('.parameters-line-add').on('click', function()
|
||||
{
|
||||
// 追加内容
|
||||
ParametersItemHtmlCreated();
|
||||
});
|
||||
|
||||
// 商品参数移动
|
||||
$parameters_table.on('click', '.line-move', function()
|
||||
// 商品规格和参数上下移动
|
||||
$('.specifications-table,.parameters-table').on('click', '.line-move', function()
|
||||
{
|
||||
// 类型
|
||||
var type = $(this).data('type') || null;
|
||||
@ -97,7 +89,7 @@ $(function()
|
||||
}
|
||||
|
||||
// 索引
|
||||
var count = $parameters_table.find('tbody tr').length;
|
||||
var count = $(this).parents('table').find('tbody tr').length;
|
||||
var index = $(this).parents('tr').index() || 0;
|
||||
var $parent = $(this).parents('tr');
|
||||
switch(type)
|
||||
@ -128,6 +120,14 @@ $(function()
|
||||
}
|
||||
});
|
||||
|
||||
// 商品参数添加
|
||||
var $parameters_table = $('.parameters-table');
|
||||
$('.parameters-line-add').on('click', function()
|
||||
{
|
||||
// 追加内容
|
||||
ParametersItemHtmlCreated();
|
||||
});
|
||||
|
||||
// 商品参数移除
|
||||
$parameters_table.on('click', '.line-remove', function()
|
||||
{
|
||||
|
||||
@ -134,10 +134,6 @@ $(function()
|
||||
|
||||
var index = parseInt(Math.random()*1000001);
|
||||
var html = $('.specifications-table').find('tbody tr:last').prop('outerHTML');
|
||||
if(html.indexOf('<!--operation-->') >= 0)
|
||||
{
|
||||
html = html.replace(/<!--operation-->/ig, '<span class="fs-12 cr-blue c-p m-r-5 line-copy">复制</span> <span class="fs-12 cr-red c-p line-remove">移除</span>');
|
||||
}
|
||||
$('.specifications-table').append(html);
|
||||
$('.specifications-table').find('tbody tr:last').attr('class', 'line-'+index+' line-not-first');
|
||||
$('.specifications-table').find('tbody tr:last').attr('data-line-tag', '.line-'+index);
|
||||
@ -152,6 +148,14 @@ $(function()
|
||||
// 规格行复制
|
||||
$(document).on('click', '.specifications-table .line-copy', function()
|
||||
{
|
||||
// 是否存在规格名称
|
||||
if($('.specifications-table th.table-title').length <= 0)
|
||||
{
|
||||
Prompt('请先添加规格');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 开始复制
|
||||
var index = parseInt(Math.random()*1000001);
|
||||
var $parent = $(this).parents('tr');
|
||||
$parent.find('input').each(function(k, v)
|
||||
@ -166,13 +170,22 @@ $(function()
|
||||
// 规格行移除
|
||||
$(document).on('click', '.specifications-table .line-remove', function()
|
||||
{
|
||||
// 不能全部移除,至少需要保留一行
|
||||
if($('.specifications-table tbody tr').length <= 1)
|
||||
{
|
||||
Prompt('至少需要保留一行规格值');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 移除操作
|
||||
$(this).parents('tr').remove();
|
||||
|
||||
// 规格列判断
|
||||
if($('.specifications-table tbody tr').length <= 1)
|
||||
{
|
||||
$('.specifications-table th.table-title').remove();
|
||||
$('.specifications-table td.table-value').remove();
|
||||
$('ul.spec-images-list').html('');
|
||||
$('.spec-images-list ul.spec-images-content').html('');
|
||||
}
|
||||
});
|
||||
|
||||
@ -200,11 +213,11 @@ $(function()
|
||||
html += '</ul>';
|
||||
html += '<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view-'+index+'">+上传图片</div>';
|
||||
html += '</li>';
|
||||
$('ul.spec-images-list').append(html);
|
||||
$('.spec-images-list ul.spec-images-content').append(html);
|
||||
});
|
||||
|
||||
// 规格图片删除
|
||||
$('ul.spec-images-list').on('click', 'ul.plug-file-upload-view li i', function()
|
||||
$('.spec-images-list ul.spec-images-content').on('click', 'ul.plug-file-upload-view li i', function()
|
||||
{
|
||||
$(this).parents('li.spec-images-items').remove();
|
||||
});
|
||||
@ -240,61 +253,62 @@ $(function()
|
||||
data.push(value);
|
||||
}
|
||||
});
|
||||
|
||||
// 创建图片规格
|
||||
if(data.length > 0)
|
||||
if(data.length <= 0)
|
||||
{
|
||||
// 获取已存在规格图片
|
||||
var data_old = [];
|
||||
$('ul.spec-images-list li.spec-images-items').each(function(k, v)
|
||||
{
|
||||
var value = $(this).find('input').val() || null;
|
||||
if(value == null)
|
||||
{
|
||||
$(this).remove();
|
||||
} else if(data_old.indexOf(value) == -1)
|
||||
{
|
||||
data_old.push(value);
|
||||
}
|
||||
});
|
||||
Prompt('请先填写规格');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 循环添加
|
||||
for(var i in data)
|
||||
// 获取已存在规格图片
|
||||
var data_old = [];
|
||||
$('.spec-images-list ul.spec-images-content li.spec-images-items').each(function(k, v)
|
||||
{
|
||||
var value = $(this).find('input').val() || null;
|
||||
if(value == null)
|
||||
{
|
||||
// 开始添加,不存在则不添加
|
||||
if(data_old.indexOf(data[i]) == -1)
|
||||
{
|
||||
var index = parseInt(Math.random()*1000001);
|
||||
var temp_class = 'spec-images-items-'+index;
|
||||
var html = '<li class="spec-images-items '+temp_class+'">';
|
||||
html += '<input type="text" name="spec_images_name['+index+']" value="'+data[i]+'" placeholder="规格名称" class="am-radius t-c" data-validation-message="请填写规格名称" required />'
|
||||
html += '<ul class="plug-file-upload-view spec-images-view-'+index+'" data-form-name="spec_images['+index+']" data-max-number="1" data-dialog-type="images">';
|
||||
html += '<li>';
|
||||
html += '<input type="text" name="spec_images['+index+']" data-validation-message="请上传规格图片" required />';
|
||||
html += '<img src="'+__attachment_host__+'/static/admin/default/images/default-images.jpg" />';
|
||||
html += '<i>×</i>';
|
||||
html += '</li>';
|
||||
html += '</ul>';
|
||||
html += '<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view-'+index+'">+上传图片</div>';
|
||||
html += '</li>';
|
||||
$('ul.spec-images-list').append(html);
|
||||
}
|
||||
$(this).remove();
|
||||
} else if(data_old.indexOf(value) == -1)
|
||||
{
|
||||
data_old.push(value);
|
||||
}
|
||||
});
|
||||
|
||||
// 原始图片规格不存在指定规格列中则移除
|
||||
for(var i in data_old)
|
||||
// 循环添加
|
||||
for(var i in data)
|
||||
{
|
||||
// 开始添加,不存在则不添加
|
||||
if(data_old.indexOf(data[i]) == -1)
|
||||
{
|
||||
if(data.indexOf(data_old[i]) == -1)
|
||||
var index = parseInt(Math.random()*1000001);
|
||||
var temp_class = 'spec-images-items-'+index;
|
||||
var html = '<li class="spec-images-items '+temp_class+'">';
|
||||
html += '<input type="text" name="spec_images_name['+index+']" value="'+data[i]+'" placeholder="规格名称" class="am-radius t-c" data-validation-message="请填写规格名称" required />'
|
||||
html += '<ul class="plug-file-upload-view spec-images-view-'+index+'" data-form-name="spec_images['+index+']" data-max-number="1" data-dialog-type="images">';
|
||||
html += '<li>';
|
||||
html += '<input type="text" name="spec_images['+index+']" data-validation-message="请上传规格图片" required />';
|
||||
html += '<img src="'+__attachment_host__+'/static/admin/default/images/default-images.jpg" />';
|
||||
html += '<i>×</i>';
|
||||
html += '</li>';
|
||||
html += '</ul>';
|
||||
html += '<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view-'+index+'">+上传图片</div>';
|
||||
html += '</li>';
|
||||
$('.spec-images-list ul.spec-images-content').append(html);
|
||||
}
|
||||
}
|
||||
|
||||
// 原始图片规格不存在指定规格列中则移除
|
||||
for(var i in data_old)
|
||||
{
|
||||
if(data.indexOf(data_old[i]) == -1)
|
||||
{
|
||||
$('.spec-images-list ul.spec-images-content li.spec-images-items').each(function(k, v)
|
||||
{
|
||||
$('ul.spec-images-list li.spec-images-items').each(function(k, v)
|
||||
var value = $(this).find('input').val() || null;
|
||||
if(value == data_old[i])
|
||||
{
|
||||
var value = $(this).find('input').val() || null;
|
||||
if(value == data_old[i])
|
||||
{
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -527,8 +541,7 @@ $(function()
|
||||
|
||||
|
||||
|
||||
// 快捷操作
|
||||
// 规格列添加
|
||||
// 规格快捷操作 - 规格列添加
|
||||
$('.quick-spec-title-add').on('click', function()
|
||||
{
|
||||
var spec_max = $('#goods-nav-operations').data('spec-add-max-number') || 3;
|
||||
@ -565,7 +578,7 @@ $(function()
|
||||
$(this).parent().before(html);
|
||||
});
|
||||
|
||||
// 规格名称移除
|
||||
// 规格快捷操作 - 规格名称移除
|
||||
$(document).on('click', '.spec-quick table .quick-title-remove', function()
|
||||
{
|
||||
$(this).parents('tr').remove();
|
||||
@ -575,13 +588,13 @@ $(function()
|
||||
}
|
||||
});
|
||||
|
||||
// 规格值移除
|
||||
// 规格快捷操作 - 规格值移除
|
||||
$(document).on('click', '.spec-quick table .value-item .quick-value-remove', function()
|
||||
{
|
||||
$(this).parent().remove();
|
||||
});
|
||||
|
||||
// 生成规格
|
||||
// 规格快捷操作 - 生成规格
|
||||
$('.quick-spec-created').on('click', function()
|
||||
{
|
||||
var spec = [];
|
||||
@ -649,10 +662,6 @@ $(function()
|
||||
{
|
||||
// 添加规格值
|
||||
var html = $('.specifications-table').find('tbody tr:last').prop('outerHTML');
|
||||
if(html.indexOf('<!--operation-->') >= 0)
|
||||
{
|
||||
html = html.replace(/<!--operation-->/ig, '<span class="fs-12 cr-blue c-p m-r-5 line-copy">复制</span> <span class="fs-12 cr-red c-p line-remove">移除</span>');
|
||||
}
|
||||
$('.specifications-table').append(html);
|
||||
$('.specifications-table').find('tbody tr:last').attr('class', 'line-'+index+' line-not-first');
|
||||
$('.specifications-table').find('tbody tr:last').attr('data-line-tag', '.line-'+index);
|
||||
|
||||
@ -143,6 +143,12 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view { border-bottom:
|
||||
*/
|
||||
iframe { border: 0; }
|
||||
|
||||
/* 表单全屏 */
|
||||
.am-popup .am-form-group,
|
||||
.am-modal .am-form-group,
|
||||
.business-form-block {
|
||||
padding: 10px 5px !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* H5
|
||||
@ -163,9 +169,6 @@ iframe { border: 0; }
|
||||
form.am-form .am-form-group:hover, .plug-file-upload-view:hover { background: #f6f9fc; }
|
||||
form.am-form .am-form-group-refreshing:hover { background: none; }
|
||||
|
||||
/* 弹窗 */
|
||||
.am-popup form.am-form .am-form-group, .am-modal form.am-form .am-form-group, .business-form-block { padding: 10px 5px; }
|
||||
|
||||
/* 地址联动 */
|
||||
.region-linkage select { width: 33%; display: -webkit-inline-box; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user