Authored by leo

Update: 店铺装修优化,需求:10864

... ... @@ -115,7 +115,7 @@
<div class="sortList"></div>
<!--品牌集合-->
<div class="model-recommend model-brand model-editor" style="display: none" data-toggle="editor-brand" data-title="品牌集合编辑">
<div class="recommendTitle">品牌集合</div>
<div class="recommendTitle">[[resources.brandBrowse.title]]</div>
<div class="recommendDetail brandDetail">
<ul>
[[each resources.brandBrowse.data as item _index]]
... ...
... ... @@ -50,6 +50,7 @@ var resourcesNew = {
},
"brandBrowse":{
"id":"",
"title":"品牌集合",
"data": []
},
"recommend":{
... ... @@ -119,6 +120,7 @@ var resourcesNew = {
"recommend_APP":{
"id":"",
"isUsed":"N",
"isDisplay":1,
"data": [{"position":1, "name":"默认商品", "enName":"", "src":defaultSrc, "url":""}]
}
} //初始化装修信息json
... ... @@ -188,10 +190,11 @@ function showMain(){
//弹窗编辑主流程
function editorIconEvent(title,id){
$('.editorIcon').on('click',function(){
var content_option = getDialogOption(title);
curDialogId = id;
var option = {
title:title,
content:"<div class='editorTitle'></div><div class='editor-dialog' id='"+ id +"'></div><div class='editorTip'></div> ",
content:content_option + "<div class='editorTitle'></div><div class='editor-dialog' id='"+ id +"'></div><div class='editorTip'></div> ",
width:'70%',
button:[
{
... ... @@ -228,6 +231,32 @@ function editorIconEvent(title,id){
})
}
// "热门品类"编辑页面上,增加 显示/隐藏 选择项
function getDialogOption(title) {
if(title != '热门品类编辑') {
return "";
}
var showInApp = 1;
var data = jsonClone.resources.recommend_APP;
if(data) {
showInApp = data.isDisplay;
}
var showRecommendOption = "";
var hideRecommendOption = "";
if(1 === showInApp) {
showRecommendOption = "<label for='recommandradioY' class='radio-inline'><input type='radio' id='recommandradioY' name='recommandradio' value='1' checked>显示</label>";
hideRecommendOption = "<label for='recommandradioN' class='radio-inline'><input type='radio' id='recommandradioN' name='recommandradio' value='0'>隐藏</label>";
} else {
showRecommendOption = "<label for='recommandradioY' class='radio-inline'><input type='radio' id='recommandradioY' name='recommandradio' value='1'>显示</label>";
hideRecommendOption = "<label for='recommandradioN' class='radio-inline'><input type='radio' id='recommandradioN' name='recommandradio' value='0' checked>隐藏</label>";
}
return "<div><label class='radio-inline'><span>显示/隐藏热门品类: </span></label>" + showRecommendOption + hideRecommendOption;
}
/********************接口Ajax*********************/
//Ajax查询
... ... @@ -559,6 +588,9 @@ function gridInit(id){
}},
]
});
// 品牌一览标题可编辑
$('.editorTitle').html("<div class='form-inline' style='margin-bottom: 10px'><label>标题名称编辑:</label><input class='form-control' type=text name='title' value='"+ jsonMain.resources.brandBrowse.title +"' /></div> ");
g.__rows=""||jsonClone.resources.brandBrowse.data;
g.init(g.__rows);
break;
... ... @@ -938,6 +970,8 @@ function freshJson(id,data,status){
case "editor-brand":
if(status == 1){
var title = $(".editorTitle input[name='title']").val();
jsonMain.resources.brandBrowse.title = jsonClone.resources.brandBrowse.title = title;
cloneArr(sortJson(data,1),jsonMain.resources.brandBrowse.data);
}else if(status == 0){
cloneArr(jsonMain.resources.brandBrowse.data,data);
... ... @@ -960,6 +994,9 @@ function freshJson(id,data,status){
if(curPlatform == "app"){
jsonMain.resources.recommend_APP.isUsed = "Y";
cloneArr(sortJson(data,1),jsonMain.resources.recommend_APP.data);
var value = $("input[type='radio'][name='recommandradio']:checked").val();
jsonMain.resources.recommend_APP.isDisplay = value;
}
}else if(status == 0){
if(curPlatform == "pc"){
... ... @@ -1174,12 +1211,13 @@ function editorCheck(id){
break;
case "editor-recommend":
var title = $(".editorTitle input[name='title']");
if(title.length > 0 && title.val().trim() == ""){
title.focus().addClass("error");
common.util.__tip("模块标题不能为空!");
return false;
}
// 品牌一览标题可为空,如果为空,前后台不展示标题
// var title = $(".editorTitle input[name='title']");
// if(title.length > 0 && title.val().trim() == ""){
// title.focus().addClass("error");
// common.util.__tip("模块标题不能为空!");
// return false;
// }
if(checkNumInput() && checkUrlInput()){
var nameList = $(".grid input[name='name']");
for(var i=0; i<nameList.length; i++){
... ...