...
|
...
|
@@ -6,6 +6,32 @@ const $alert = $('#alert-modal'); |
|
|
const $confirm = $('#confirm-modal');
|
|
|
|
|
|
function bindListPageEvent() {
|
|
|
const $searchKey = $('#search-key');
|
|
|
const $statusSwitch = $('#status-switch');
|
|
|
|
|
|
const searchFn = function() {
|
|
|
let val = $searchKey.val();
|
|
|
let status = $statusSwitch.data('status');
|
|
|
|
|
|
let qs = [];
|
|
|
|
|
|
if (val) {
|
|
|
qs.push(val ? 'query=' + val : '');
|
|
|
}
|
|
|
|
|
|
if (!_.isNaN(+status)) {
|
|
|
qs.push('status=' + status);
|
|
|
}
|
|
|
|
|
|
location.href = `?${qs.join('&')}`;
|
|
|
};
|
|
|
|
|
|
const statusFn = function() {
|
|
|
let $this = $(this);
|
|
|
|
|
|
$statusSwitch.data('status', $this.data('status')).children('.btn-text').text($this.text());
|
|
|
}
|
|
|
|
|
|
const editFn = function() {
|
|
|
window.open('/admin/activity/zerobuy/edit?id=' +
|
|
|
$(this).data('id'), '_blank');
|
...
|
...
|
@@ -52,6 +78,9 @@ function bindListPageEvent() { |
|
|
});
|
|
|
};
|
|
|
|
|
|
$('#search-btn').on('click', searchFn);
|
|
|
$('.status-switch').on('click', statusFn);
|
|
|
|
|
|
$('.btn-edit').on('click', editFn);
|
|
|
$('.btn-switch-open').on('click', switchFn);
|
|
|
$('.btn-switch-close').on('click', switchFn);
|
...
|
...
|
|