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.

115 lines
2.3 KiB

  1. // pages/index/sw/index.js
  2. let Common = require('../../../common/common.js')
  3. let Http = require('../../../utils/http.js')
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. },
  10. /**
  11. * 组件的初始数据
  12. */
  13. data: {
  14. tabs: [
  15. {
  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. {
  43. img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  44. name: "海鲜焗饭",
  45. distance: "12.5km",
  46. address: "西单大悦城2F-012A",
  47. oPrice: "59.00",
  48. pPrice: "1.00",
  49. },
  50. {
  51. img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  52. name: "海鲜焗饭",
  53. distance: "12.5km",
  54. address: "西单大悦城2F-012A",
  55. oPrice: "59.00",
  56. pPrice: "1.00",
  57. },
  58. {
  59. img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  60. name: "海鲜焗饭",
  61. distance: "12.5km",
  62. address: "西单大悦城2F-012A",
  63. oPrice: "59.00",
  64. pPrice: "1.00",
  65. },
  66. {
  67. img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  68. name: "海鲜焗饭",
  69. distance: "12.5km",
  70. address: "西单大悦城2F-012A",
  71. oPrice: "59.00",
  72. pPrice: "1.00",
  73. },
  74. {
  75. img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  76. name: "海鲜焗饭",
  77. distance: "12.5km",
  78. address: "西单大悦城2F-012A",
  79. oPrice: "59.00",
  80. pPrice: "1.00",
  81. },
  82. ],
  83. current: '1',
  84. current_scroll: '1',
  85. },
  86. /**
  87. * 组件的方法列表
  88. */
  89. methods: {
  90. handleChange({ detail }) {
  91. this.setData({
  92. current: detail.key
  93. });
  94. },
  95. handleChangeScroll({ detail }) {
  96. this.setData({
  97. current_scroll: detail.key
  98. });
  99. },
  100. },
  101. ready(){
  102. Common.getCouponList(1, 10)
  103. .then(res=>{
  104. console.log(res)
  105. this.setData({
  106. list: res.data.data.list
  107. })
  108. })
  109. }
  110. })