| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- define(["jquery", "easy-admin"], function ($, ea) {
- var init = {
- table_elem: '#currentTable',
- table_render_id: 'currentTableRenderId',
- index_url: 'box.box/index',
- add_url: 'coupon.couponarea/add',
- edit_url: 'coupon.couponarea/edit',
- delete_url: 'coupon.couponarea/delete',
- opentime_url:'coupon.couponarea/addtime',
- export_url: 'mall.cate/export',
- modify_url: 'coupon.couponarea/modify',
- };
- var Controller = {
- index: function () {
- ea.table.render({
- init: init,
- toolbar:['refresh',
- [
- // {
- // text: '添加',
- // url: init.add_url,
- // method: 'open',
- // auth: 'add',
- // class: 'layui-btn layui-btn-normal layui-btn-sm',
- // icon: 'fa fa-plus '
- // },
- // {
- // text: '导入',
- // url: init.putin_url,
- // method: 'import',
- // auth: 'putin',
- // class: 'layui-btn layui-btn-success layui-btn-sm',
- // icon: 'fa fa-plus ',
- // }
- ]
- ],
- cols: [[
- {type: "checkbox"},
- {field: 'id', width: 80, title: 'ID'},
- {field: 'buy_most', minWidth: 80, title: '最大购买个数'},
- {field: 'once_buy', minWidth: 80, title: '单次购买最大'},
- // {field: 'add_scale', minWidth: 80, title: '增长比例',templet: function (d) {
- // return '<span class="layui-badge layui-bg-blue">' + d.add_scale+'%</span>';
- //
- // }},
- {field: 'qi_count', minWidth: 50, title: '多少期'},
- {field: 'box_img', width: 120, title: '图片封面', templet: function (d) {
- return '<span><img src="' + d.box_img + '" style="width: 60px;height: 60px;border-radius: 60px;"></span>';
- }},
- {field: 'status', title: '状态', width: 85, search: 'select', selectList: {'disable': '删除', 'normal': '正常'}, templet: ea.table.switch},
- // {field: 'time_set', title: '时间配置', width: 120, search: 'select', selectList: {0: '不可购买', 1: '可购买'}, templet: ea.table.switch},
- {field: 'time_set', minWidth: 300, title: '时间配置'},
- {field: 'appoint_day', minWidth: 300, title: '预约日期'},
- {field: 'create_time', minWidth: 150, title: '创建时间'}
- // {width: 250, title: '操作', templet: ea.table.tool,
- // operat: ['edit',
- // [{
- // text: '配置时间',
- // url: init.opentime_url,
- // method: 'open',
- // auth: 'addtime',
- // refresh:false,
- // class: 'layui-btn layui-btn-normal layui-btn-xs',
- // }]
- // ]},
- ]],
- });
- ea.listen();
- },
- add: function () {
- ea.listen();
- },
- edit: function () {
- ea.listen();
- },
- addtime: function () {
- ea.listen();
- }
- };
- return Controller;
- });
|