1
0

couponTickInfo.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. var util = require('../../../utils/util.js');
  2. var api = require('../../../config/api.js');
  3. var app = getApp();
  4. Page({
  5. data: {
  6. couponId: '',
  7. discId: '',
  8. storeId: '',
  9. storeTopicId: '',
  10. tickDiscount: {}
  11. },
  12. onLoad: function (options) {
  13. // 页面初始化 options为页面跳转所带来的参数
  14. // console.log('discId' + options.discId)
  15. // console.log('couponId' + options.couponId)
  16. if (options.couponId) {
  17. this.setData({
  18. couponId: options.couponId
  19. });
  20. }
  21. if (options.discId) {
  22. this.setData({
  23. discId: options.discId
  24. });
  25. }
  26. this.setData({
  27. storeId: options.storeId
  28. });
  29. this.getTickDiscountDetail();
  30. },
  31. onReady: function () { },
  32. onShow: function () { },
  33. onHide: function () {
  34. // 页面隐藏
  35. },
  36. onUnload: function () {
  37. // 页面关闭
  38. },
  39. getTickDiscountDetail() {
  40. var that = this;
  41. util.request(api.DiscountDetail, {
  42. couponId: that.data.couponId,
  43. storeId: that.data.storeId,
  44. discId: that.data.discId
  45. })
  46. .then(function (res) {
  47. if (res.errno === 0) {
  48. console.log(res.data);
  49. if (res.data) {
  50. that.setData({
  51. tickDiscount: res.data
  52. });
  53. }
  54. }
  55. });
  56. }
  57. })