...
|
...
|
@@ -55,11 +55,11 @@ var Bll = { |
|
|
button: [{
|
|
|
value: "保存",
|
|
|
callback: function () {
|
|
|
//if (Validate[module.contentData.template_name]) {
|
|
|
// Validate[module.contentData.template_name].forEach(function (item) {
|
|
|
// edit.on("validate", function(){item.fn(module.contentData)})
|
|
|
// })
|
|
|
//}
|
|
|
if (Validate[module.contentData.template_name]) {
|
|
|
Validate[module.contentData.template_name].forEach(function (item) {
|
|
|
edit.on("validate", item.fn(module.contentData))
|
|
|
})
|
|
|
}
|
|
|
if (edit.validate()) {
|
|
|
//TODO
|
|
|
if (resourceObj[module.contentData.template_name]) {
|
...
|
...
|
@@ -372,19 +372,45 @@ $(document).on("click", "#sub_btn", function () { |
|
|
var contentData = Bll.contentDatas[i].contentData;
|
|
|
var action;
|
|
|
var url;
|
|
|
var goodsSrc="imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/90";
|
|
|
addSuffix(contentData);
|
|
|
delete contentData.button_name;
|
|
|
delete contentData.dialog;
|
|
|
//kids推荐品牌
|
|
|
if (contentData.template_name == "kidsBrands") {
|
|
|
action = contentData.data.params.more_url.action || "";
|
|
|
url = contentData.data.params.more_url.url || "";
|
|
|
contentData.data.params.more_url = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}";
|
|
|
}
|
|
|
//标题标签
|
|
|
if (contentData.template_name == "title") {
|
|
|
action = contentData.data.more_link.action || "";
|
|
|
url = contentData.data.more_link.url || "";
|
|
|
contentData.data.more_link = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}";
|
|
|
}
|
|
|
//商品
|
|
|
if (contentData.template_name == "goods") {
|
|
|
for(var j=0;j<contentData.data.length;j++){
|
|
|
if(contentData.data[j].src){
|
|
|
var a=contentData.data[j].src.split("?");
|
|
|
a[1]=goodsSrc;
|
|
|
contentData.data[j].src= a.join("?");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//商品组
|
|
|
if (contentData.template_name == "goodsGroup") {
|
|
|
for(var m=0;m<contentData.data.length;m++){
|
|
|
if(contentData.data[m].list){
|
|
|
for(var n=0;n<contentData.data[m].list.length;n++){
|
|
|
var b=contentData.data[m].list[n].src.split("?");
|
|
|
b[1]=goodsSrc;
|
|
|
contentData.data[m].list[n].src= b.join("?");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
data.content[i] = JSON.stringify(common.util.__ArrayToObj(contentData));
|
|
|
data.content[i] = JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[i].contentData));
|
|
|
if (Bll.contentDatas[i].id) {
|
...
|
...
|
@@ -394,6 +420,7 @@ $(document).on("click", "#sub_btn", function () { |
|
|
data.rId = param;
|
|
|
data.content = JSON.stringify(data.content);
|
|
|
data.data_id = JSON.stringify(data.data_id);
|
|
|
//console.log("最终保存data",data);
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/addResContent",
|
|
|
data: data
|
...
|
...
|
@@ -539,6 +566,7 @@ $(document).on("click", ".goodsSelectBtn", function () { |
|
|
//删除图片按钮
|
|
|
$(document).on("click", ".removepic", function () {
|
|
|
Bll.module.contentData.data.splice($(this).data("index"), 1);
|
|
|
console.log("Bll.module.contentData.data",Bll.module.contentData.data);
|
|
|
$("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
|
|
|
datas: Bll.module.contentData.data
|
|
|
}));
|
...
|
...
|
|