...
|
...
|
@@ -29,6 +29,7 @@ var Bll = { |
|
|
Brands: [],
|
|
|
Brands1: {},
|
|
|
Brdata: [],
|
|
|
moduleimgs: [],
|
|
|
contentDatas: [],
|
|
|
module: null,
|
|
|
__render: function (selecter, templater, data) {
|
...
|
...
|
@@ -42,7 +43,7 @@ var Bll = { |
|
|
var d = new common.dialog({
|
|
|
title: (!!~index ? "修改" : "添加") + (typeof btn[0].__title != "undefined" ? btn[0].__title : btn[0].button_name),
|
|
|
content: common.util.__template2($("#" + btn[0].dialog).html(), module),
|
|
|
width: '50%',
|
|
|
width: '70%',
|
|
|
button: [{
|
|
|
value: "保存",
|
|
|
callback: function () {
|
...
|
...
|
@@ -726,46 +727,22 @@ $(document).on("click", "#batchAddImage", function () { |
|
|
bucket: "yhb-img01"
|
|
|
});
|
|
|
new common.dialog({
|
|
|
title: "添加多张" + Bll.module.contentData.template_intro,
|
|
|
content: common.util.__template2($("#template_dialog_imgmodule").html(), {}),
|
|
|
title: "添加多张图片",
|
|
|
content: common.util.__template2($("#template-batchAddImage").html(), {}),
|
|
|
width: '80%',
|
|
|
button: [{
|
|
|
value: "确定",
|
|
|
callback: function () {
|
|
|
if (Bll.module.contentData.template_name == "singleImage") {
|
|
|
var button = Button[1];
|
|
|
Bll.moduleimgs.forEach(function (item, index) {
|
|
|
var m = {templateKey: button.template_name};
|
|
|
m.contentData = $.extend(true, {}, button);
|
|
|
m.contentData.data[0].src = item;
|
|
|
Bll.contentDatas.push(m);
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
var button = Button[2];
|
|
|
if (Bll.module.contentData.template_name == "NL2R") {
|
|
|
//多张
|
|
|
var imgs = [];
|
|
|
Bll.module.contentData.data.left.length = 0;
|
|
|
Bll.moduleimgs.forEach(function (item, index) {
|
|
|
imgs.push(item);
|
|
|
if (imgs.length == 2) {
|
|
|
var m = {templateKey: button.template_name};
|
|
|
m.contentData = $.extend(true, {}, button);
|
|
|
m.contentData.data[0].src = imgs[0];
|
|
|
m.contentData.data[1].src = imgs[1];
|
|
|
Bll.contentDatas.push(m);
|
|
|
imgs.length = 0;
|
|
|
}
|
|
|
|
|
|
Bll.module.contentData.data.left[index]= $.extend(true, {},addObj["NL2R_left"]);
|
|
|
Bll.module.contentData.data.left[index].src = item;
|
|
|
});
|
|
|
if (imgs.length > 0) {
|
|
|
var m = {templateKey: button.template_name};
|
|
|
m.contentData = $.extend(true, {}, button);
|
|
|
m.contentData.data[0].src = imgs[0];
|
|
|
Bll.contentDatas.push(m);
|
|
|
imgs.length = 0;
|
|
|
}
|
|
|
}
|
|
|
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
|
|
|
Bll.renderDialog("NL2R-template");
|
|
|
//console.log(Bll.module.contentData.data);
|
|
|
},
|
|
|
css: "btn-primary"
|
|
|
}]
|
...
|
...
|
@@ -775,7 +752,8 @@ $(document).on("click", "#batchAddImage", function () { |
|
|
obj.datas.forEach(function (item) {
|
|
|
Bll.moduleimgs.push(item);
|
|
|
});
|
|
|
Bll.__render(".modal-body", "template_dialog_imgmodule", {datas: Bll.moduleimgs});
|
|
|
Bll.__render("#moduleimgs", "template-batchAddImage", {datas: Bll.moduleimgs});
|
|
|
console.log(Bll.moduleimgs);
|
|
|
components1.init();
|
|
|
});
|
|
|
|
...
|
...
|
|