order.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. define(['jquery', 'table'], function($, Table) {
  2. var Controller = {
  3. index: function() {
  4. Table.init = {
  5. table_elem: '#currentTable',
  6. table_render_id: 'currentTable',
  7. delete_url: "cms.order/del",
  8. };
  9. Table.render({
  10. init: Table.init,
  11. toolbar: ['refresh'],
  12. url: 'cms.order/index',
  13. cols: [
  14. [
  15. { field: 'id', width: 80, title: 'ID' },
  16. { field: 'trade_sn', width: 250, align: "left", title: '订单ID' },
  17. { field: 'title', title: '标题' },
  18. { field: 'user_id', width: 80, title: '会员id' },
  19. { field: 'catid', width: 80, title: '栏目id' },
  20. { field: 'contentid', width: 80, title: '内容id' },
  21. { field: 'pay_price', width: 120, title: '支付金额', templet: '<div>{{ d.pay_price }} {{# if(d.type==1){ }} 元 {{# } else { }} 点 {{# } }}</div>' },
  22. { field: 'pay_type', width: 100, title: '支付类型' },
  23. { field: 'pay_time', width: 180, title: '支付时间', search: 'range', templet: Table.formatter.datetime },
  24. { field: 'create_time', width: 180, title: '创建时间', search: 'range' },
  25. {
  26. field: 'status',
  27. width: 90,
  28. title: '订单状态',
  29. templet: Table.formatter.label,
  30. selectList: { 'succ': '已完成', 'cancel': '取消', 'unpay': '待支付' },
  31. custom: { 'succ': "green", 'cancel': "orange", 'unpay': "red" }
  32. },
  33. { width: 60, title: '操作', templet: Table.formatter.tool, operat: ['delete'] }
  34. ]
  35. ],
  36. page: {}
  37. });
  38. Table.api.bindevent();
  39. }
  40. };
  41. return Controller;
  42. });