order.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. };
  8. Table.render({
  9. init: Table.init,
  10. toolbar: ['refresh'],
  11. url: 'cms.order/index',
  12. search: false,
  13. cols: [
  14. [
  15. { field: 'id', width: 80, title: 'ID' },
  16. { field: 'trade_sn', width: 240, align: "left", title: '订单ID' },
  17. { field: 'title', width: 120, title: '标题' },
  18. { field: 'catid', width: 80, title: '栏目id' },
  19. { field: 'content_id', width: 80, title: '内容id' },
  20. { field: 'pay_price', width: 100, title: '支付金额', templet: '<div>{{ d.pay_price }} {{# if(d.type==1){ }} 元 {{# } else { }} 点 {{# } }}</div>' },
  21. { field: 'pay_type', width: 100, title: '支付类型' },
  22. { field: 'pay_time', width: 180, title: '支付时间', search: 'range', templet: Table.formatter.datetime },
  23. { field: 'create_time', width: 180, title: '创建时间', search: 'range' },
  24. {
  25. field: 'status',
  26. width: 90,
  27. title: '订单状态',
  28. templet: Table.formatter.label,
  29. selectList: { 'succ': '已完成', 'cancel': '取消', 'unpay': '待支付' },
  30. custom: { 'succ': "green", 'cancel': "orange", 'unpay': "red" }
  31. },
  32. ]
  33. ],
  34. page: {}
  35. });
  36. Table.api.bindevent();
  37. },
  38. };
  39. return Controller;
  40. });