Esempio n. 1
0
    /// <summary>
    /// 请求发送获得礼品玩家的相关信息回调
    /// </summary>
    /// <param name="args"></param>
    private void OnRequestSendMessageCallBack(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;

            ExchangeRecordCallBackEntity exchangeRecordCallBackEntity = LitJson.JsonMapper.ToObject <ExchangeRecordCallBackEntity>(args.Value.data.ToJson());;

            string wxCustonmerService = exchangeRecordCallBackEntity.wx_kf;

            TransferData data = new TransferData();

            data.SetValue("wxCustonmerService", wxCustonmerService);

            data.SetValue("id", exchangeRecordCallBackEntity.id);

            if (m_UIExchangeRecordWindow)
            {
                m_UIExchangeRecordWindow.SetExchangeRecord(data);
            }
            UIViewUtil.Instance.LoadWindow("ApplySuccessdMessage").GetComponent <UIApplySuccessdMessageView>().SetUI(data);

            RequestExchangeRecordInfo();
        }
    }
    private void OnRequestGiftReceiveCallBack(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;
            }

            ExchangeRecordCallBackEntity exchangeRecordCallBackEntity = LitJson.JsonMapper.ToObject <ExchangeRecordCallBackEntity>(args.Value.data.ToJson());

            int status = exchangeRecordCallBackEntity.status;

            string address = exchangeRecordCallBackEntity.contact_address;

            string name = exchangeRecordCallBackEntity.contact_name;

            string phone = exchangeRecordCallBackEntity.contact_phone;

            int index = exchangeRecordCallBackEntity.id;

            Action requst = null;

            if (prizeType == PrizeType.LotteryWheel)
            {
                requst = CallRequestExchangeLotteryWheelRecordInfo;
            }
            else
            {
                requst = CallRequestExchangeTreasureRecordInfo;;
            }

            if (status == 1)
            {
                ShowMessage("", "领取成功", MessageViewType.Ok, requst);
                AccountCtrl.Instance.RequestCards();
            }
            else if (status == 2)
            {
                if (!m_UIPlayerReceiveRecordInfoView)
                {
                    m_UIPlayerReceiveRecordInfoView = m_UIExchangeRecordWindow.OpenPrompt(name, phone, address, index, requst, PrizeType.Treasure);
                }
            }
        }
    }