const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
let app = getApp();
Page({
  data: {
    token:'',
    url:''
  },
  bindGetMsg(e){
  },
  onShareAppMessage: function (res) {
    let _this=this;
    return {
      title: '富茂小游戏',
      path: 'pages/index/index',
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
  onShow: function () {
    app.globalData.havePlayEd=true
    let num = wx.getStorageSync('couponNum');
    if (num == 'couponNum') {
      wx.showTabBarRedDot({
        index: 2
      })
    };
  },
  onLoad(options) {
    if (options.share){
      // wx.onShareAppMessage();
    }else{
      this.setData({
        url: options.url + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id,
        // url: "https://game.youlane.cn/guaguale/index.html" + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id,
      });
    }
  }
});