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

const app = getApp();

Page({
  data: {
    List:[],
  },
  onLoad: function (options) {
    this.setData({
      Containnerheight: common.getSystemHeight(),
    });
    this.init();
  },
  init:function(){
    var that = this;

    server.getData('GetGiftListByUserID500?UserID=' + app.globalData.userInfo.UserID + "&ProductID=" + app.globalData.ProgramID, function (data) {
      if (data) {
        that.setData({
          List: data,
        });
      }
    });
  },
  goto: function (e) {
    var id=e.currentTarget.dataset.id;
    wx.navigateTo({
      url: "./giftinfo?id="+id,
    });
  },
  gotoGiftList: function () {
    wx.navigateTo({
      url: "./list?IsGift=1",
    });
  },
  onShareAppMessage: function () {
    return {
      title: app.globalData.ShareTitle,
      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
      imageUrl: app.globalData.ShareImage,
    }
  },
})