using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class MainPanel : BasePanel
{
    public override void OnHide(object data = null)
    {
        
    }

    public override void OnInit(object data = null)
    {
        GetHomeInfo();
    }

    public override void OnRefresh(object data = null)
    {
        
    }
    private void GetHomeInfo()
    {
        HttpTool.Instance._Get("app/v1/watermelon/info", null, new Action<WatermelonInfoBean>((result) =>
        {
            GetControl<Text>("CashNumTv").text = "¥" + result.available;
            GetControl<Text>("FruitNumTv").text = result.count + "个";
        }), new Action<string, string>((code, msg) =>
        {
            Debug.unityLogger.Log("首页信息 " + code + " msg " + msg);
        }));
    }
}
