Authored by zhaoqing

店铺去除应用功能

... ... @@ -25,7 +25,7 @@
<!-- 底部按钮组 -->
<div class="left-footer">
<div class="btn-group save-btn">
<div class="btn-group dropup">
<div class="btn-group dropup" style="margin-left:40px">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
存储 <span class="caret"></span>
</button>
... ... @@ -34,7 +34,7 @@
<li><a href="javascript:;" class="btn btn-info" id="saveBtn">另存为</a></li>
</ul>
</div>
<a href="javascript:;" class="btn btn-warning" id="applyBtn">应用</a>
<!--<a href="javascript:;" class="btn btn-warning" id="applyBtn">应用</a>-->
</div>
</div>
</div>
... ...
... ... @@ -93,11 +93,20 @@
<!-- 两张图 -->
[[if item.moduleType == 'DoubleImage']]
[[if item.moduleData]]
<div class="app-double-image modular-editor" data-type="DoubleImage" data-title="编辑两张图模块" data-index="[[index]]"
style="[[item.moduleData.properties.isModuleMargin == 0 ? 'margin-bottom: 0;' : '']]">
<img src="[[item.moduleData.data[0].pic]]" alt="#" class="img-item">
<img src="[[item.moduleData.data[1].pic]]" alt="#" class="img-item">
</div>
[[if item.moduleData.properties]]
<div class="app-double-image modular-editor" data-type="DoubleImage" data-title="编辑两张图模块" data-index="[[index]]"
style="[[item.moduleData.properties.isModuleMargin == 0 ? 'margin-bottom: 0;' : '']]">
<img src="[[item.moduleData.data[0].pic]]" alt="#" class="img-item">
<img src="[[item.moduleData.data[1].pic]]" alt="#" class="img-item">
</div>
[[else]]
<div class="app-double-image modular-editor" data-type="DoubleImage" data-title="编辑两张图模块" data-index="[[index]]">
<div class="border">
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
[[/if]]
[[else]]
<div class="app-double-image modular-editor" data-type="DoubleImage" data-title="编辑两张图模块" data-index="[[index]]">
<div class="border">
... ... @@ -151,6 +160,18 @@
<img src="[[item.moduleData.data[2].pic]]" alt="#" class="img-item42">
</div>
</div>
[[else]]
<div class="app-triple-image modular-editor" data-type="TripleImage" data-title="编辑三张图模块" data-index="[[index]]">
<div class="border">
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
<div class="border">
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
<div class="border" style="border-width: 0;">
<img src="/static/assets/images/decorator/yoho-logo.png" alt="#" class="logo">
</div>
</div>
[[/if]]
[[else]]
<div class="app-triple-image modular-editor" data-type="TripleImage" data-title="编辑三张图模块" data-index="[[index]]">
... ...
... ... @@ -95,22 +95,37 @@ $.fn.ajaxfileupload = function(options) {
var width = $(img).width(),
height = $(img).height();
if (settings.valid_spec == true
&& (Math.abs(width - settings.width_limit) > 10
|| Math.abs(height - settings.height_limit) > 10) ) {
// 图片规格超出限制
settings.onComplete.apply($element, [{
status: false,
message: '只允许上传' + settings.width_limit + '*' + settings.height_limit + '的文件,第' + (index+1) + '个文件不符合要求'
}, settings.params]);
var _$element = $element.clone();
var _$parent = $element.parent();
$element.remove();
_$parent.append(_$element);
_$element.ajaxfileupload(settings);
}
if (settings.valid_spec == true && (Math.abs(width - settings.width_limit) > 10 || Math.abs(height - settings.height_limit) > 10) )
{
// 图片规格超出限制
settings.onComplete.apply($element, [{
status: false,
message: '只允许上传' + settings.width_limit + '*' + settings.height_limit + '的文件,第' + (index+1) + '个文件不符合要求'
}, settings.params]);
var _$element = $element.clone();
var _$parent = $element.parent();
$element.remove();
_$parent.append(_$element);
_$element.ajaxfileupload(settings);
}
// 校验通过,上传至服务器
uploading_file = true;
// 记录文件的原始尺寸
settings.params.attrs = {
width: width,
height: height,
size: file.size
};
var ret = settings.onStart.apply($element, [settings.params]);
wrapElement($element);
if (ret !== false) {
$element.parent('form').submit(function (e) {
e.stopPropagation();
}).submit();
}
// }
};
};
if (file.size / 1024 > settings.size_limit) {
... ...
... ... @@ -1242,6 +1242,14 @@ var Bll = {
Bll.moduleDataList[index].moduleData.properties = {};
}
// 处理三张图模块,保存展示类型
if(moduleType == 'TripleImage') {
Bll.moduleDataList[index].moduleData.properties.displayType = 1;
Bll.moduleDataList[index].moduleData.properties.isModuleMargin = 0;
}else if(moduleType == 'DoubleImage'){
Bll.moduleDataList[index].moduleData.properties.isModuleMargin = 0;
}
if(moduleType == 'RecommendProduct' || moduleType == 'AppRecommendProduct') {
validation = Bll.validator.validateModule(moduleType, Bll.recommendProduct);
Bll.saveRecommendProduct(index);
... ... @@ -1758,6 +1766,7 @@ $(document).on('click', '.decorator-template', function() {
// 重新加载 模板列表 模块,切换选中效果
Bll.renderTemplateList(index);
switchTemplate();
});
// 保存或者更新装修模板时,对模板数据做统一处理: 校验,数据组装
... ...