Authored by 陶雨

资源位4.6新增楼层基本完成,还剩折扣专场和会员专享楼层展示

... ... @@ -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();
});
... ...
... ... @@ -166,7 +166,7 @@
<li>
<div class="form-group">
<label>品类名称:</label>
<input type="text" placeholder="品类名称" value="[[item.name]]" class="observe" data-field="[[index]].name" required="required">
<input type="text" placeholder="品类名称" value="[[item.categoryName]]" class="observe" data-field="[[index]].categoryName" required="required">
<select name="goTo" class="observe" value="[[item.url.action]]" data-field="[[index]].url.action">
[[layout action_template]]
</select>
... ...
... ... @@ -307,25 +307,67 @@
</div>
[[else if module.contentData.template_name=='NL2R']]
<div class="NL2R">
<div class="row">
<div class="col-sm-8 matchImage" style="margin-bottom: 0;padding: 0">
<img src="[[module.contentData.data.left.length ? module.contentData.data.left[0].src : '']]">
</div>
<div class="col-sm-4 matchImage" style="margin-bottom: 0;padding: 0">
[[each module.contentData.data.right as item index]]
<img style="height: 50%;width: 100%" src="[[item.src]]">
[[/each]]
</div>
</div>
</div>
[[else if module.contentData.template_name=='outletsHotBrands']]
<div class="outletsHotBrands">
</div>
[[else if module.contentData.template_name=='threePicture']]
<div class="threePicture">
<div class="row">
<ul class="custom-pic clearfix image-list-box resource-row li3">
[[each module.contentData.data as item index]]
<li><img src="[[item.src]]"></li>
[[/each]]
</ul>
</div>
</div>
[[else if module.contentData.template_name=='recommendCategory']]
<div class="recommendCategory">
<div class="custom-pic">
<div class="hot-brand-title" style="margin:0px auto; text-align:center;border: 1px solid;">[[module.contentData.data.title]]</div>
<ul class="custom-pic clearfix image-list-box resource-row li4">
[[each module.contentData.data.categoryList as item index]]
<li><img src="[[item.navigateImageSrcApp]]"></li>
[[/each]]
</ul>
</div>
[[else if module.contentData.template_name=='categoryNavigation']]
<div class="categoryNavigation">
[[each module.contentData.data as item index]]
<label style="background-color: white;">[[item.categoryName]]</label>
[[/each]]
</div>
[[else if module.contentData.template_name=='discountActivity']]
<div class="discountActivity">
<div class="recommend-info">
<p class="title">[[module.contentData.data.title.name]]<a class="more" href="#">[[module.contentData.data.title.more_name]]</a></p>
</div>
</div>
[[else if module.contentData.template_name=='会员专享']]
<div class="会员专享">
</div>
[[else if module.contentData.template_name=='offCodeArea']]
<div class="offCodeArea">
<div class="recommend-info">
<p class="title">[[module.contentData.data.title.name]]<a class="more" href="#">[[module.contentData.data.title.more_name]]</a></p>
<p class="big-pic"><img src="[[module.contentData.data.list[0].src]]"></p>
<div class="col-sm-6 matchImage" style="padding-left: 3px">
<img src="[[module.contentData.data.list[1].src]]">
</div>
<div class="col-sm-6 matchImage">
<img style="height: 50%;width: 100%" src="[[module.contentData.data.list[2].src]]">
<img style="height: 50%;width: 100%" src="[[module.contentData.data.list[3].src]]">
</div>
<p class="big-pic"><img src="[[module.contentData.data.list[4].src]]"></p>
</div>
</div>
\ No newline at end of file
... ...