...
|
...
|
@@ -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 |
...
|
...
|
|