C端小程序
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
2.3 KiB

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