...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
var $ = require('jquery'), common = require('../../../common/common');
|
|
|
require('../../../common/util/datepicker');
|
|
|
|
|
|
|
|
|
//日期插件
|
|
|
$('.hasDatepicker').fdatepicker({
|
|
|
format: 'yyyy-mm-dd hh:ii:ss',
|
...
|
...
|
@@ -33,7 +34,9 @@ var tableGird = new common.grid({ |
|
|
return items.productSkn;
|
|
|
}},
|
|
|
{ display: "有效期", render: function(items) {
|
|
|
return items.startTime + items.endTime;
|
|
|
return common.util.__secondsFormat(items.startTime)
|
|
|
+ " ~ "
|
|
|
+ common.util.__secondsFormat(items.endTime);
|
|
|
}},
|
|
|
{ display: "折扣", render: function(items) {
|
|
|
return items.discount;
|
...
|
...
|
@@ -42,16 +45,33 @@ var tableGird = new common.grid({ |
|
|
if (items.status != 1) {
|
|
|
return "已终止";
|
|
|
}
|
|
|
|
|
|
return '';
|
|
|
var now = Date.parse(new Date())/1000;
|
|
|
// 未开始
|
|
|
if (items.startTime > now) {
|
|
|
return "未开始";
|
|
|
}
|
|
|
// 进行中
|
|
|
if (items.startTime <= now && items.endTime >= now) {
|
|
|
return "进行中";
|
|
|
}
|
|
|
// 已结束
|
|
|
if (items.endTime < now) {
|
|
|
return "已结束";
|
|
|
}
|
|
|
return "时间设置错误";
|
|
|
}},
|
|
|
{ display: "操作信息", render: function(items) {
|
|
|
return '';
|
|
|
return items.operator + common.util.__secondsFormat(items.updateTime);
|
|
|
}},
|
|
|
{ display: "操作", render: function(items) {
|
|
|
var now = Date.parse(new Date())/1000;
|
|
|
var HtmArr = [];
|
|
|
if (items.status == 1 && items.startTime > now) {
|
|
|
HtmArr.push('<a href="/product/bundle/' + items.id + '" data-id="' + items.id + '" class="btn btn-primary btn-xs">编辑</a>');
|
|
|
HtmArr.push('<a href="javascript:void(0);" data-id="' + items.id + '" class="btn btn-danger btn-xs delete">删除</a>');
|
|
|
}
|
|
|
if (items.status != 1 && items.endTime < now) {
|
|
|
HtmArr.push('<a href="javascript:void(0);" data-id="' + items.id + '" class="btn btn-danger btn-xs delete">终止</a>');
|
|
|
}
|
|
|
return HtmArr.join('');
|
|
|
}
|
|
|
}]
|
...
|
...
|
@@ -94,22 +114,3 @@ $(document).on('click', '.delete', function () { |
|
|
});
|
|
|
});
|
|
|
}); |
|
|
|
|
|
/*
|
|
|
* 复制token点击事件
|
|
|
*/
|
|
|
$(document).on('click', '.info-copy', function () {
|
|
|
common.util.__tip("Token 复制成功", "success")
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 查看token使用方法
|
|
|
*/
|
|
|
$(document).on('click', '#token', function () {
|
|
|
var a = new common.dialog({
|
|
|
title: "<h4>token使用方法</h4>",
|
|
|
width: '50%',
|
|
|
content: '<p>活动开发人员使用Token时,按照对应格式写在页面中,示例代码:</p><p><a class="yoho-coin" ' +
|
|
|
'href="javascript:;" data-token="7173278a4a86">有货币领取按钮</a></p><p><b>注:必须引入 JS 插件</b></p>'
|
|
|
});
|
|
|
}); |
...
|
...
|
|