Authored by dongjunjie

店铺装修

... ... @@ -217,24 +217,8 @@ function editorIconEvent(title,id){
}
]
}
if(id == "editor-recommend" && curPlatform == "pc" && jsonMain.resources.recommend_APP.isUsed == "Y"){
option.button.push({
value:"保存并同步至APP",
css:"btn-success",
callback: function(){
if(editorCheck(id)){
freshJson(id, g.__rows, 1);
cloneArr(sortJson(g.__rows,1),jsonMain.resources.recommend_APP.data);
cloneArr(sortJson(g.__rows,1),jsonClone.resources.recommend_APP.data);
removeUrlParam("editor-recommend",jsonMain.resources.recommend_APP.data); //去除url
removeUrlParam("editor-recommend",jsonClone.resources.recommend_APP.data);
common.util.__tip("同步APP成功!","success");
showMain();
}else{
return false;
}
}
});
if(curPlatform == "pc"){
option = setSendToAppBtm(id, option);
}
new common.dialog(option);
gridInit(id);
... ... @@ -490,7 +474,7 @@ function gridInit(id){
return "<input class='form-control inputChange' type=text name='name' value='"+item.name+"' data-index='"+item.__index+"' maxlength='5' />";
}},
{display:"链接", render:function(item){
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+item.url+'" data-index="'+item.__index+'" />';
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+(item.url).replace(/"/g,'\'')+'" data-index="'+item.__index+'" />';
}}
]
});
... ... @@ -597,7 +581,7 @@ function gridInit(id){
return "<input type=file name='recommendImage' id='recommendImage_"+item.__index+"' value='"+item.src+"' />";
}},
{display:"链接", render:function(item){
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+item.url+'" data-index="'+item.__index+'" />';
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+(item.url).replace(/"/g,'\'')+'" data-index="'+item.__index+'" />';
}},
{display:"操作", render:function(item){
var htmlPic = "",i=item.__index;
... ... @@ -645,7 +629,7 @@ function gridInit(id){
return "<input type=file name='signboardImage' id='hotRecommendImage_"+item.__index+"' value='"+item.src+"' />";
}},
{display:"链接", render:function(item){
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+item.url+'" data-index="'+item.__index+'" />';
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+(item.url).replace(/"/g,'\'')+'" data-index="'+item.__index+'" />';
}},
{display:"操作", render:function(item){
var htmlPic = "",i=item.__index;
... ... @@ -725,7 +709,7 @@ function gridInit(id){
if(item.__index == 0){
return "http://店铺商品列表页(默认)";
}else{
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+item.url+'" data-index="'+item.__index+'" />';
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+(item.url).replace(/"/g,'\'')+'" data-index="'+item.__index+'" />';
}
}},
{display:"操作", render:function(item){
... ... @@ -773,7 +757,7 @@ function gridInit(id){
if(item.__index == 0){
return "http://店铺商品列表页(默认)";
}else{
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+item.url+'" data-index="'+item.__index+'" />';
return '<input class="form-control inputChange urlInput" type=text name="url" value="'+(item.url).replace(/"/g,'\'')+'" data-index="'+item.__index+'" />';
}
}},
{display:"操作", render:function(item){
... ... @@ -1053,6 +1037,67 @@ function freshJson(id,data,status){
break;
}
}
//同步至APP按钮生成
function sendToAppBtmInit(id, json){
return {
value:"保存并同步至APP",
css:"btn-success",
callback: function(){
if(editorCheck(id)){
json.isUsed = "N";
freshJson(id, g.__rows, 1);
json.isUsed = "Y";
common.util.__tip("同步APP成功!","success");
showMain();
}else{
return false;
}
}
}
}
//pc端根据模块不同增加同步至APP按钮
function setSendToAppBtm(id, option){
switch (id){
case "editor-banner":
if(jsonMain.resources.shopTopBanner_APP.isUsed == "Y"){
option.button.push(sendToAppBtmInit(id, jsonMain.resources.shopTopBanner_APP));
}
return option;
break;
case "editor-largePic":
if(jsonMain.resources.largeSlideImg_APP.isUsed == "Y"){
option.button.push(sendToAppBtmInit(id, jsonMain.resources.largeSlideImg_APP));
}
return option;
break;
case "editor-smallPic":
if(jsonMain.resources.oneRowTwoColImages_APP.isUsed == "Y"){
option.button.push(sendToAppBtmInit(id, jsonMain.resources.oneRowTwoColImages_APP));
}
return option;
break;
case "editor-recommend":
if(jsonMain.resources.recommend_APP.isUsed == "Y"){
option.button.push(sendToAppBtmInit(id, jsonMain.resources.recommend_APP));
}
return option;
break;
case "editor-hotProduct":
if(jsonMain.resources.hotProducts_APP.isUsed == "Y"){
option.button.push(sendToAppBtmInit(id, jsonMain.resources.hotProducts_APP));
}
return option;
break;
default :
return option;
break;
}
}
//tip生成
function editorTipInit(id){
var tipHtml = "";
... ...