Authored by liyalin

店铺装修基础模板

... ... @@ -30,6 +30,11 @@
<img src="/static/assets/images/decorator/app-product-list.png" alt="#">
</div>
[[/if]]
[[if item.moduleType == 'ProductListImg']]
<div class="app-product-list" non-delete="true" non-added="true" data-type="ProductListImg" data-title="编辑商品列表模块" data-index="[[index]]">
<img src="/static/assets/images/decorator/app-product-list.png" alt="#">
</div>
[[/if]]
[[/each]]
<div id="app-dragable"> <!-- 可拖拽的模块区域 -->
... ... @@ -185,10 +190,14 @@
[[/each]]
</div>
<!-- 增加模块区域 -->
<!-- 增加模块区域 过滤基础模板-->
[[each data as item index]]
[[if item.templateId != 3 && index == 0]]
<div class="btn add-modular-area" title="添加模块" style="[[data.length > 1 ? 'margin-top: -5px;': '']]">
<span class="glyphicon glyphicon-plus" style="top: -4px;"></span>
</div>
[[/if]]
[[/each]]
</div>
</script>
... ...
... ... @@ -147,11 +147,23 @@
[[/if]]
</div>
[[/if]]
[[if item.moduleType == 'ProductListImg']]
<div class="recommend-product" non-delete="true" non-added="true" data-type="ProductListImg" data-title="编辑推荐商品模块" data-index="[[index]]">
[[if item.moduleData]]
[[else]]
<img src="/static/assets/images/decorator/pc-product-list.png" alt="#" class="logo">
[[/if]]
</div>
[[/if]]
[[/each]]
</div>
[[each data as item index]]
[[if item.templateId != 3 && index == 0]]
<div class="btn add-modular-area" title="添加模块" data-style-area="2">
<span class="glyphicon glyphicon-plus" style="top: -4px;"></span>
</div>
[[/if]]
[[/each]]
</div>
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -5,10 +5,18 @@ var $ = require('jquery'),
base = require('./partials/Base');
// 默认系统模板
var systemTemplates =
var systemTemplates_1 =
{
shopId: 0,
templateName: '系统默认',
templateName: '基础模板',
templateId: 3,
createTime: '2016-12-14 14:42:00'
};
var systemTemplates_2 =
{
shopId: 0,
templateName: '经典模板',
templateId: 1,
createTime: '2016-12-14 14:42:00'
... ... @@ -16,7 +24,24 @@ var systemTemplates =
var shopTemplates = [];
var defaultModuleData = [
var defaultModuleData_1 = [
{
dataValid: false, // 系统模板,默认只包含模块信息,并不包含模块内容;新增的模块,也不包含模块内容。默认数据是非法的
moduleType: "ShopBanner",
templateId: 3
},
{
dataValid: true,
moduleType: "ProductSort",
templateId: 3
},
{
dataValid: true,
moduleType: "ProductListImg",
templateId: 3
}
];
var defaultModuleData_2 = [
{
dataValid: false, // 系统模板,默认只包含模块信息,并不包含模块内容;新增的模块,也不包含模块内容。默认数据是非法的
moduleType: "ShopBanner",
... ... @@ -31,6 +56,7 @@ var defaultModuleData = [
}
];
var t = new common.tab({
el: "#platformTab",
click: function () {
... ... @@ -155,7 +181,8 @@ var Bll = {
template.createTime = common.util.__dateFormat(new Date(template.createTime * 1000), 'yyyy-MM-dd hh:mm:ss');
}
});
shopTemplates.unshift(systemTemplates);
shopTemplates.unshift(systemTemplates_2);
shopTemplates.unshift(systemTemplates_1);
}
}, true)
},
... ... @@ -167,7 +194,11 @@ var Bll = {
var index = $(curTemplate).data('index');
// index = 0:系统模板,默认数据即可,不查询
if(index == 0) {
Bll.moduleDataList = defaultModuleData;
Bll.moduleDataList = defaultModuleData_1;
return;
}
if(index == 1) {
Bll.moduleDataList = defaultModuleData_2;
return;
}
... ...