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.

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