Authored by 陶雨

资源内容管理

... ... @@ -72,7 +72,7 @@ var initView = function() {
* @param data 数据源
* @param fn 点击确定之后的方法
*/
var popDialog = function(title, selector, data, fn) {
var popDialog = function(title, selector, data, fn,index) {
console.log(selector);
var dialog = common.dialog.confirm(title,
... ... @@ -81,6 +81,8 @@ var popDialog = function(title, selector, data, fn) {
fn();
initView();
return false;
},function() {
resources.contentData[index].contentData = JSON.stringify(data);
});
return dialog;
};
... ... @@ -114,14 +116,12 @@ var buttons=[
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
},
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
popDialog("新增文本", "#text-template", json, function() {
var dialog = popDialog("新增文本", "#text-template", json, function() {
json.data.text = $("#myArea").val();
resources.contentData[index].contentData = JSON.stringify(json);
dialog.close();
});
}
}
... ... @@ -153,9 +153,6 @@ var buttons=[
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
},
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var list = [];
... ... @@ -387,10 +384,6 @@ var buttons=[
data: {}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
... ... @@ -426,20 +419,78 @@ var buttons=[
},
createItem:function() {
var json = {
template_name: "recommendContentOne",
"template_name": "recommendContentOne",
"template_intro": "一张大图一个大的推荐和4个小图推荐",
data: {}
"data": {
"title": {
"name": "",
"more_name": "",
"more_url": {
"action": "",
"url": ""
}
},
"big_image": {
"0": {
"src": "",
"url": {
"action": "",
"url": ""
},
"title": ""
}
},
"list": {
"0": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"1": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"2": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"3": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#recommendContent-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("推荐(1T-1L-4R)", "#recommendContent-template", json, function() {
dialog.close();
},index);
$("#recommendContent-bottom").html(common.util.__template2($("#recommendContent-grid").html(), json));
e.init();
}
}
},
... ... @@ -470,20 +521,94 @@ var buttons=[
},
createItem:function() {
var json = {
template_name: "recommendContentTwo",
"template_name": "recommendContentTwo",
"template_intro": "一张大图和6个小图推荐",
data: {}
"data": {
"title": {
"name": "",
"more_name": "",
"more_url": {
"action": "",
"url": ""
}
},
"big_image": {
"0": {
"src": "",
"url": {
"action": "",
"url": ""
},
"title": ""
}
},
"list": {
"0": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"1": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"2": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"3": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"4": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"5": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#recommendContent-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("推荐(1T-6F)", "#recommendContent-template", json, function() {
dialog.close();
},index);
$("#recommendContent-bottom").html(common.util.__template2($("#recommendContent-grid").html(), json));
e.init();
}
}
},
... ... @@ -553,20 +678,95 @@ var buttons=[
},
createItem:function() {
var json = {
template_name: "recommendContentThree",
"template_name": "recommendContentThree",
"template_intro": "一张大图12个小图推荐",
data: {}
"data": {
"big_image": {
"0": {
"src": "",
"url": {},
"title": ""
}
},
"list": {
"0": {
"src": "",
"title": "",
"url": {}
},
"1": {
"src": "",
"title": "",
"url": {}
},
"2": {
"src": "",
"title": "",
"url": {}
},
"3": {
"src": "",
"title": "",
"url": {}
},
"4": {
"src": "",
"title": "",
"url": {}
},
"5": {
"src": "",
"title": "",
"url": {}
},
"6": {
"src": "",
"title": "",
"url": {}
},
"7": {
"src": "",
"title": "",
"url": {}
},
"8": {
"src": "",
"title": "",
"url": {}
},
"9": {
"src": "",
"title": "",
"url": {}
},
"10": {
"src": "",
"title": "",
"url": {}
},
"11": {
"src": "",
"title": "",
"url": {}
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#recommendContent-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("推荐(1T-12F)", "#recommendContent-template", json, function() {
dialog.close();
},index);
$("#recommendContent-bottom").html(common.util.__template2($("#recommendContent-grid").html(), json));
e.init();
}
}
},
... ... @@ -581,22 +781,20 @@ var buttons=[
item.typeName = "big-pic";
return Bll.addView(item);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
createItem:function() {
var json = {
template_name: "trendsetterCollocation",
"template_intro": "潮人搭配",
data: {}
};
return JSON.stringify(json);
}
},
createItem:function() {
var json = {
template_name: "trendsetterCollocation",
"template_intro": "潮人搭配",
data: {}
};
return JSON.stringify(json);
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var dialog = popDialog("潮人搭配", "#noEdit-template", {}, function() {
dialog.close();
},index);
}
}
},
... ... @@ -618,15 +816,13 @@ var buttons=[
data: {}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var dialog = popDialog("潮品话题", "#noEdit-template", {}, function() {
dialog.close();
},index);
}
}
},
... ... @@ -667,10 +863,6 @@ var buttons=[
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
... ... @@ -714,10 +906,6 @@ var buttons=[
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
... ... @@ -751,10 +939,6 @@ var buttons=[
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
... ... @@ -783,15 +967,20 @@ var buttons=[
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#icon-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("添加图标", "#icon-template", json, function() {
dialog.close();
},index);
//$("#recommendContent-bottom").html(common.util.__template2($("#recommendContent-grid").html(), json));
e.init();
}
}
},
... ... @@ -817,10 +1006,6 @@ var buttons=[
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
... ... @@ -894,16 +1079,10 @@ var buttons=[
var json = {
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
}
}
},
{
... ... @@ -914,10 +1093,6 @@ var buttons=[
var tempArr = [];
item.content = tempArr.join("");
return Bll.addView(item);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
createItem:function() {
... ... @@ -937,6 +1112,7 @@ var buttons=[
content:function(item) {
var tempArr = [];
tempArr.push('<div class="recommend-info">');
console.log(item);
var title = item.data.title.title ? item.data.title.title : "添加标题";
tempArr.push('<span class="title" style="min-height:50px; display:block; border-radius:5px; border:1px solid #ccc; margin-top:10px;">'+ title +'</span>');
if (hasCount(item.data.list)) {
... ... @@ -956,26 +1132,128 @@ var buttons=[
},
createItem:function() {
var json = {
template_name: "recommendContentFive",
"template_name": "recommendContentFive",
"template_intro": "带标题的12个小图推荐",
data: {
"data": {
"title": {
"title": "",
"is_show": 1
"is_show": 0
},
"list": {}
"list": {
"0": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"1": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"2": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"3": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"4": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"5": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"6": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"7": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"8": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"9": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"10": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
},
"11": {
"src": "",
"title": "",
"url": {
"action": "",
"url": ""
}
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#recommendContent-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("推荐(1T-12F)", "#recommendContent-template", json, function() {
dialog.close();
},index);
$("#recommendContent-bottom").html(common.util.__template2($("#recommendContent-grid").html(), json));
e.init();
}
}
},
... ... @@ -994,18 +1272,29 @@ var buttons=[
var json = {
template_name: "textNav",
"template_intro": "文本链接",
data: {}
data: {
"0": {
"name": "文本导航",
"url": {
"action": "go.brand",
"url": "http://yohobuy.com/"
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#textNav-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("添加文本导航", "#textNav-template", json, function() {
dialog.close();
},index);
$("#recommendContent-bottom").html(common.util.__template2($("#recommendContent-grid").html(), json));
e.init();
}
}
},
... ... @@ -1132,7 +1421,92 @@ var buttons=[
}
},
"blocks": {},
"list": {},
"list": {
"0": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=18,20"
},
"name": "御寒必备"
},
"1": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=18"
},
"name": "羽绒服"
},
"2": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=20"
},
"name": "棉衣"
},
"3": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=22"
},
"name": "大衣/风衣"
},
"4": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=226"
},
"name": "防风外套"
},
"5": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=257"
},
"name": "毛衣/针织"
},
"6": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=16"
},
"name": "卫衣"
},
"7": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=21 "
},
"name": "夹克"
},
"8": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&misort=12"
},
"name": "衬衫"
},
"9": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&style=991,992"
},
"name": "趣味街头"
},
"10": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1&style=1108,999"
},
"name": "复古学院"
},
"11": {
"url": {
"action": "go.list",
"url": "http://list.yohobuy.com/?gender=2,3&msort=1"
},
"name": "MORE"
}
},
"imgs": {}
}
};
... ... @@ -1184,15 +1558,17 @@ var buttons=[
data: {}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#debrisSlider-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("有序焦点", "#debrisSlider-template", json, function() {
dialog.close();
},index);
e.init();
}
}
},
... ... @@ -1202,7 +1578,7 @@ var buttons=[
template:{
content:function(item) {
var tempArr = [];
if(hasCount(item.data.banner_image)) {
if(hasCount(item.data.banner_image) && item.data.title.name) {
tempArr.push('<div class="user_floor"><p class="title">' + item.data.title.name + '<a class="more" href="#">' + item.data.title.more_name + '</a></p>');
var src = item.data.banner_image[0].src.substring(0, item.data.banner_image[0].src.indexOf("?"));
tempArr.push('<p class="banner-pic"><img src="' + src + '" width="96%"></p></div>');
... ... @@ -1227,25 +1603,36 @@ var buttons=[
},
"active_id": ""
},
"banner_image": {}
"banner_image": {
"0": {
"src": "",
"url": {
"action": "",
"url": ""
},
"title": ""
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#newUserFloor-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("自定义参数列表", "#newUserFloor-template", json, function() {
dialog.close();
},index);
e.init();
}
}
},
{
title:"图片广告",
template_name:"singleNameImage",
template_name:"imageGroup",
template:{
content:function(item) {
var tempArr = [];
... ... @@ -1256,28 +1643,55 @@ var buttons=[
},
createItem:function() {
var json = {
template_name: "singleNameImage",
"template_intro": "带标题的图片广告",
data: {
"title": "",
"src": "",
"url": {
"action": "",
"url": ""
},
"alt": ""
"template_name": "imageGroup",
"template_intro": "广告图片",
"data": {
"title": "海外先锋推荐",
"more": "...",
"more_url": "http://m.yohobuy.com/?sort=all",
"show_num": "2",
"image_style": "T1F2",
"T1F2": true,
"list": {
"0": {
"src": "http://img12.static.yhbimg.com/yhb-img01/2016/01/13/09/02bc18e1068d7661434045b393459ca373.png?imageView/{mode}/w/{width}/h/{height}",
"title": "",
"url": {
"action": "go.globalpurchase",
"url": "http://m.yohobuy.com/?sort=101,102,103,104&title=海外先锋"
}
},
"1": {
"src": "http://img11.static.yhbimg.com/yhb-img01/2016/01/13/09/011ee8706b71c018fb97174b2efe58366a.png?imageView/{mode}/w/{width}/h/{height}",
"title": "",
"url": {
"action": "go.globalpurchase",
"url": "http://m.yohobuy.com/?brand=31&title=GUILD PRIME"
}
},
"2": {
"src": "http://img12.static.yhbimg.com/yhb-img01/2016/01/13/09/02430b46ec036dc2a104ba47f5988aa4f0.png?imageView/{mode}/w/{width}/h/{height}",
"title": "",
"url": {
"action": "go.globalpurchase",
"url": "http://m.yohobuy.com/?brand=2&yh_channel=1&title=BEAMS"
}
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#imageGroup-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("图片广告管理", "#imageGroup-template", json, function() {
dialog.close();
},index);
e.init();
}
}
},
... ... @@ -1300,19 +1714,26 @@ var buttons=[
"title": "",
"more": "",
"more_url": "",
"list": {}
"list": {
"0": {
"title": "",
"params": ""
}
}
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#paramsGroup-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("自定义参数列表", "#paramsGroup-template", json, function() {
dialog.close();
},index);
e.init();
}
}
},
... ... @@ -1348,8 +1769,8 @@ var buttons=[
template:{
content:function(item) {
var tempArr = [];
tempArr.push('');
item.content = tempArr.join("");
tempArr.push('<div class="image-group-box"><img src="/js/source/plugins/announcement/notice.jpg" style="height: 80px;"></div>');
item.content = tempArr.join('');
item.typeName = "custom-group-list";
return Bll.addView(item);
},
... ... @@ -1360,15 +1781,13 @@ var buttons=[
data: {}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
edit:function(index){
var dialog = popDialog("潮人搭配", "#noEdit-template", {}, function() {
dialog.close();
},index);
}
}
},
... ... @@ -1416,12 +1835,11 @@ var buttons=[
},
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#titleImage-baseFrom",{bucket:"yhb-img02"});
var e = new common.edit("#titleImage-baseFrom",{bucket:"yhb-img01"});
json.imgs = [json.data.image];
console.log(json.imgs);
var dialog = popDialog("标题图片发布", "#titleImage-template", json, function() {
if(!($("#titleImage-title").val() && $("#titleImage-more_name").val() && $("#titleImage-action").val() && $("#titleImage-url").val()
&& $("#titleImage-image-src0").val() && $("#titleImage-image-action0").val() && $("#titleImage-image-url0").val())) {
util.__tip("请将数据填写完整", "warning");
if(!e.validate()) {
return;
}
var jsonNew = JSON.parse(resources.contentData[index].contentData);
... ... @@ -1429,13 +1847,12 @@ var buttons=[
jsonNew.data.more_name = $("#titleImage-more_name").val();
jsonNew.data.more_url.action = $("#titleImage-action").val();
jsonNew.data.more_url.url = $("#titleImage-url").val();
jsonNew.data.image.src = $("#titleImage-image-src0").val();
jsonNew.data.image.src = $("#titleImage-image-src0").attr("value");
jsonNew.data.image.url.action = $("#titleImage-image-action0").val();
jsonNew.data.image.url.url = $("#titleImage-image-url0").val();
console.log(jsonNew);
resources.contentData[index].contentData = JSON.stringify(jsonNew);
dialog.close();
});
},index);
$("#titleImage-bottom").html(common.util.__template2($("#grid-template").html(), json));
e.init();
... ... @@ -1449,9 +1866,9 @@ var buttons=[
content:function(item) {
var tempArr = [];
tempArr.push('<div class="editor-info">');
if(item.data.label_list.title) {
if(item.data.label_list[0].title) {
for(var obj in item.data.label_list) {
tempArr.push('<span class="title">' + obj.data.label_list.title + '</span>');
tempArr.push('<span class="title">' + item.data.label_list[obj].title + '</span>');
}
} else {
tempArr.push('<span class="title">标签1</span>');
... ... @@ -1489,32 +1906,62 @@ var buttons=[
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
},
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
var e = new common.edit("#titleImage-baseFrom");
var e = new common.edit("#multiLabelImage-baseFrom",{bucket:"yhb-img01"});
json.imgs = [json.data.image];
json.__index = index;
var dialog = popDialog("多标签图片发布", "#multiLabelImage-template", json, function() {
//if(!($("#titleImage-title").val() && $("#titleImage-more_name").val() && $("#titleImage-action").val() && $("#titleImage-url").val()
// && $("#titleImage-image-src0").val() && $("#titleImage-image-action0").val() && $("#titleImage-image-url0").val())) {
// util.__tip("请将数据填写完整", "warning");
// return;
//}
//var jsonNew = JSON.parse(resources.contentData[index].contentData);
//jsonNew.data.title = $("#titleImage-title").val();
//jsonNew.data.more_name = $("#titleImage-more_name").val();
//jsonNew.data.more_url.action = $("#titleImage-action").val();
//jsonNew.data.more_url.url = $("#titleImage-url").val();
//jsonNew.data.image.src = $("#titleImage-image-src0").val();
//jsonNew.data.image.url.action = $("#titleImage-image-action0").val();
//jsonNew.data.image.url.url = $("#titleImage-image-url0").val();
//console.log(jsonNew);
//resources.contentData[index].contentData = JSON.stringify(jsonNew);
dialog.close();
if(e.validate()) {
dialog.close();
}
},index);
$("#labelsEdit").html(common.util.__template2($("#label-template").html(), json));
$("#multiLabelImage-bottom").html(common.util.__template2($("#grid-template").html(), json));
$("#multiLabelImage-addOne").on("click", function() {
var jsonNew = JSON.parse(resources.contentData[index].contentData);
jsonNew.data.label_list.push({
"title": "",
"url": {
"action": "",
"url": ""
}
});
resources.contentData[index].contentData = JSON.stringify(jsonNew);
jsonNew.__index = index;
jsonNew.imgs = [json.data.image];
$("#labelsEdit").html(common.util.__template2($("#label-template").html(), jsonNew));
$("#multiLabelImage-bottom").html(common.util.__template2($("#grid-template").html(), jsonNew));
e.init();//TODO
});
$(document).off("change",".label-observe");
$(document).on("change", ".label-observe", function() {
var observe = $(this).data("observe");
var index = $(this).data("rows");
var json = JSON.parse(resources.contentData[index].contentData);
if(observe == "title") {
json.data.label_list[$(this).data("index")].title = $(this).val();
} else if(observe == "action") {
json.data.label_list[$(this).data("index")].url.action = $(this).val();
} else if(observe == "url") {
json.data.label_list[$(this).data("index")].url.url = $(this).val();
}
resources.contentData[index].contentData = JSON.stringify(json);
});
$(document).off("change", ".grid-observe");
$(document).on("change",".grid-observe",function() {
var observe = $(this).data("observe");
var index = $(this).data("rows");
var json = JSON.parse(resources.contentData[index].contentData);
if(observe == "src") {
json.data.image.src = $(this).val();
} else if(observe == "action") {
json.data.image.url.action = $(this).val();
} else if(observe == "url") {
json.data.image.url.url = $(this).val();
}
resources.contentData[index].contentData = JSON.stringify(json);
});
$("#titleImage-bottom").html(common.util.__template2($("#grid-template").html(), json));
e.init();
}
... ... @@ -1530,13 +1977,13 @@ var buttons=[
tempArr.push("<div class='row title'>"+ title +"</div>");
tempArr.push("<div class='row'>");
for (var obj in item.data.top_image){
var src = obj.src ? obj.src : "http://b.hiphotos.baidu.com/image/pic/item/9825bc315c6034a857770337ce134954082376ea.jpg";
var src = item.data.top_image[obj].src ? obj.src : "http://b.hiphotos.baidu.com/image/pic/item/9825bc315c6034a857770337ce134954082376ea.jpg";
tempArr.push("<div class='col-sm-6 matchImage'><img src='"+ src +"'></div>");
}
tempArr.push("</div>");
tempArr.push("<div class='row'>");
for(var obj in item.data.list) {
var src = obj.src ? obj.src : "http://b.hiphotos.baidu.com/image/pic/item/9825bc315c6034a857770337ce134954082376ea.jpg";
var src = item.data.list[obj].src ? obj.src : "http://b.hiphotos.baidu.com/image/pic/item/9825bc315c6034a857770337ce134954082376ea.jpg";
tempArr.push("<div class='col-sm-4 matchImage'><img src='"+ src +"'></div>");
}
tempArr.push("</div>");
... ... @@ -1599,35 +2046,78 @@ var buttons=[
}
};
return JSON.stringify(json);
},
dialog:{
id:"#singleImage-template",
title:"添加图片"
}
},
button:{
add:function(index){
$("#index__" + index).html($("#myArea").val());
},
edit:function(index){
var json = JSON.parse(resources.contentData[index].contentData);
popDialog("新增文本", $("#text-template").html(), json, function() {
json.data.text = $("#myArea").val();
var e = new common.edit("#matchImage-baseFrom",{bucket:"yhb-img01"});
json.__index = index;
var dialog = popDialog("搭配(2T-nF)发布", "#matchImage-template", json, function() {
if(e.validate()) {
dialog.close();
}
},index);
$("#matchImage-bottom").html(common.util.__template2($("#matchImage-grid").html(), json));
$("#matchImage-addOne").on("click", function() {
var jsonNew = JSON.parse(resources.contentData[index].contentData);
var length = Object.getOwnPropertyNames(jsonNew.data.list).length;//获得长度
jsonNew.data.list[length] = {
"src": "",
"url": {
"action": "",
"url": ""
}
};
resources.contentData[index].contentData = JSON.stringify(jsonNew);
jsonNew.__index = index;
$("#matchImage-bottom").html(common.util.__template2($("#matchImage-grid").html(), jsonNew));
e.init();
});
$(document).off("change",".label-observe");
$(document).on("change", ".label-observe", function() {
var observe = $(this).data("observe");
var index = $(this).data("rows");
var json = JSON.parse(resources.contentData[index].contentData);
if(observe == "name") {
json.data.title.name = $(this).val();
} else if(observe == "more_name") {
json.data.title.more_name = $(this).val();
} else if(observe == "action") {
json.data.title.more_url.action = $(this).val();
} else if(observe == "url") {
json.data.title.more_url.url = $(this).val();
}
resources.contentData[index].contentData = JSON.stringify(json);
});
$(document).off("change", ".grid-observe");
$(document).on("change",".grid-observe",function() {
var observe = $(this).data("observe");
var index = $(this).data("rows");
var json = JSON.parse(resources.contentData[index].contentData);
if(observe == "top_image-src") {
json.data.top_image[$(this).data("index")].src = $(this).val();
} else if(observe == "top_image-action") {
json.data.top_image[$(this).data("index")].url.action = $(this).val();
} else if(observe == "top_image-url") {
json.data.top_image[$(this).data("index")].url.url = $(this).val();
} else if(observe == "list-src") {
json.data.list[$(this).data("index")].src = $(this).val();
} else if(observe == "list-action") {
json.data.list[$(this).data("index")].url.action = $(this).val();
} else if(observe == "list-url") {
json.data.list[$(this).data("index")].url.url = $(this).val();
}
resources.contentData[index].contentData = JSON.stringify(json);
});
e.init();
}
}
}
];
$(document).on("click",".add_btn",function(){//添加
//var title=$(this).html();
//var index = parseInt($(this).attr("data-index"));
////console.log(title);
//var btn=buttons.filter(function(item){
// return item.title==title;
//});
//btn[0].template.content();
var template_name = $(this).attr("name");
var btn = buttons.filter(function (item) {
return item.template_name == template_name;
... ... @@ -1642,7 +2132,7 @@ $(document).on("click",".add_btn",function(){//添加
});
$(document).on("click", ".edit", function() {//编辑
var template_name = $(this).attr("data-value");
var template_name = $(this).data("value");
var btn=buttons.filter(function(item){
return item.template_name==template_name;
});
... ... @@ -1650,43 +2140,100 @@ $(document).on("click", ".edit", function() {//编辑
btn[0].button.edit(index);
});
//$(document).on("change", ".observe", function () {
// var obj = $(this).data("observe");
//
//});
$(document).on("click", ".del", function () {//删除
var index = $(this).attr("data-index");
$("#index_" + index).remove();
common.dialog.confirm("警告",
common.util.__template2("是否确认删除?", {}),
function() {
if(resources.contentData[index].id) {
common.util.__ajax({
url: "/resource/content/delResContent",
data: {id: resources.contentData[index].id}
}, function (res) {
//resources = res.data;
resources.contentData.splice(index, 1);
initView();
}, true);
} else {
resources.contentData.splice(index, 1);
initView();
}
});
//$("#index_" + index).remove();
});
$(document).on("click", "#sub_btn", function() {
var data = {
"content": {},
"data_id": {},
"rId": ""
};
for(var i = 0; i < resources.contentData.length; i++) {
data.content[i] = resources.contentData[i].contentData;
if(resources.contentData[i].id) {
data.data_id[i] = "id_"+resources.contentData[i].id;
}
}
data.rId = param;
data.content = JSON.stringify(data.content);
data.data_id = JSON.stringify(data.data_id);
console.log(data);
common.util.__ajax({
url: "/resource/content/resContentIndex",
data: {id: param}
url: "/resource/content/addResContent",
data: data
},function(res) {
console.log(res.data);
resources = res.data;
$("#content-list").html(common.util.__template2($("#content-template").html(), res.data));
initView();
for(var i = 0; i < buttons.length; i++) {
var button = buttons[i];
$(".contents").append(function () {
var tempArr = [];
tempArr.push("<li><a href='javascript:void(0)' name='"+ button.template_name +"' class='add_btn' data-index='"+ i +"'>");
tempArr.push(button.title);
tempArr.push("</a></li>");
return tempArr.join("");
});
}
util.__tip("保存成功","success");
},function() {
util.__tip("保存失败");
},true);
});
//for Button ->title
// [[each Button ]]
// <div class="btn">[[item.title]]</div>
// [[/each]]
$(document).on("change", ".recommendContent-observe", function() {
var observe = $(this).data("observe");
var index = $(this).data("rows");
var json = JSON.parse(resources.contentData[index].contentData);
switch (observe) {
case "title":
json.data.title.title = $(this).val();
break;
case "name":
json.data.title.name = $(this).val();
break;
case "more_name":
json.data.title.more_name = $(this).val();
break;
case "action":
json.data.title.more_url.action = $(this).val();
break;
case "url":
json.data.title.more_url.url = $(this).val();
break;
case "big_image-src":
json.data.big_image[$(this).data("index")].src = $(this).val();
break;
case "big_image-action":
json.data.big_image[$(this).data("index")].url.action = $(this).val();
break;
case "big_image-url":
json.data.big_image[$(this).data("index")].url.url = $(this).val();
break;
case "big_image-title":
json.data.big_image[$(this).data("index")].title = $(this).val();
break;
case "list-src":
json.data.list[$(this).data("index")].src = $(this).val();
break;
case "list-action":
json.data.list[$(this).data("index")].url.action = $(this).val();
break;
case "list-url":
json.data.list[$(this).data("index")].url.url = $(this).val();
break;
case "list-title":
json.data.list[$(this).data("index")].title = $(this).val();
break;
}
resources.contentData[index].contentData = JSON.stringify(json);
});
\ No newline at end of file
... ...
... ... @@ -72,5 +72,23 @@ exports.res = [
params: [
{name: "id", type: "number"}
]
},
{
route: "/resource/content/addResContent",
method: "POST",
url: "/resources/addResContent",
params: [
{name: "content", type: "string"},
{name: "data_id", type: "string"},
{name: "rId", type: "number"}
]
},
{
route: "/resource/content/delResContent",
method: "POST",
url: "/resources/delResContent",
params: [
{name: "id", type: "number"}
]
}
];
\ No newline at end of file
... ...
... ... @@ -33,7 +33,7 @@
</ul>
<nav>
<em><i></i></em>
<ul class="contents">
<ul class="contents clearfix">
</ul>
<input type="button" id="sub_btn" name="sub_btn" value="保存" style="float: right; margin:10px;">
... ... @@ -72,36 +72,7 @@
<label class="col-sm-2 control-label">跳转目的</label>
<div class="col-sm-4">
<select id="titleImage-action" name="goTo" class="form-control" value="[[data.more_url.action]]" >
<option value="">选择跳转目标</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
<option value="go.coupon">优惠券页</option>
<option value="go.fav">收藏列表页</option>
<option value="go.mine">我的页面</option>
<option value="go.list">列表或搜索页</option>
<option value="go.attention">关注页</option>
<option value="go.plus">plus</option>
<option value="go.star">star</option>
<option value="go.new">新品到着页</option>
<option value="go.sale">折扣页</option>
<option value="go.h5">h5网页</option>
<option value="go.guangchannel">逛频道</option>
<option value="go.gender">男女首页</option>
<option value="go.activity">app活动页</option>
<option value="go.home">频道首页</option>
<option value="go.yohood">YOHOOD</option>
<option value="go.top100">热销排行</option>
<option value="go.activitytemplate">活动模板</option>
<option value="go.globalpurchase">全球购</option>
<option value="go.subchannel">二级频道</option>
<option value="go.guangchannel">逛频道或SHOW晒单页</option>
<option value="go.showgoods">去晒单</option>
<option value="go.limitpurchase">尖货频道</option>
<option value="go.vippro">会员商品</option>
<option value="go.shortsize">断码页</option>
<option value="go.discountmarket">折扣专区</option>
<option value="go.discountmarketpro">折扣专区详情页</option>
<option value="go.playvideo">视频播放</option>
[[layout action_template]]
</select>
</div>
<label class="col-sm-2 control-label">跳转地址</label>
... ... @@ -118,51 +89,48 @@
<script type="text/template" id="multiLabelImage-template">
<div class="panel-body" id="multiLabelImage-baseFrom">
<div>
<label class="control-label col-sm-2">标签1:</label>
<input class="col-sm-2" type="text" value="[[data.title]]" id="multiLabelImage-title" required="required">
<label class="control-label col-sm-2">跳转目的</label>
<select class="col-sm-2" id="multiLabelImage-action" name="goTo" value="" >
<option value="">选择跳转目标</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
<option value="go.coupon">优惠券页</option>
<option value="go.fav">收藏列表页</option>
<option value="go.mine">我的页面</option>
<option value="go.list">列表或搜索页</option>
<option value="go.attention">关注页</option>
<option value="go.plus">plus</option>
<option value="go.star">star</option>
<option value="go.new">新品到着页</option>
<option value="go.sale">折扣页</option>
<option value="go.h5">h5网页</option>
<option value="go.guangchannel">逛频道</option>
<option value="go.gender">男女首页</option>
<option value="go.activity">app活动页</option>
<option value="go.home">频道首页</option>
<option value="go.yohood">YOHOOD</option>
<option value="go.top100">热销排行</option>
<option value="go.activitytemplate">活动模板</option>
<option value="go.globalpurchase">全球购</option>
<option value="go.subchannel">二级频道</option>
<option value="go.guangchannel">逛频道或SHOW晒单页</option>
<option value="go.showgoods">去晒单</option>
<option value="go.limitpurchase">尖货频道</option>
<option value="go.vippro">会员商品</option>
<option value="go.shortsize">断码页</option>
<option value="go.discountmarket">折扣专区</option>
<option value="go.discountmarketpro">折扣专区详情页</option>
<option value="go.playvideo">视频播放</option>
</select>
<label class="col-sm-2">跳转地址</label>
<input id="multiLabelImage-url" value="" required="required" class="col-sm-2" />
<div id="labelsEdit">
</div>
<a href="JavaScript:;" id="multiLabelImage-addOne" class="btn btn-primary btn-xs">添加一个</a>
<div id="multiLabelImage-bottom">
</div>
</div>
</script>
<script type="text/template" id="matchImage-template">
<div class="panel-body" id="matchImage-baseFrom">
<div class="form-group">
<label class="col-sm-2 control-label">标题:</label>
<div class="col-sm-4">
<input type="text" class="form-control label-observe" value="[[data.title.name]]" id="matchImage-title" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="name">
</div>
<label class="col-sm-2 control-label">更多名称</label>
<div class="col-sm-4">
<input type="text" name="platform_flag" value="[[data.title.more_name]]" id="matchImage-more_name" class="form-control label-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="more_name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">跳转目的</label>
<div class="col-sm-4">
<select id="matchImage-action" name="goTo" class="form-control label-observe" value="[[data.title.more_url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="action" >
[[layout action_template]]
</select>
</div>
<label class="col-sm-2 control-label">跳转地址</label>
<div class="col-sm-4">
<input id="matchImage-url" value="[[data.title.more_url.url]]" class="form-control label-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
<div id="matchImage-bottom">
</div>
<a href="JavaScript:;" id="matchImage-addOne" class="btn btn-primary btn-xs">添加一个</a>
</div>
</script>
<script type="text/template" id="grid-template">
<div id="grid-baseFrom">
[[if imgs]]
... ... @@ -178,44 +146,15 @@
[[each imgs as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" id="titleImage-image-src[[index]]" value="[[item.src]]" data-index="[[index]]" /></td>
<td><input type="file" name="file" id="titleImage-image-src[[index]]" value="[[item.src]]" class="grid-observe" data-rows="[[__index]]" data-index="[[index]]" required="required" data-observe="src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" id="titleImage-image-action[[index]]" class="form-control" value="[[item.url.action]]" data-index="[[index]]" >
<option value="">选择跳转目标</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
<option value="go.coupon">优惠券页</option>
<option value="go.fav">收藏列表页</option>
<option value="go.mine">我的页面</option>
<option value="go.list">列表或搜索页</option>
<option value="go.attention">关注页</option>
<option value="go.plus">plus</option>
<option value="go.star">star</option>
<option value="go.new">新品到着页</option>
<option value="go.sale">折扣页</option>
<option value="go.h5">h5网页</option>
<option value="go.guangchannel">逛频道</option>
<option value="go.gender">男女首页</option>
<option value="go.activity">app活动页</option>
<option value="go.home">频道首页</option>
<option value="go.yohood">YOHOOD</option>
<option value="go.top100">热销排行</option>
<option value="go.activitytemplate">活动模板</option>
<option value="go.globalpurchase">全球购</option>
<option value="go.subchannel">二级频道</option>
<option value="go.guangchannel">逛频道或SHOW晒单页</option>
<option value="go.showgoods">去晒单</option>
<option value="go.limitpurchase">尖货频道</option>
<option value="go.vippro">会员商品</option>
<option value="go.shortsize">断码页</option>
<option value="go.discountmarket">折扣专区</option>
<option value="go.discountmarketpro">折扣专区详情页</option>
<option value="go.playvideo">视频播放</option>
<select name="goTo" id="titleImage-image-action[[index]]" class="form-control grid-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" id="titleImage-image-url[[index]]" class="form-control" required="required" data-index="[[index]]" />
<input value="[[item.url.url]]" id="titleImage-image-url[[index]]" class="form-control grid-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</td>
... ... @@ -225,4 +164,479 @@
</table>
[[/if]]
</div>
</script>
<script type="text/template" id="action_template">
<option value="">选择跳转目标</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
<option value="go.coupon">优惠券页</option>
<option value="go.fav">收藏列表页</option>
<option value="go.mine">我的页面</option>
<option value="go.list">列表或搜索页</option>
<option value="go.attention">关注页</option>
<option value="go.plus">plus</option>
<option value="go.star">star</option>
<option value="go.new">新品到着页</option>
<option value="go.sale">折扣页</option>
<option value="go.share">分享</option>
<option value="go.h5">h5网页</option>
<option value="go.weblogin">h5网页调用本地登录</option>
<option value="go.guangchannel">逛频道</option>
<option value="go.gender">男女首页</option>
<option value="go.activity">app活动页</option>
<option value="go.home">频道首页</option>
<option value="go.yohood">YOHOOD</option>
<option value="go.top100">热销排行</option>
<option value="go.activitytemplate">活动模板</option>
<option value="go.globalpurchase">全球购</option>
<option value="go.subchannel">二级频道</option>
<option value="go.guangchannel">逛频道或SHOW晒单页</option>
<option value="go.showgoods">去晒单</option>
<option value="go.limitpurchase">尖货频道</option>
<option value="go.vippro">会员商品</option>
<option value="go.shortsize">断码页</option>
<option value="go.discountmarket">折扣专区</option>
<option value="go.discountmarketpro">折扣专区详情页</option>
<option value="go.signin">签到页</option>
<option value="go.playvideo">视频播放</option>
</script>
<script type="text/template" id="label-template">
<div class="form-group">
[[each data.label_list as item index]]
<label class="control-label">标签[[index+1]]:</label>
<input type="text" class="label-observe" value="[[item.title]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="title" required="required" style="width: 100px">
<label class="control-label">跳转目的</label>
<select name="goTo" class="label-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="action" value="[[item.url.action]]" style="width: 120px" >
[[layout action_template]]
</select>
<label>跳转地址</label>
<input type="text" class="label-observe" value="[[item.url.url]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" required="required" style="width: 120px" />
[[/each]]
</div>
</script>
<script type="text/template" id="matchImage-grid">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each data.top_image as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="grid-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="top_image-src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control grid-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="top_image-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control grid-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="top_image-url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</td>
</tr>
[[/each]]
[[each data.list as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="grid-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control grid-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control grid-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</script>
<script type="text/template" id="recommendContent-template">
<div class="panel-body" id="recommendContent-baseFrom">
[[if data.title]]
[[if template_name != "recommendContentFive"]]
<div class="form-group">
<label class="col-sm-2 control-label">标题:</label>
<div class="col-sm-4">
<input type="text" class="form-control recommendContent-observe" value="[[data.title.name]]" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="name">
</div>
<label class="col-sm-2 control-label">更多名称</label>
<div class="col-sm-4">
<input type="text" value="[[data.title.more_name]]" class="form-control recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="more_name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">跳转目的</label>
<div class="col-sm-4">
<select name="goTo" class="form-control recommendContent-observe" value="[[data.title.more_url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="action" >
[[layout action_template]]
</select>
</div>
<label class="col-sm-2 control-label">跳转地址</label>
<div class="col-sm-4">
<input value="[[data.title.more_url.url]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
[[/if]]
[[if template_name=="recommendContentFive"]]
<div class="form-group">
<label class="col-sm-2 control-label">标题:</label>
<div class="col-sm-4">
<input type="text" class="form-control recommendContent-observe" value="[[data.title.title]]" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="title">
</div>
<label class="col-sm-4 control-label">是否显示
<input type="checkbox" value="[[data.title.is_show]]" checked="[[data.title.is_show?'checked':'']]" class="recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="more_name">
</label>
</div>
[[/if]]
[[/if]]
<div id="recommendContent-bottom">
</div>
</div>
</script>
<script type="text/template" id="paramsGroup-template">
<div class="panel-body" id="paramsGroup-baseFrom">
<div class="form-group">
<label class="col-sm-2 control-label">标题设置:</label>
<div class="col-sm-4">
<input type="text" class="form-control recommendContent-observe" value="[[data.title]]" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="name">
</div>
<label class="col-sm-2 control-label">更多设置:</label>
<div class="col-sm-4">
<input type="text" value="[[data.more]]" class="form-control recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="more_name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">跳转目的</label>
<div class="col-sm-4">
<select name="goTo" class="form-control recommendContent-observe" value="[[data.more_url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="action" >
[[layout action_template]]
</select>
</div>
<label class="col-sm-2 control-label">跳转地址</label>
<div class="col-sm-4">
<input value="[[data.more_url.url]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
<div id="paramsGroup-bottom">
<ul id="sortable" class="sortable" style="margin:10px;width:100%;">
[[each data.list as item index]]
<li>
<table style="width:100%;z-index:-1;">
<tbody>
<tr>
<td width="100px">标题:<input type="text" style="width: 60px;" name="params_title" value="[[item.title]]"></td>
<td>参数:<input type="text" name="params_value" style="width:300px;" id="params_value" value="[[item.params]]"></td>
<td><button id="deleteElement" class="btn btn-danger btn-sm" type="button">删除</button></td>
</tr>
</tbody>
</table>
<p style="color:#999">如:http://list.yohobuy.com/?gender=1,3&amp;msort=1,3 参数为:gender=1,3&amp;msort=1,3</p>
</li>
[[/each]]
</ul>
<button type="button" class="btn btn-sm" id="addElement">添加一个</button>
</div>
</div>
</script>
<script type="text/template" id="imageGroup-template">
<div class="panel-body" id="imageGroup-baseFrom">
<p>标题设置:<input name="title" type="text" value="[[data.title]]">更多设置:<input type="text" name="moreTitle" style="width:120px;" id="moreTitle" value="[[data.more]]"></p>
<p>
更多链接 : <input value="[[data.more_url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" />
</p>
<p>样式设置:
<select name="image_style" data-element="imageGroup" value="[[data.image_style]]">
<option value="default">默认(一张图片)</option>
<option value="T1F2">T1+F2</option>
<option value="L1R2">L1+R2</option>
<option value="imageList" selected="">图片列表</option>
</select>
每行显示数量:
<select name="show_num" value="[[show_num]]" data-element="imageGroup">
<option value="0">一行显示</option>
<option value="1">一行一个</option>
<option value="2">一行两个</option>
<option value="4">一行四个</option>
<option value="6" selected="">一行六个</option>
</select> <font color="#999">注:只有图片列表是选择才会有效</font></p>
<div id="imageGroup-bottom">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each data.list as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control recommendContent-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[item.url.title]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
</div>
</script>
<script type="text/template" id="newUserFloor-template">
<div class="panel-body" id="newUserFloor-baseFrom">
<div class="new_user_floor">
<p>标题 : <input type="text" name="title" value="[[data.title.name]]"> 更多名称 : <input type="text" name="more_name" value="[[data.title.more_name]]" style="width:50px;"> </p>
<p>
更多链接 : <select name="goTo" class="recommendContent-observe" value="[[data.title.more_url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="action" >
[[layout action_template]]
</select>
<input value="[[data.title.more_url.url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="url" />
</p>
<p>活动 ID <input type="text" name="active_id" value="[[data.title.active_id]]"></p>
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加banner" style="margin:10px;" id="select-banner-pic"></p>
</div>
<div id="newUserFloor-bottom">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each data.banner_image as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control recommendContent-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[item.url.title]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
</div>
</script>
<script type="text/template" id="debrisSlider-template">
<div class="panel-body" id="debrisSlider-baseFrom">
<div class="debris_slider">
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加左图" style="margin:10px;" id="select-left-pic"></p>
<ul class="sortable" style="margin:10px;">
[[each data.left as item index]]
[[layout debrisSlider-grid item]]
[[/each]]
</ul>
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加中间图" style="margin:10px;" id="select-big-pic"></p>
<div class="image-info">
<ul class="sortable" style="width:100%;">
[[each data.big_image as item index]]
[[layout debrisSlider-grid item]]
[[/each]]
</ul>
</div>
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加右图" style="margin:10px;" id="select-right-pic"></p>
<ul class="sortable" style="margin:10px;">
[[each data.right as item index]]
[[layout debrisSlider-grid item]]
[[/each]]
</ul>
</div>
</div>
</script>
<script type="text/template" id="hotCategory-template">
<div class="hotCategory">
<p>
标题 : <input type="text" name="title" value=""> 更多名称 : <input type="text" name="more_name" value="" style="width:50px;"><br>
跳转目的 : <select name="goTo" class="recommendContent-observe" value="[[url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
跳转url : <input value="[[url.url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</p>
<p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加左上图片" style="margin:10px;" id="select-left-small-pic"></p>
<div class="image-info">
<ul id="leftSmallSortable" class="sortable" style="width:100%;">
//TODO
</ul>
</div>
<p>添加左下导航:</p>
[[each data.list as item index]]
<p>
导航名称:<input type="text" name="navName[]" value="">
<select name="goTo" class="recommendContent-observe" value="[[url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
<input value="[[url.url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</p>
[[/each]]
<p>
<input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加右侧图片" style="margin:10px;" id="select-right-small-pic">
</p>
<ul id="rightSmallSortable" class="sortable" style="margin:10px;">
</ul>
</div>
</script>
<script type="text/template" id="textNav-template">
<div class="textNav-baseForm">
[[each data as item index]]
<p>
导航名称:<input type="text" name="navName[]" value="[[item.name]]">
<select name="goTo" class="recommendContent-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
<input value="[[item.url.url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</p>
[[/each]]
</div>
</script>
<script type="text/template" id="icon-template">
<input type="button" value="添加图标" class="btn btn-info btn-xs" style="margin:10px;" id="select-pic">
<ul class="sortable" style="margin:10px; overflow-y:scroll">
<li style="width:100%;z-index:99999;">
<table style="width:100%;z-index:-1;">
<tbody>
<tr>
<td style="width:100px;">
<input type="" class="tImgBox" src="http://img11.static.yhbimg.com/yhb-img01/2016/04/11/11/01eeb83e146b6072acbe457032794c9fb8.jpg?imageView/1/w/80/h/80" style="z-index:-1;">
</td>
<td>
图片链接:<input type="text" name="imgLink[]" value="{}"><input type="button" value="图片连接" class="btn btn-primary btn-xs" style="margin-left:10px;display:inline;" name="linkBtn"> <br>
图片描述:<input type="text" name="imgAlt[]" value=""> <br>
英文描述:<input type="text" name="imgAltEn[]" value="">
</td>
<td>
<input class="btn btn-danger btn-xs del-pic" type="button" value="删除" data-id="0">
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</script>
<script type="text/template" id="recommendContent-grid">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>资源位</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[if data.big_image]]
[[each data.big_image as item index]]
<tr>
<td>[[index]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="big_image-src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control recommendContent-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="big_image-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="big_image-url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</td>
</tr>
[[/each]]
[[/if]]
[[each data.list as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" value="[[item.src]]" class="recommendContent-observe" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-src" /></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="form-control recommendContent-observe" value="[[item.url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[item.url.url]]" class="form-control recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</script>
<script type="text/template" id="noEdit-template">
<div>固定内容,暂时无法编辑!</div>
</script>
<script type="text/template" id="debrisSlider-grid">
<li>
<table style="width:100%;z-index:-1;" id="tableImageBox">
<tbody>
<tr>
<td style="width:100px;"><img class="bImgBox" src="[[src]]"></td>
<td>
<div class="col-sm-12">
<select name="goTo" class="recommendContent-observe" value="[[url.action]]" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-action" >
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<input value="[[url.url]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
<div class="col-sm-12">
<input placeholder="图片描述" value="[[url.title]]" class="recommendContent-observe" required="required" data-rows="[[__index]]" data-index="[[index]]" data-observe="list-url" />
</div>
</td>
<td><input type="button" value="更换图片" class="btn btn-info btn-xs change-big-pic" data-id=""> <input class="btn btn-danger btn-xs del-pic" type="button" value="删除" data-id=""></td>
</tr>
</tbody>
</table>
</li>
</script>
\ No newline at end of file
... ...