...
|
...
|
@@ -51,11 +51,19 @@ var Bll = { |
|
|
Bll.base = new base();
|
|
|
// 加载模板列表
|
|
|
let index = 0;
|
|
|
let defaltFlag = true;
|
|
|
$.each(shopTemplates, function(_index, template) {
|
|
|
if(template.flag && template.flag === 1) {
|
|
|
index = _index;
|
|
|
Bll.templateType = template.templateType;
|
|
|
return;
|
|
|
if(defaltFlag){
|
|
|
if(template.status == 2){
|
|
|
defaltFlag = false;
|
|
|
index = _index;
|
|
|
Bll.templateType = template.templateType;
|
|
|
return;
|
|
|
}else if(template.flag && template.flag === 1) {
|
|
|
index = _index;
|
|
|
Bll.templateType = template.templateType;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
Bll.renderTemplateList(index);
|
...
|
...
|
@@ -830,6 +838,7 @@ var Bll = { |
|
|
columns: [
|
|
|
{
|
|
|
display: '直播封面',
|
|
|
width:250,
|
|
|
render: function(item) {
|
|
|
return common.util.__template2($('#upload-image-template').html(), {item: item});
|
|
|
}
|
...
|
...
|
@@ -842,6 +851,7 @@ var Bll = { |
|
|
},
|
|
|
{
|
|
|
display: '直播介绍',
|
|
|
width:250,
|
|
|
render: function(item) {
|
|
|
var htmlArr = [];
|
|
|
htmlArr.push('<div data-index="' + item.__index + '">');
|
...
|
...
|
@@ -1216,21 +1226,6 @@ var Bll = { |
|
|
callback: function() {
|
|
|
let validation = false;
|
|
|
let moduleType = Bll.moduleDataList[index].moduleType;
|
|
|
if(moduleType == 'RecommendProduct' || moduleType == 'AppRecommendProduct') {
|
|
|
validation = Bll.validator.validateModule(moduleType, Bll.recommendProduct);
|
|
|
//获取推荐商品详细信息
|
|
|
Bll.getRecommendProductDetailData();
|
|
|
if(searchProductInfo == null || searchProductInfo === undefined || searchProductInfo.length <= 0){
|
|
|
common.util.__tip('推荐商品模块自动获取该店铺下商品为空,请先在该店铺下添加可售商品!', 'warning');
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
validation = Bll.validator.validateModule(moduleType, Bll.moduleGrid.__rows);
|
|
|
}
|
|
|
if(! validation) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 单模块校验通过
|
|
|
Bll.moduleDataList[index].dataValid = true;
|
|
|
|
...
|
...
|
@@ -1243,11 +1238,33 @@ var Bll = { |
|
|
}
|
|
|
|
|
|
if(moduleType == 'RecommendProduct' || moduleType == 'AppRecommendProduct') {
|
|
|
validation = Bll.validator.validateModule(moduleType, Bll.recommendProduct);
|
|
|
Bll.saveRecommendProduct(index);
|
|
|
var displayType = Bll.recommendProduct.displayType;
|
|
|
if(displayType == 1){// 根据skn查询
|
|
|
sknList = Bll.recommendProduct.sknList;
|
|
|
if(sknList.length >0){
|
|
|
var productInfo = Bll.getProductDetailBySkns(sknList.toString());
|
|
|
Bll.moduleDataList[index].moduleData.productInfo = productInfo;
|
|
|
}
|
|
|
}else if(displayType == 0){ // 通过搜索查询商品信息;
|
|
|
var lineNumber = Bll.recommendProduct.lineNumber;
|
|
|
var order = Bll.moduleDataList[index].moduleData.data[0].order;
|
|
|
var shopId = Bll.shopId;
|
|
|
searchProductInfo = Bll.searchProductDetail(lineNumber, order, shopId);
|
|
|
Bll.moduleDataList[index].moduleData.productInfo = searchProductInfo;
|
|
|
if(searchProductInfo == null || searchProductInfo === undefined || searchProductInfo.length <= 0){
|
|
|
common.util.__tip('推荐商品模块自动获取该店铺下商品为空,请先在该店铺下添加可售商品!', 'warning');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
validation = Bll.validator.validateModule(moduleType, Bll.moduleGrid.__rows);
|
|
|
Bll.moduleDataList[index].moduleData.data = Bll.moduleGrid.__rows;
|
|
|
}
|
|
|
|
|
|
if(! validation) {
|
|
|
return false;
|
|
|
}
|
|
|
// 处理模块数据,增加资源位标识,用于热点分析
|
|
|
$.each(Bll.moduleDataList[index].moduleData.data, function(index, item) {
|
|
|
item.id = Bll.generateRandomNumber();
|
...
|
...
|
|