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.

75 lines
2.1 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. list: [
  16. // {
  17. // img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  18. // name: "海鲜焗饭",
  19. // time: "2天12小时25分钟",
  20. // oPrice: "59.00",
  21. // pPrice: "1.00",
  22. // },
  23. // {
  24. // img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
  25. // name: "海鲜焗饭",
  26. // time: "2天12小时25分钟",
  27. // oPrice: "59.00",
  28. // pPrice: "1.00",
  29. // },
  30. // {
  31. // img: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
  32. // name: "海鲜焗饭",
  33. // time: "2天12小时25分钟",
  34. // oPrice: "59.00",
  35. // pPrice: "1.00",
  36. // },
  37. // {
  38. // img: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
  39. // name: "海鲜焗饭",
  40. // time: "2天12小时25分钟",
  41. // oPrice: "59.00",
  42. // pPrice: "1.00",
  43. // },
  44. ]
  45. },
  46. /**
  47. * 组件的方法列表
  48. */
  49. methods: {
  50. },
  51. ready() {
  52. app.couponChannelListCallback = token => {
  53. console.log("couponChannelList init");
  54. Http.setToken(token);
  55. Http.get({
  56. url: config.api.couponChannelList,
  57. data: {
  58. pageNum: 1,
  59. pageSize: 10
  60. }
  61. }).then(res => {
  62. this.setData({
  63. list: res.data.list
  64. })
  65. })
  66. }
  67. if (app.globalData.token && app.globalData.token != null) {
  68. console.log("couponChannelList init 1");
  69. app.couponChannelListCallback(app.globalData.token)
  70. }
  71. }
  72. })