coupon.js 606 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var util = require('../../../utils/util.js');
  2. var api = require('../../../config/api.js');
  3. var app = getApp();
  4. Page({
  5. data: {
  6. couponList: null
  7. },
  8. onLoad: function (options) {
  9. this.loadListData()
  10. },
  11. loadListData: function () {
  12. let that = this;
  13. util.request(api.CouponList).then(function (res) {
  14. if (res.errno === 0) {
  15. that.setData({
  16. couponList: res.data
  17. });
  18. }
  19. });
  20. },
  21. onReady: function () {
  22. },
  23. onShow: function () {
  24. },
  25. onHide: function () {
  26. // 页面隐藏
  27. },
  28. onUnload: function () {
  29. // 页面关闭
  30. }
  31. })