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.

69 line
1.4 KiB

  1. let format = require('../../../utils/util.js')
  2. let config = require('../../../config/config.js')
  3. let app = getApp()
  4. const Http = require("../../../utils/HttpBasics")
  5. //1535126400000
  6. Page({
  7. data: {
  8. tabs: [],
  9. list: [],
  10. current: '',
  11. current_scroll: '1'
  12. },
  13. onLoad() {
  14. this.getBusinessList(1)
  15. this.getList(0, 1)
  16. },
  17. getList(key, pageNum) {
  18. var that = this
  19. Http.get({
  20. url: config.api.couponOrderList,
  21. data: {
  22. pageNum: pageNum,
  23. pageSize: 10,
  24. orderStatus: key
  25. }
  26. })
  27. .then(res => {
  28. console.log(res)
  29. res.data.list.map(file => {
  30. file.expiredTime = format.formatTime(file.expiredTime, 'yyyy-MM-dddd hh:mm:ss')
  31. })
  32. that.setData({
  33. list: res.data.list
  34. })
  35. })
  36. },
  37. getBusinessList(pageNum) {
  38. var that = this
  39. Http.get({
  40. url: config.api.businessList,
  41. data: {
  42. pageNum: pageNum,
  43. pageSize: 10,
  44. type: 1
  45. }
  46. })
  47. .then(function(res) {
  48. console.log(res)
  49. that.setData({
  50. list: res.data.list
  51. })
  52. }, function(error) {})
  53. },
  54. handleChange({
  55. detail
  56. }) {
  57. this.setData({
  58. current: detail.key
  59. });
  60. },
  61. handleChangeScroll({
  62. detail
  63. }) {
  64. this.getList(detail.key)
  65. this.setData({
  66. current_scroll: detail.key
  67. });
  68. },
  69. })