C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 rivejä
1.1 KiB

  1. let Http = require('../../../utils/http.js')
  2. let format = require('../../../utils/util.js')
  3. let app = getApp()
  4. //1535126400000
  5. Page({
  6. data: {
  7. tabs: [{
  8. key: 0,
  9. name: "未使用"
  10. },
  11. {
  12. key: 1,
  13. name: "已使用"
  14. },
  15. {
  16. key: 2,
  17. name: "已过期"
  18. },
  19. {
  20. key: 3,
  21. name: "已退款"
  22. }
  23. ],
  24. list: [],
  25. current: '',
  26. current_scroll: '1'
  27. },
  28. onLoad() {
  29. this.getList(0)
  30. },
  31. getList(key) {
  32. Http.getResquest('/api/couponOrder/list', app.globalData.token, '加载中', {
  33. pageNum: 1,
  34. pageSize: 10,
  35. orderStatus: key
  36. }, (res) => {
  37. res.data.list.map(file => {
  38. file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss')
  39. })
  40. this.setData({
  41. list: res.data.list
  42. })
  43. console.log(res)
  44. })
  45. },
  46. handleChange({
  47. detail
  48. }) {
  49. this.setData({
  50. current: detail.key
  51. });
  52. },
  53. handleChangeScroll({
  54. detail
  55. }) {
  56. this.getList(detail.key)
  57. this.setData({
  58. current_scroll: detail.key
  59. });
  60. },
  61. })