C端小程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

79 linhas
1.1 KiB

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