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

var app = getApp();

Page({
  data: {
    PanelShow: 0,
    ImagePath: app.globalData.uploadImageUrl,
  },
  onLoad: function (options) {
    var that = this;
    that.setData({
      Containnerheight: main.getWindowHeight(),
    });
    that.init();

    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: "#9BD41C",
    });

  },
  init: function () {
    var that = this;
    main.getData("GetClassList?Flag=0", function (data) {
      if (data && data.length>0) {
        that.setData({
          StartDate: common.formatDateCHS(data[0].StartDate),
        })
      }
    });
  },
  gotoPanel2:function(){
      this.setData({
        PanelShow:1,
      })
  },
  copyManager: function () {
    wx.setClipboardData({
      data: "秒过学习法",
      success(res) {
        wx.showModal({
          title: '已复制',
          showCancel: false,
          content: "请在微信添加公众号中长按粘贴。",
          confirmText: "知道了",
        });
      }
    });
  },
  gotoIndex: function () {
    wx.reLaunch({
      url: '../index/index',
    })
  },
  onShareAppMessage: function () {
    return {
      title: app.globalData.ShareTitle,
      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
      imageUrl: app.globalData.ShareImage,
    }
  },
})