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.

84 lines
1.3 KiB

  1. // pages/index/sw/index.js
  2. let config = require('../../../config/config.js')
  3. let Http = require('../../../utils/HttpBasics')
  4. const app = getApp()
  5. Component({
  6. /**
  7. * 组件的属性列表
  8. */
  9. properties: {
  10. },
  11. /**
  12. * 组件的初始数据
  13. */
  14. data: {
  15. tabs: [{
  16. key: 1,
  17. name: "全部"
  18. },
  19. {
  20. key: 2,
  21. name: "餐饮"
  22. },
  23. {
  24. key: 3,
  25. name: "娱乐"
  26. }, {
  27. key: 4,
  28. name: "服饰"
  29. }, {
  30. key: 5,
  31. name: "超市"
  32. },
  33. {
  34. key: 6,
  35. name: "亲子"
  36. }, {
  37. key: 7,
  38. name: "其他"
  39. },
  40. ],
  41. list: [],
  42. current: '1',
  43. current_scroll: '1',
  44. },
  45. /**
  46. * 组件的方法列表
  47. */
  48. methods: {
  49. handleChange({
  50. detail
  51. }) {
  52. this.setData({
  53. current: detail.key
  54. });
  55. },
  56. handleChangeScroll({
  57. detail
  58. }) {
  59. this.setData({
  60. current_scroll: detail.key
  61. });
  62. },
  63. },
  64. ready() {
  65. app.couponListCallback = token => {
  66. Http.get({
  67. url: Http.config.api.couponList,
  68. data: {
  69. pageNum: 1,
  70. pageSize: 10
  71. }
  72. }).then(res => {
  73. console.log(res);
  74. this.setData({
  75. list: res.data.list
  76. })
  77. })
  78. }
  79. }
  80. })