var e = getApp();
var regeneratorRuntime = require('../../../../../utils/runtime.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    url: e.globalData.setting.imghost,
    resourceUrl: e.globalData.setting.resourceUrl,
    iurl: e.globalData.setting.imghost,
    allmoney: 0,
    order_sn: "",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.setNavigationBarTitle({
      title: '支付成功',
    });
    var money = parseFloat(options.money).toFixed(2), order_sn = options.order_sn;
    this.setData({allmoney:money,order_sn:order_sn})
    // if (money*1 > 0) {
    //   var encourage = this.selectComponent("#encourage"); //组件的id
    //   if (encourage){
    //     encourage.get_encourage();
    //   }
    // }
  },
  onReady(){
    // console.error(6666);
    if (this.data.allmoney*1 > 0) {
      var encourage = this.selectComponent("#encourage"); //组件的id
      if (encourage){
        encourage.get_encourage();
      }
    }
  },
  goto: function () {
    var url = '/pages/index/index/index';
    getApp().goto(url)
  },
})