spec_many_template.html
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!-- 商品规格属性模板 -->
<script id="tpl_spec_attr" type="text/template">
<% for(var j=0;j< spec_attr.length;j++){ %>
<div class="spec-group-item" data-index="<%=j%>" data-group-id="<%=spec_attr[j].group_id%>">
<div class="spec-group-name">
<span><%=spec_attr[j].group_name%></span>
<i class="spec-group-delete fa fa-trash icon-shanchu1" title="点击删除"></i>
</div>
<div class="spec-list am-cf">
<% for(var k=0;k<spec_attr[j].spec_items.length;k++){ %>
<div class="spec-item am-fl" data-item-index="<%=k%>">
<span><%=spec_attr[j].spec_items[k].spec_value%></span>
<i class="spec-item-delete fa fa-trash icon-shanchu1" title="点击删除"></i>
</div>
<% } %>
<div class="spec-item-add am-cf am-fl">
<input type="text" class="ipt-specItem am-fl am-field-valid">
<button type="button" class="btn-addSpecItem btn btn-xs btn-success am-fl">添加</button>
</div>
</div>
</div>
<% } %>
</script>
<!-- 商品规格table模板 -->
<script id="tpl_spec_table" type="text/template">
<tbody>
<tr>
<% for(var i=0;i< spec_attr.length;i++){ %>
<th><%=spec_attr[i].group_name%></th>
<% } %>
<th>报名费用</th>
</tr>
<% for(var i=0;i<spec_list.length;i++){ %>
<tr data-index="<%=i%>" data-sku-id="<%=spec_list[i].spec_sku_id %>">
<% for(var k=0;k<spec_list[i].rows.length;k++){ %>
<td class="td-spec-value am-text-middle" rowspan="<%=spec_list[i].rows[k].rowspan%>">
<%=spec_list[i].rows[k].spec_value%>
</td>
<% } %>
<td>
<input type="number" name="price" data-rule="required" value="<%=spec_list[i].form.price%>" class="am-field-valid ipt-w80"
required>
</td>
</tr>
<% } %>
</tbody>
</script>