Authored by 王钱钧

修改guang bug

... ... @@ -268,6 +268,15 @@ var util = {
}
},
/**
* 比较两个时间戳
*
*/
__compareDate:function(ts1, ts2) {
return (ts1 < ts2);
},
__filterNull: function(obj, prop) {
// 判断item里面 instr属性是不是为空
if (obj[prop]) {
... ...
... ... @@ -112,7 +112,14 @@ var g = new common.grid({
}, {
display: '状态',
render: function (item) {
return "<p>" + ENUM.StatusEnum[item.status] + "</p>";
var sta = ENUM.StatusEnum[item.status];
if(item.status == 1 && common.util.__compareDate(Date.now(), item.publishTime * 1000)) {
//检查是否为定时发布,当未到达所设定时间时,即使status为1,也显示‘未发布’
sta = "未发布";
} else {
}
return "<p>" + sta + "</p>";
}
}, {
display: "创建时间",
... ... @@ -149,7 +156,11 @@ var g = new common.grid({
var HtmArr = [];
if (items.status == 1) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs info-close">关闭</a>');
if(common.util.__compareDate(Date.now(), items.publishTime * 1000)) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-open">发布</a>');
} else {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs info-close">关闭</a>');
}
} else {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-open">发布</a>');
}
... ...