Authored by leo

Update: 新增店铺装修模块化工具

module.exports = function(app) {
app.get("/shop/modular/decorator", "shop.modular.Index");
// 店铺装修工具
app.get("/shop/decorator/modulartool/:shopsId", "shop.modular.Decorator");
//店铺列表
app.post("/shop/ModularDecoratorRest/findShopsDecorator","shopDecoration_findShopsDecorator");
}
... ...
... ... @@ -53,4 +53,4 @@
</div>
</div>
<%include '../../common/views/__ui/footer'%>
\ No newline at end of file
<%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
'use strict';
var $ = require('jquery'),
common=require('../../common/common');
common=require('../../../common/common');
var ENUM = {
decoratorStatus: {0: "待装修", 1: "待审核", 2: "已发布", 3: "驳回"}
... ... @@ -12,7 +12,7 @@ var g;
var t = new common.tab({
el: "#basicTab",
columns: [
{name: "0", display: "有货"},
{name: "all", display: "有货"},
{name: "1", display: "BLK"}
],
click: function() {
... ... @@ -37,7 +37,7 @@ g = new common.grid({
"brandId": common.util.__input("brand-name"),
"openStatus": common.util.__input("open-status"),
"decoratorStatus": common.util.__input("decorator-status"),
"appType": t.active
"appType": +t.active
};
},
columns: [
... ... @@ -57,15 +57,15 @@ g = new common.grid({
}
}},
{display: "发布时间", render: function(item) {
if (item.updateTime && item.updateTime != 0) {
return common.util.__dateFormat(new Date(item.updateTime * 1000), "yyyy-MM-dd hh:mm:ss");
if (item.publishTime && item.publishTime != 0) {
return common.util.__dateFormat(new Date(item.publishTime * 1000), "yyyy-MM-dd hh:mm:ss");
} else {
return '';
}
}},
{display: "状态", render: function(item) {
if (item.status) {
return ENUM.decoratorStatus[item.status];
if (item.decoratorStatus) {
return ENUM.decoratorStatus[item.decoratorStatus];
} else {
return '待装修';
}
... ... @@ -78,17 +78,26 @@ g = new common.grid({
}
}},
{display: "操作", render: function(item) {
var htmlArr = [];
var HtmArr = [];
// 开店、关店
if(+item.shopStatus == 1){
// 1开启 0 关闭
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops btn btn-danger btn-xs">关店</a>');
}else{
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops btn btn-success btn-xs">开店</a>');
HtmArr.push('<div>');
if(+item.decoratorStatus == 2) {
// 店铺装修模板发布之后,才涉及开店、关店
if(+item.shopStatus == 1){
// 1开启 0 关闭
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops btn btn-danger btn-xs">关店</a>');
}else{
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class=" openshops btn btn-success btn-xs">开店</a>');
}
} else {
HtmArr.push('<a href="/shop/decorator/modulartool/' + item.shopsId + '" target="_blank" class="btn btn-primary btn-xs">装修</a>');
}
//
HtmArr.push('</div>');
return HtmArr.join('');
}}
]
})
\ No newline at end of file
});
g.init('/shop/ModularDecoratorRest/findShopsDecorator');
\ No newline at end of file
... ...