Authored by dongjunjie

blk店铺装修校验

... ... @@ -108,7 +108,7 @@
[[/each]]
[[else]]
<li>
<img src="http://img12.static.yhbimg.com/goodsimg/2016/06/21/11/02acebe879c370457fd15b415ad7bf894b.jpg">
<img src="http://img01.yohoboys.com/staticimg/2016/05/19/15/01091c21f2317a64f123f1649fbbccf7ba.png">
<div class="productInfo"><a href="javascript:">商品展示样例</a><b>¥商品价格</b></div>
</li>
[[/if]]
... ... @@ -135,9 +135,9 @@
[[/each]]
[[else]]
<li>
<img src="http://img12.static.yhbimg.com/goodsimg/2016/06/21/11/02acebe879c370457fd15b415ad7bf894b.jpg">
<img src="http://img01.yohoboys.com/staticimg/2016/05/19/15/01091c21f2317a64f123f1649fbbccf7ba.png">
<div class="shadow"></div>
<div class="productInfo"><a href="javascript:">fdasdadadsdadsdawdwa dasada</a><b>¥商品价格</b></div>
<div class="productInfo"><a href="javascript:">商品展示样例</a><b>¥商品价格</b></div>
</li>
[[/if]]
<div class="clearfix"></div>
... ...
... ... @@ -61,6 +61,7 @@ if(!mainData.resources || $.isEmptyObject(mainData.resources)){
}
console.log(mainData);
//弹层编辑主配置
var ENUM = {
shopTopBanner:{
title:"PC顶部banner图片编辑",
... ... @@ -72,22 +73,28 @@ var ENUM = {
title:"APP顶部banner图片编辑",
template:"shopTopBanner_app",
data:"shopTopBanner_app",
tip:""
tip:"请上传像素750*468的图片,上传图片大小不能超过500KB"
},
navigationBar:{
title:"导航栏编辑",
template:"navigationBar",
data:"navigationBar"
data:"navigationBar",
validate: ['url'],
tip:"标题名称最多五个汉字"
},
largeSlideImg:{
title:"资源位大图编辑",
template:"resourceImg",
data:"largeSlideImg"
data:"largeSlideImg",
validate: ['url'],
tip:"请上传像素375*400的图片,上传图片大小不能超过500KB"
},
oneRowTwoColImages:{
title:"资源位小图编辑",
template:"resourceImg",
data:"oneRowTwoColImages"
data:"oneRowTwoColImages",
validate: ['url'],
tip:"请上传像素360*190的图片,上传图片大小不能超过500KB"
},
newProducts:{
title:"新品上架商品编辑",
... ... @@ -141,7 +148,6 @@ var g2 = new common.grid({
{display: "名称", name: "productName"},
{display: "销售价", name: "salesPrice"},
{display: "操作", render: function (item) {
return '<a href="javascript:" class="btn btn-warning btn-xs cancelProduct" data-index="'+item.__index+'">取消选择</a>';
}}
]
... ... @@ -182,14 +188,25 @@ var Bll = {
curSelectedSkn.length = 0;
}},
{value:"确认", css:"btn-info", callback:function(){
//如果是新品上架或者人气单品,需要对已选商品倒序排序
if(ENUM[id].template == "products"){
curDialogData.data = sortArry(curDialogData.data, 1);
var checkResult = true;
if(ENUM[id].validate && ENUM[id].validate.length > 0){
$.each(ENUM[id].validate, function (index, item) {
checkResult = (checkResult && checkFunction[item].call(null));
if(!checkResult) return false;
})
}
if(checkResult){
//如果是新品上架或者人气单品,需要对已选商品倒序排序
if(ENUM[id].template == "products"){
curDialogData.data = sortArry(curDialogData.data, 1);
}
mainData.resources[ENUM[id].data] = curDialogData;
curDialogData = null;
curSelectedSkn.length = 0;
Bll._templateRender();
}else{
return false;
}
mainData.resources[ENUM[id].data] = curDialogData;
curDialogData = null;
curSelectedSkn.length = 0;
Bll._templateRender();
}}
]
};
... ... @@ -233,16 +250,42 @@ var Bll = {
//绑定可编辑动画
_canEditEvent: function () {
if(operation == 1){
$("#main .canEdit").hover(
function () {
$(this).append("<div class='editBorder'></div><a class='editIcon' href='javascript:'>编辑</a>");
},
function () {
$(".editIcon").remove();
$(".editBorder").remove();
$("#main .canEdit").hover(function () {
$(this).append("<div class='editBorder'></div><a class='editIcon' href='javascript:'>编辑</a>");
}, function () {
$(".editIcon").remove();
$(".editBorder").remove();
});
}
}
};
//校验方法
var checkFunction = {
name: function () {
var nameList = $(".editorMain input[name='name']");
for(var i=0; i<nameList.length; i++){
var value = $(nameList[i]).val();
if(value == ""){
common.util.__tip("名称为空!");
return false;
}
}
return true;
},
url: function () {
var urlList = $(".editorMain input[name='url']");
for(var i=0; i<urlList.length; i++){
var reg = new RegExp(".+\.yoho[^.]*\.(com|cn).*","g");
var value = $(urlList[i]).val();
if(value != ""){
if(!reg.test(value)){
common.util.__tip("Url必须包含yohobuy或者yoho,域名格式为com或者cn!");
return false;
}
);
}
}
return true;
}
};
... ... @@ -255,15 +298,18 @@ $(document).on("click", "input[name='Platform']", function(){
curPlatform = $("input[name='Platform']:checked").val();
Bll._templateRender();
});
//编辑触发弹层
$(document).on("click", ".editIcon", function () {
var dialogId = $(this).parent('.canEdit').data("dialogid");
Bll.openDialog(dialogId);
});
//通过skn查询
$(document).on("click", "#filterSkn", function(){
g1.reload();
});
//input监听绑定json
$(document).on("change", ".observe", function () {
var value = $(this).val();
... ... @@ -272,6 +318,7 @@ $(document).on("change", ".observe", function () {
obj[name] = value;
});
});
//全部&已选tab切换
$(document).on("click", ".productsTabs .nav-tabs li", function () {
if($(this).hasClass("active")) return false;
... ... @@ -289,6 +336,7 @@ $(document).on("click", ".productsTabs .nav-tabs li", function () {
g2.init(curDialogData.data);
}
});
//选择商品
$(document).on("click", ".selectProduct", function () {
var index = $(this).data("index");
... ... @@ -307,6 +355,7 @@ $(document).on("click", ".selectProduct", function () {
$('.selectedProductsNum').text(curDialogData.data.length);
$(this).parent().html('<a href="javascript:" class="btn btn-warning btn-xs cancelProduct2" data-index="'+index+'">取消选择</a>');
});
//在已选商品中,取消选择商品
$(document).on("click", ".cancelProduct", function () {
var index = $(this).data("index");
... ... @@ -315,6 +364,7 @@ $(document).on("click", ".cancelProduct", function () {
$('.selectedProductsNum').text(curDialogData.data.length);
g2.init(curDialogData.data);
});
//在全部商品中,取消选择商品
$(document).on("click", ".cancelProduct2", function () {
var index = $(this).data("index");
... ... @@ -322,11 +372,13 @@ $(document).on("click", ".cancelProduct2", function () {
if(item.productSkn == g1.rows[index].productSkn){
[].splice.call(curDialogData.data, _index, 1);
[].splice.call(curSelectedSkn, _index, 1);
return false;
}
});
$('.selectedProductsNum').text(curDialogData.data.length);
$(this).parent().html('<a href="javascript:" class="btn btn-success btn-xs selectProduct" data-index="'+index+'">选择</a>');
});
//暂存 submitStatus=100
$(document).on("click", "#saveDecoration", function () {
console.log(mainData);
... ... @@ -344,6 +396,7 @@ $(document).on("click", "#saveDecoration", function () {
}
});
});
//提交审核 submitStatus=200
$(document).on("click", "#submitDecoration", function () {
common.util.__ajax({
... ... @@ -360,6 +413,7 @@ $(document).on("click", "#submitDecoration", function () {
}, 1000);
},true);
});
//审核通过 blkCheckStatus=300
$(document).on("click", "#checkOk", function () {
common.dialog.confirm(
... ... @@ -382,6 +436,7 @@ $(document).on("click", "#checkOk", function () {
function(){}
);
});
//驳回 blkCheckStatus=900
$(document).on("click","#checkNo",function(){
common.dialog.confirm(
... ...
... ... @@ -60,24 +60,24 @@ var g = new common.grid({
}
}, {
display: "创建时间",
name: "createTime",
render: function(item) {
if (item.createTime) {
return common.util.__dateFormat(new Date(item.createTime * 1000), "yyyy-MM-dd hh:mm:ss");
} else {
return '';
}
}
name: "createTime"
// render: function(item) {
// if (item.createTime) {
// return common.util.__dateFormat(new Date(item.createTime * 1000), "yyyy-MM-dd hh:mm:ss");
// } else {
// return '';
// }
// }
}, {
display: "更新时间",
name: "updateTime",
render: function(item) {
if (item.updateTime) {
return common.util.__dateFormat(new Date(item.updateTime * 1000), "yyyy-MM-dd hh:mm:ss");
} else {
return '';
}
}
name: "updateTime"
// render: function(item) {
// if (item.updateTime) {
// return common.util.__dateFormat(new Date(item.updateTime * 1000), "yyyy-MM-dd hh:mm:ss");
// } else {
// return '';
// }
// }
}, {
display: "YOHO状态",
name: "checkStatus",
... ... @@ -105,7 +105,7 @@ var g = new common.grid({
/**********************yoho店铺***************************/
HtmArr.push("<p>");
HtmArr.push("<div>");
if(+item.checkStatus == 200){
HtmArr.push('<a href="/supplier/store/decorationDetail/'+item.shopsId+'/'+item.shopsType+'/view/'+item.id+'/" class="btn btn-info btn-xs">YOHO装修查看</a>');
... ... @@ -126,32 +126,34 @@ var g = new common.grid({
}
}
HtmArr.push("</p>");
HtmArr.push("</div>");
/**********************blk店铺***************************/
HtmArr.push("<div>");
//if(item.blkProductNum && item.blkProductNum > 0){ //该店铺下有blk商品
HtmArr.push("<div style='margin-top: 10px'>");
if(+item.blkCheckStatus == 200){
HtmArr.push('<a href="/shop/decoration/blkView/'+item.shopsId+'" class="btn btn-info btn-xs">BLK装修查看</a>');
}else {
HtmArr.push('<a href="/shop/decoration/blkEdit/'+item.shopsId+'" class="btn btn-primary btn-xs">BLK装修编辑</a>');
}
if(+item.blkCheckStatus == 200){
HtmArr.push('<a href="/shop/decoration/blkView/'+item.shopsId+'" class="btn btn-info btn-xs">BLK装修查看</a>');
}else {
HtmArr.push('<a href="/shop/decoration/blkEdit/'+item.shopsId+'" class="btn btn-primary btn-xs">BLK装修编辑</a>');
}
if (+item.blkCheckStatus == 900) {
HtmArr.push('<a href="javascript:;" class="btn btn-warning btn-xs commentBtn" data-comment="'+item.blkComment+'">BLK驳回理由</a>');
}
if (+item.blkCheckStatus == 900) {
HtmArr.push('<a href="javascript:;" class="btn btn-warning btn-xs commentBtn" data-comment="'+item.blkComment+'">BLK驳回理由</a>');
}
if(item.blkPassStatus && +item.blkPassStatus == 1){
if(+item.blkShopStatus == 1){
// 1开启 0 关闭
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops_blk btn btn-danger btn-xs">BLK关店</a>');
}else{
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops_blk btn btn-success btn-xs">BLK开店</a>');
if(item.blkPassStatus && +item.blkPassStatus == 1){
if(+item.blkShopStatus == 1){
// 1开启 0 关闭
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops_blk btn btn-danger btn-xs">BLK关店</a>');
}else{
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops_blk btn btn-success btn-xs">BLK开店</a>');
}
}
}
HtmArr.push("</div>");
HtmArr.push("</div>");
//}
return HtmArr.join('');
}
... ...
... ... @@ -247,6 +247,7 @@
background: deepskyblue;
color: #fff;
font-weight: bold;
z-index: 6;
/*opacity: 0.8;*/
}
... ... @@ -257,6 +258,7 @@
top: 0;
left: 0px;
border: 5px solid #7cfc00;
z-index: 5;
}
}
... ...