Showing
4 changed files
with
58 additions
and
6 deletions
@@ -30,6 +30,11 @@ | @@ -30,6 +30,11 @@ | ||
30 | <img src="/static/assets/images/decorator/app-product-list.png" alt="#"> | 30 | <img src="/static/assets/images/decorator/app-product-list.png" alt="#"> |
31 | </div> | 31 | </div> |
32 | [[/if]] | 32 | [[/if]] |
33 | + [[if item.moduleType == 'ProductListImg']] | ||
34 | + <div class="app-product-list" non-delete="true" non-added="true" data-type="ProductListImg" data-title="编辑商品列表模块" data-index="[[index]]"> | ||
35 | + <img src="/static/assets/images/decorator/app-product-list.png" alt="#"> | ||
36 | + </div> | ||
37 | + [[/if]] | ||
33 | [[/each]] | 38 | [[/each]] |
34 | 39 | ||
35 | <div id="app-dragable"> <!-- 可拖拽的模块区域 --> | 40 | <div id="app-dragable"> <!-- 可拖拽的模块区域 --> |
@@ -185,10 +190,14 @@ | @@ -185,10 +190,14 @@ | ||
185 | [[/each]] | 190 | [[/each]] |
186 | </div> | 191 | </div> |
187 | 192 | ||
188 | - <!-- 增加模块区域 --> | 193 | + <!-- 增加模块区域 过滤基础模板--> |
194 | + [[each data as item index]] | ||
195 | + [[if item.templateId != 3 && index == 0]] | ||
189 | <div class="btn add-modular-area" title="添加模块" style="[[data.length > 1 ? 'margin-top: -5px;': '']]"> | 196 | <div class="btn add-modular-area" title="添加模块" style="[[data.length > 1 ? 'margin-top: -5px;': '']]"> |
190 | <span class="glyphicon glyphicon-plus" style="top: -4px;"></span> | 197 | <span class="glyphicon glyphicon-plus" style="top: -4px;"></span> |
191 | </div> | 198 | </div> |
199 | + [[/if]] | ||
200 | + [[/each]] | ||
192 | </div> | 201 | </div> |
193 | </script> | 202 | </script> |
194 | 203 |
@@ -147,11 +147,23 @@ | @@ -147,11 +147,23 @@ | ||
147 | [[/if]] | 147 | [[/if]] |
148 | </div> | 148 | </div> |
149 | [[/if]] | 149 | [[/if]] |
150 | + [[if item.moduleType == 'ProductListImg']] | ||
151 | + <div class="recommend-product" non-delete="true" non-added="true" data-type="ProductListImg" data-title="编辑推荐商品模块" data-index="[[index]]"> | ||
152 | + [[if item.moduleData]] | ||
153 | + [[else]] | ||
154 | + <img src="/static/assets/images/decorator/pc-product-list.png" alt="#" class="logo"> | ||
155 | + [[/if]] | ||
156 | + </div> | ||
157 | + [[/if]] | ||
150 | [[/each]] | 158 | [[/each]] |
151 | </div> | 159 | </div> |
160 | + [[each data as item index]] | ||
161 | + [[if item.templateId != 3 && index == 0]] | ||
152 | <div class="btn add-modular-area" title="添加模块" data-style-area="2"> | 162 | <div class="btn add-modular-area" title="添加模块" data-style-area="2"> |
153 | <span class="glyphicon glyphicon-plus" style="top: -4px;"></span> | 163 | <span class="glyphicon glyphicon-plus" style="top: -4px;"></span> |
154 | </div> | 164 | </div> |
165 | + [[/if]] | ||
166 | + [[/each]] | ||
155 | </div> | 167 | </div> |
156 | </div> | 168 | </div> |
157 | </script> | 169 | </script> |
134 KB
@@ -5,10 +5,18 @@ var $ = require('jquery'), | @@ -5,10 +5,18 @@ var $ = require('jquery'), | ||
5 | base = require('./partials/Base'); | 5 | base = require('./partials/Base'); |
6 | 6 | ||
7 | // 默认系统模板 | 7 | // 默认系统模板 |
8 | -var systemTemplates = | 8 | +var systemTemplates_1 = |
9 | { | 9 | { |
10 | shopId: 0, | 10 | shopId: 0, |
11 | - templateName: '系统默认', | 11 | + templateName: '基础模板', |
12 | + templateId: 3, | ||
13 | + createTime: '2016-12-14 14:42:00' | ||
14 | + | ||
15 | +}; | ||
16 | +var systemTemplates_2 = | ||
17 | +{ | ||
18 | + shopId: 0, | ||
19 | + templateName: '经典模板', | ||
12 | templateId: 1, | 20 | templateId: 1, |
13 | createTime: '2016-12-14 14:42:00' | 21 | createTime: '2016-12-14 14:42:00' |
14 | 22 | ||
@@ -16,7 +24,24 @@ var systemTemplates = | @@ -16,7 +24,24 @@ var systemTemplates = | ||
16 | 24 | ||
17 | var shopTemplates = []; | 25 | var shopTemplates = []; |
18 | 26 | ||
19 | -var defaultModuleData = [ | 27 | +var defaultModuleData_1 = [ |
28 | + { | ||
29 | + dataValid: false, // 系统模板,默认只包含模块信息,并不包含模块内容;新增的模块,也不包含模块内容。默认数据是非法的 | ||
30 | + moduleType: "ShopBanner", | ||
31 | + templateId: 3 | ||
32 | + }, | ||
33 | + { | ||
34 | + dataValid: true, | ||
35 | + moduleType: "ProductSort", | ||
36 | + templateId: 3 | ||
37 | + }, | ||
38 | + { | ||
39 | + dataValid: true, | ||
40 | + moduleType: "ProductListImg", | ||
41 | + templateId: 3 | ||
42 | + } | ||
43 | +]; | ||
44 | +var defaultModuleData_2 = [ | ||
20 | { | 45 | { |
21 | dataValid: false, // 系统模板,默认只包含模块信息,并不包含模块内容;新增的模块,也不包含模块内容。默认数据是非法的 | 46 | dataValid: false, // 系统模板,默认只包含模块信息,并不包含模块内容;新增的模块,也不包含模块内容。默认数据是非法的 |
22 | moduleType: "ShopBanner", | 47 | moduleType: "ShopBanner", |
@@ -31,6 +56,7 @@ var defaultModuleData = [ | @@ -31,6 +56,7 @@ var defaultModuleData = [ | ||
31 | } | 56 | } |
32 | ]; | 57 | ]; |
33 | 58 | ||
59 | + | ||
34 | var t = new common.tab({ | 60 | var t = new common.tab({ |
35 | el: "#platformTab", | 61 | el: "#platformTab", |
36 | click: function () { | 62 | click: function () { |
@@ -155,7 +181,8 @@ var Bll = { | @@ -155,7 +181,8 @@ var Bll = { | ||
155 | template.createTime = common.util.__dateFormat(new Date(template.createTime * 1000), 'yyyy-MM-dd hh:mm:ss'); | 181 | template.createTime = common.util.__dateFormat(new Date(template.createTime * 1000), 'yyyy-MM-dd hh:mm:ss'); |
156 | } | 182 | } |
157 | }); | 183 | }); |
158 | - shopTemplates.unshift(systemTemplates); | 184 | + shopTemplates.unshift(systemTemplates_2); |
185 | + shopTemplates.unshift(systemTemplates_1); | ||
159 | } | 186 | } |
160 | }, true) | 187 | }, true) |
161 | }, | 188 | }, |
@@ -167,7 +194,11 @@ var Bll = { | @@ -167,7 +194,11 @@ var Bll = { | ||
167 | var index = $(curTemplate).data('index'); | 194 | var index = $(curTemplate).data('index'); |
168 | // index = 0:系统模板,默认数据即可,不查询 | 195 | // index = 0:系统模板,默认数据即可,不查询 |
169 | if(index == 0) { | 196 | if(index == 0) { |
170 | - Bll.moduleDataList = defaultModuleData; | 197 | + Bll.moduleDataList = defaultModuleData_1; |
198 | + return; | ||
199 | + } | ||
200 | + if(index == 1) { | ||
201 | + Bll.moduleDataList = defaultModuleData_2; | ||
171 | return; | 202 | return; |
172 | } | 203 | } |
173 | 204 |
-
Please register or login to post a comment