box.js 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. define(["jquery", "easy-admin"], function ($, ea) {
  2. var init = {
  3. table_elem: '#currentTable',
  4. table_render_id: 'currentTableRenderId',
  5. index_url: 'box.box/index',
  6. add_url: 'coupon.couponarea/add',
  7. edit_url: 'coupon.couponarea/edit',
  8. delete_url: 'coupon.couponarea/delete',
  9. opentime_url:'coupon.couponarea/addtime',
  10. export_url: 'mall.cate/export',
  11. modify_url: 'coupon.couponarea/modify',
  12. };
  13. var Controller = {
  14. index: function () {
  15. ea.table.render({
  16. init: init,
  17. toolbar:['refresh',
  18. [
  19. // {
  20. // text: '添加',
  21. // url: init.add_url,
  22. // method: 'open',
  23. // auth: 'add',
  24. // class: 'layui-btn layui-btn-normal layui-btn-sm',
  25. // icon: 'fa fa-plus '
  26. // },
  27. // {
  28. // text: '导入',
  29. // url: init.putin_url,
  30. // method: 'import',
  31. // auth: 'putin',
  32. // class: 'layui-btn layui-btn-success layui-btn-sm',
  33. // icon: 'fa fa-plus ',
  34. // }
  35. ]
  36. ],
  37. cols: [[
  38. {type: "checkbox"},
  39. {field: 'id', width: 80, title: 'ID'},
  40. {field: 'buy_most', minWidth: 80, title: '最大购买个数'},
  41. {field: 'once_buy', minWidth: 80, title: '单次购买最大'},
  42. // {field: 'add_scale', minWidth: 80, title: '增长比例',templet: function (d) {
  43. // return '<span class="layui-badge layui-bg-blue">' + d.add_scale+'%</span>';
  44. //
  45. // }},
  46. {field: 'qi_count', minWidth: 50, title: '多少期'},
  47. {field: 'box_img', width: 120, title: '图片封面', templet: function (d) {
  48. return '<span><img src="' + d.box_img + '" style="width: 60px;height: 60px;border-radius: 60px;"></span>';
  49. }},
  50. {field: 'status', title: '状态', width: 85, search: 'select', selectList: {'disable': '删除', 'normal': '正常'}, templet: ea.table.switch},
  51. // {field: 'time_set', title: '时间配置', width: 120, search: 'select', selectList: {0: '不可购买', 1: '可购买'}, templet: ea.table.switch},
  52. {field: 'time_set', minWidth: 300, title: '时间配置'},
  53. {field: 'appoint_day', minWidth: 300, title: '预约日期'},
  54. {field: 'create_time', minWidth: 150, title: '创建时间'}
  55. // {width: 250, title: '操作', templet: ea.table.tool,
  56. // operat: ['edit',
  57. // [{
  58. // text: '配置时间',
  59. // url: init.opentime_url,
  60. // method: 'open',
  61. // auth: 'addtime',
  62. // refresh:false,
  63. // class: 'layui-btn layui-btn-normal layui-btn-xs',
  64. // }]
  65. // ]},
  66. ]],
  67. });
  68. ea.listen();
  69. },
  70. add: function () {
  71. ea.listen();
  72. },
  73. edit: function () {
  74. ea.listen();
  75. },
  76. addtime: function () {
  77. ea.listen();
  78. }
  79. };
  80. return Controller;
  81. });