activate.page.js
1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var $ = require('yoho-jquery');
var tableTmp = require('hbs/3party/activate-tbl.hbs');
var $startTime = $('.start-time');
var $endTime = $('.end-time');
function time() {
var date = new Date(),
year = date.getFullYear(),
month = (date.getMonth() + 1),
day = date.getDate();
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
return year + '-' + month + '-' + day;
}
function getList(params) {
$.ajax({
url: '/3party/activate-count/getList',
type: 'get',
data: params,
success: function(list) {
$('.table-data').html(tableTmp({list: list}));
}
});
}
$(function() {
var timeData = time();
$startTime.val(timeData);
$endTime.val(timeData);
getList({
startTime: timeData,
endTime: timeData
});
$('.query-btn').on('click', function() {
getList({
startTime: $startTime.val(),
endTime: $endTime.val()
});
});
});