Files
fast/public/assets/js/backend/zy/sign/sign_set.js
xiadc 5227396484 feat(sign): 优化签到领券设置功能
- 添加优惠券选择器功能
- 优化签到天数和概率输入范围
- 更新签到状态为禁用/启用选项
- 调整表单布局和样式
- 优化数据表格显示
2025-06-17 11:19:12 +08:00

62 lines
2.8 KiB
JavaScript

define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'zy/sign/sign_set/index' + location.search,
add_url: 'zy/sign/sign_set/add',
edit_url: 'zy/sign/sign_set/edit',
del_url: 'zy/sign/sign_set/del',
multi_url: 'zy/sign/sign_set/multi',
import_url: 'zy/sign/sign_set/import',
table: 'zy_sign_set',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{ checkbox: true },
{ field: 'id', title: __('Id') },
{ field: 'last', title: __('Last') },
{ field: 'chance1', title: __('Chance1') },
{ field: 'coupon1.name', title: __('Coupon1.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
// {field: 'coupon1_id', title: __('Coupon1_id')},
{ field: 'chance2', title: __('Chance2') },
{ field: 'coupon2.name', title: __('Coupon2.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
// {field: 'coupon2_id', title: __('Coupon2_id')},
{ field: 'status', title: __('Status'), formatter: Table.api.formatter.label, searchList: { 0: __('Status0'), 1: __('Status1') } },
{ field: 'create_time', title: __('Create_time'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
{ field: 'update_time', title: __('Update_time'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
// {field: 'coupon.id', title: __('Coupon.id')},
{ field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate }
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});