matching_box.js 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. define(["jquery", "easy-admin"], function ($, ea) {
  2. var init = {
  3. table_elem: '#currentTable',
  4. table_render_id: 'currentTableRenderId',
  5. index_url: 'box.MatchingBox/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: 'box_id', minWidth: 80, title: '预约盒子id'},
  41. {field: 'create_time', minWidth: 80, title: '预约时间'},
  42. {field: 'qi_count', minWidth: 80, title: '预约第几期'},
  43. {field: 'lun_count', minWidth: 80, title: '预约第几轮'},
  44. {field: 'num', minWidth: 120, title: '数量'},
  45. {field: 'pay_type', minWidth: 50, title: '支付类型', search: 'select', selectList: {'1': '积分', '2': '余额'}},
  46. {field: 'mobile', minWidth: 180, title: '用户手机号'},
  47. {field: 'total_free', minWidth: 180, title: '总共消费金额'},
  48. {field: 'total_income', minWidth: 180, title: '总共消费金额'},
  49. // {field: 'add_scale', minWidth: 80, title: '增长比例',templet: function (d) {
  50. // return '<span class="layui-badge layui-bg-blue">' + d.add_scale+'%</span>';
  51. //
  52. // }},
  53. {field: 'box_type', minWidth: 50, title: '拆出来的类型', search: 'select', selectList: {'0': '预约成功', '2': '普通', '3':'稀有', '4':'史诗', '5':'传说'}},
  54. {field: 'create_time', minWidth: 200, title: '创建时间'},
  55. {field: 'box_img', width: 120, title: '图片封面', templet: function (d) {
  56. return '<span><img src="' + d.box_img + '" style="width: 60px;height: 60px;border-radius: 60px;"></span>';
  57. }},
  58. {field: 'box_title', minWidth: 50, title: '福袋名字'}
  59. // {width: 250, title: '操作', templet: ea.table.tool,
  60. // operat: ['edit',
  61. // [{
  62. // text: '配置时间',
  63. // url: init.opentime_url,
  64. // method: 'open',
  65. // auth: 'addtime',
  66. // refresh:false,
  67. // class: 'layui-btn layui-btn-normal layui-btn-xs',
  68. // }]
  69. // ]},
  70. ]],
  71. });
  72. ea.listen();
  73. },
  74. add: function () {
  75. ea.listen();
  76. },
  77. edit: function () {
  78. ea.listen();
  79. },
  80. addtime: function () {
  81. ea.listen();
  82. }
  83. };
  84. return Controller;
  85. });