import common from '../../utils/util';
import server from '../../utils/main';

const app = getApp();

Page({
  data: {
    
  },
  onLoad: function (options) {
    this.setData({
      Containnerheight: common.getSystemHeight(),
      ProgramList: server.getProgramList(),
    });
    this.init();
  },
  gotoFeedback: function () {
    server.gotoFeedback();
  },
  init: function () {
    var that = this;
    wx.showLoading({
      title: '请稍后',
    });
    server.getData('GetUserCouponListByUserID?ProductID='+app.globalData.ProgramID+'&IsShowAll=1&UserID=' + app.globalData.userInfo.UserID, function (data) {
      if (data) {
        that.setData({
          CouponList: data,
        });
      }
      wx.hideLoading();
    });
  },
  onShareAppMessage: function () {
    return {
      title: app.globalData.ShareTitle,
      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
      imageUrl: app.globalData.ShareImage,
    }
  },
})