Authored by 马力

Merge branch 'dev_优惠券优化'

... ... @@ -92,13 +92,13 @@ var t = new common.tab2({
activeTab = t.options.active;
g.options.columns[12].hidden = true;
g.options.columns[9].hidden = true;
g.options.columns[9].hidden = false; // 搜索与便签每个标签都显示
if (columnname == 3) {
isInfoMiss = 'Y';
g.options.columns[12].hidden = false;
} else {
isInfoMiss = '';
g.options.columns[9].hidden = false;
//g.options.columns[9].hidden = false; //
}
if (columnname == 1 || columnname == 2 || columnname == 3 || columnname == 4) {
... ... @@ -322,7 +322,7 @@ var g = new common.grid({
}
}, {
display: '搜索/标签',
hidden: true,
hidden: false,
render: function (item) {
var searchAndLabel = item.searchAndLabel ? item.searchAndLabel : '',
style = item.style ? item.style : '',
... ...
... ... @@ -22,7 +22,9 @@ var g = new common.grid({
{display:"单券号",name:"couponCode"},
{display:"订单号",name:"orderCode"},
{display:"优惠券名称",name:"couponName"},
{display:"有效期",name:"endTimeStr"},
{display:"有效期", render: function(item) {
return '<p>' + date_fuction(item.startTime) + '--' + item.endTimeStr + '</p>';
}},
{display:"状态",render: function(item) {
var status = "";
if(item.status == 0) {
... ... @@ -118,3 +120,20 @@ $(document).on("click", ".cancelCoupon", function() {
$(document).on("keyup", ".number", function () {
$(this).val($(this).val().replace(/\D/g, ''));
});
function date_fuction(shijianchuo)
{
//shijianchuo是整数,否则要parseInt转换
var time = new Date(shijianchuo * 1000);
var y = time.getFullYear();
var m = time.getMonth()+1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var s = time.getSeconds();
return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
}
function add0(m){return m<10?'0'+m:m }
\ No newline at end of file
... ...