Example #1
0
    /// <summary>
    /// 积分记录功能
    /// </summary>
    private void IntegralRecordTest()
    {
        List <ExchangeRecordEntity> lstIntegralRecordEntity = new List <ExchangeRecordEntity>();
        ExchangeRecordEntity        integralRecordEntity01  = new ExchangeRecordEntity();

        integralRecordEntity01.id       = 0;
        integralRecordEntity01.add_time = "17:24";
        integralRecordEntity01.date     = "2017.12.28";
        integralRecordEntity01.name     = "樱木花道全国大赛限量典藏版";
        integralRecordEntity01.status   = 1;
        ExchangeRecordEntity integralRecordEntity02 = new ExchangeRecordEntity();

        integralRecordEntity02.id       = 1;
        integralRecordEntity02.add_time = "07:24";
        integralRecordEntity02.date     = "2017.08.14";
        integralRecordEntity02.name     = "钢之炼金术师FA限量典藏版";
        integralRecordEntity02.status   = 1;
        lstIntegralRecordEntity.Add(integralRecordEntity01);
        lstIntegralRecordEntity.Add(integralRecordEntity02);

        List <ExchangeRecordEntity> integralRecordEntity = lstIntegralRecordEntity;

        List <TransferData> lstIntegralEntityData = new List <TransferData>();
        TransferData        data = new TransferData();

        for (int i = 0; i < integralRecordEntity.Count; i++)
        {
            TransferData recordData = new TransferData();
            recordData.SetValue("integralRecordEntity", integralRecordEntity[i]);
            lstIntegralEntityData.Add(recordData);
            recordData.SetValue("PrizeType", prizeType);
        }

        data.SetValue("lstRecord", lstIntegralEntityData);

        if (m_UIExchangeRecordWindow)
        {
            m_UIExchangeRecordWindow.SetUI(data);
        }
    }
    /// <summary>
    /// 请求兑换记录相关回调
    /// </summary>
    /// <param name="args"></param>
    private void OnExchangeRecordCallBack(NetWorkHttp.CallBackArgs args)
    {
        if (args.HasError)
        {
            ShowMessage("提示", "网络连接失败");
        }
        else
        {
            if (args.Value.code < 0)
            {
                ShowMessage("提示", args.Value.msg);
                return;
            }
            if (args.Value.data == null || args.Value.data.Count == 0)
            {
                return;
            }

            List <ExchangeRecordEntity> exchangeRecordEntity = LitJson.JsonMapper.ToObject <List <ExchangeRecordEntity> >(args.Value.data.ToJson());

            List <TransferData> lstIntegralEntityData = new List <TransferData>();

            TransferData data = new TransferData();

            for (int i = 0; i < exchangeRecordEntity.Count; i++)
            {
                TransferData recordData = new TransferData();
                recordData.SetValue("ExchangeRecordEntity", exchangeRecordEntity[i]);
                recordData.SetValue("PrizeType", prizeType);
                lstIntegralEntityData.Add(recordData);
            }

            data.SetValue("lstRecord", lstIntegralEntityData);

            if (m_UIExchangeRecordWindow)
            {
                m_UIExchangeRecordWindow.SetUI(data);
            }
        }
    }