open_box_action.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. define(["jquery", "easy-admin"], function ($, ea) {
  2. var init = {
  3. table_elem: '#currentTable',
  4. table_render_id: 'currentTableRenderId',
  5. index_url: 'box.OpenBoxAction/index',
  6. add_url: 'coupon.couponarea/add',
  7. edit_url: 'coupon.couponarea/edit',
  8. delete_url: 'box.OpenBoxAction/delete',
  9. opentime_url:'coupon.couponarea/addtime',
  10. export_url: 'mall.cate/export',
  11. modify_url: 'coupon.couponarea/modify',
  12. setting_url:'box.OpenBoxAction/setting',
  13. openboxaction_url: 'box.OpenBoxAction/',
  14. beforeopen_url:'box.OpenBoxAction/beforeopen',
  15. beforehandle_url:'box.HandleBoxAction/index',
  16. };
  17. var Controller = {
  18. index: function () {
  19. ea.table.render({
  20. init: init,
  21. toolbar:['refresh','setting',
  22. [
  23. // {
  24. // text: '匹配',
  25. // url: init.beforehandle_url,
  26. // method: 'open',
  27. // auth: 'add',
  28. // class: 'layui-btn layui-btn-normal layui-btn-sm',
  29. // icon: 'fa fa-plus '
  30. // },
  31. // ,
  32. // {
  33. // text: '确认匹配',
  34. // url: init.beforehandle_url,
  35. // method: 'open',
  36. // auth: 'add',
  37. // class: 'layui-btn layui-btn-normal layui-btn-sm',
  38. // icon: 'fa fa-plus '
  39. // }
  40. ]
  41. ],
  42. cols: [[
  43. {type: "checkbox"},
  44. {field: 'id', width: 80, title: 'id'},
  45. {field: 'box_id', minWidth: 80, title: '盒子id'},
  46. // {field: 'create_time', minWidth: 180, title: '预约时间'},
  47. {field: 'qi_count', minWidth: 80, title: '第几期'},
  48. {field: 'lun_count', minWidth: 80, title: '第几轮'},
  49. {field: 'num', minWidth: 80, title: '数量',templet: function (d) {
  50. return '<span class="layui-badge layui-bg-green">' + d.num+'</span>';
  51. }},
  52. {field: 'pay_type', minWidth: 100, title: '支付类型', search: 'select', selectList: {'1': '积分', '2': '余额'}},
  53. {field: 'uid', minWidth: 120, title: '用户uid'},
  54. {field: 'mobile', minWidth: 150, title: '用户手机号'},
  55. // {field: 'total_free', minWidth: 120, title: '总共消费金额'},
  56. // {field: 'total_income', minWidth: 120, title: '总盈利'},
  57. {field: 'yesterday_money', minWidth: 120, title: '昨日盈利',templet: function (d) {
  58. return '<span class="layui-badge layui-bg-red">' + d.yesterday_money+'</span>';
  59. }},
  60. {field: 'total_free', minWidth: 120, title: '总共消费金额'},
  61. {field: 'total_income', minWidth: 120, title: '总盈利'},
  62. {field: 'total_appoint_count', minWidth: 120, title: '总共预约次数'},
  63. {field: 'total_null_box', minWidth: 180, title: '总共空盒个数'},
  64. {field: 'ubox10', minWidth: 80, title: '普通'},
  65. {field: 'ubox20', minWidth: 80, title: '稀有'},
  66. {field: 'ubox30', minWidth: 80, title: '史诗'},
  67. {field: 'ubox40', minWidth: 80, title: '传说'},
  68. {field: 'create_time', minWidth: 200, title: '创建时间'},
  69. {field: 'box10', minWidth: 120, title: '匹配普通'},
  70. {field: 'box20', minWidth: 120, title: '匹配稀有'},
  71. {field: 'box30', minWidth: 120, title: '匹配史诗'},
  72. {field: 'box40', minWidth: 120, title: '匹配传说'},
  73. // {field: 'box_img', width: 120, title: '图片封面', templet: function (d) {
  74. // return '<span><img src="' + d.box_img + '" style="width: 60px;height: 60px;border-radius: 60px;"></span>';
  75. // }},
  76. // {field: 'box_title', minWidth: 50, title: '福袋名字'},
  77. {
  78. width: 120,
  79. title: '操作',
  80. fixed: 'right',
  81. templet: function (d) {
  82. console.log(d);
  83. var button = '';
  84. button += '<button class="layui-btn layui-btn-xs layui-btn-normal" data-open="box.OpenBoxAction/beforeopen?id=' + d.id + '" data-title="提前匹配">提前匹配</button>';
  85. return button;
  86. },
  87. }
  88. ]],
  89. });
  90. ea.listen();
  91. },
  92. add: function () {
  93. ea.listen();
  94. },
  95. edit: function () {
  96. ea.listen();
  97. },
  98. addtime: function () {
  99. ea.listen();
  100. },
  101. beforeopen: function (){
  102. ea.listen();
  103. },
  104. setting: function () {
  105. ea.listen();
  106. }
  107. };
  108. return Controller;
  109. });