/// <summary> /// 获取玩家详细记录 /// </summary> /// <param name="req"></param> /// <param name="call"></param> public void SendGetNewPagePlayerDetailRecord(SendGetAgentBRDetail req, CallBack <PlayerRecordDetailNum> call) { NetProcess.SendRequest <SendGetAgentBRDetail>(req, ProtoIdMap.CMD_SendGetPlayerRecordDetail, (msg) => { PlayerRecordDetailBack ack = msg.Read <PlayerRecordDetailBack>(); if (ack.code == 1) { if (ack.data != null) { MainViewModel.Inst.UpdatePlayerRecordDetailList(req.page, ack.data.infoList); } if (call != null) { if (ack.data != null) { call(ack.data.num); } else { call(null); } } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 获取代理接入打赏纪律 /// </summary> /// <param name="req"></param> public void SendGetNewPageAgentBRInfo(SendGetAgentBRDetail req, CallBack <SendGetAgentBRTotal> call) { NetProcess.SendRequest <SendGetAgentBRDetail>(req, ProtoIdMap.CMD_SendGetBRRecord, (msg) => { SendGetAgentBRAck ack = msg.Read <SendGetAgentBRAck>(); if (ack.code == 1) { SendGetAgentBRTotal num = null; if (ack.data != null) { num = ack.data.totalNum; MainViewModel.Inst.UpdateAgentList(req.type, req.page, ack.data.infoList); } if (call != null) { call(num); } } else { GameUtils.ShowErrorTips(ack.code); } }); }
/// <summary> /// 获赏 打赏 打赏 消费记录 /// </summary> public void OnRecordClick() { SendGetAgentBRDetail req = new SendGetAgentBRDetail(); req.num = 10; req.page = 1; req.type = "gh"; Global.Inst.GetController <MainController>().SendGetNewPageAgentBRInfo(req, (num) => { WareHouseRecordDetailWidget view = GetWidget <WareHouseRecordDetailWidget>("Windows/MainView/WareHouseWidget/WareHouseRecordDetailWidget", transform); view.ShowItems(); }); }
/// <summary> /// 查看按钮点击 /// </summary> public void OnLookClick() { MainViewModel.Inst.mCurPlayerDetailList = new List <SendGetAgentBRInfo>(); SendGetAgentBRDetail req = new SendGetAgentBRDetail(); req.num = 10; req.page = 1; req.type = mData.uid; Global.Inst.GetController <MainController>().SendGetNewPagePlayerDetailRecord(req, (num) => { WareHousePlayerDetailWidget view = GetWidget <WareHousePlayerDetailWidget>("Windows/MainView/WareHouseWidget/WareHousePlayerDetailWidget", mRoot); view.SetData(num, mData.uid); }); }
/// <summary> /// toggle点击事件 /// </summary> /// <param name="go"></param> public void OnTogggleClick(GameObject go) { if (UIToggle.current.value) { SendGetAgentBRDetail req = new SendGetAgentBRDetail(); req.num = 10; req.page = 1; req.type = go.name; Global.Inst.GetController <MainController>().SendGetNewPageAgentBRInfo(req, (num) => { ShowItems(num); }); } }
/// <summary> /// 滑动到最底部 /// </summary> private void OnDragDownCall() { UIPanel panel = mSingleScroll.GetComponent<UIPanel>(); SQDebug.Log(panel.transform.localPosition.y - mSingleScroll.GetNextDownPos()); SQDebug.Log(mSingleScroll.GetMaxIndex() >= mAllIndex - 1); if (panel.transform.localPosition.y - mSingleScroll.GetNextDownPos() >= 200 && mSingleScroll.GetMaxIndex() >= mAllIndex - 1) { //请求以前的10条 SQDebug.Log("请求以前的10条"); SendGetAgentBRDetail req = new SendGetAgentBRDetail(); req.num = 10; req.page = MainViewModel.Inst.mCurAgentPage + 1; req.type = "gh"; Global.Inst.GetController<MainController>().SendGetNewPageAgentBRInfo(req, (num) => { mSingleScroll.UpdateAllCount(MainViewModel.Inst.mCurAgentList.Count); }); } }
/// <summary> /// 滑动到最顶部 /// </summary> private void OnDragTopCall() { UIPanel panel = mSingleScroll.GetComponent<UIPanel>(); if (panel.clipOffset.y >= 200) { //请求最新的10条 SQDebug.Log("请求最新的10条"); SendGetAgentBRDetail req = new SendGetAgentBRDetail(); req.num = 10; req.page = 1; req.type = MainViewModel.Inst.mCurAgentType; Global.Inst.GetController<MainController>().SendGetNewPageAgentBRInfo(req, (num) => { ShowItems(); }); } if (panel.baseClipRegion.w < NGUIMath.CalculateRelativeWidgetBounds(mSingleScroll.transform).size.y) { OnDragDownCall(); } }
/// <summary> /// 滑动到最顶部 /// </summary> private void OnDragTopCall() { UIPanel panel = mSingleScroll.GetComponent <UIPanel>(); if (panel.clipOffset.y >= 200) { //请求最新的10条 SQDebug.Log("请求最新的10条"); SendGetAgentBRDetail req = new SendGetAgentBRDetail(); req.num = 10; req.page = 1; req.type = mUserId; Global.Inst.GetController <MainController>().SendGetNewPagePlayerDetailRecord(req, (num) => { SetData(num, mUserId, mIsAgent); }); } if (panel.baseClipRegion.w < NGUIMath.CalculateRelativeWidgetBounds(mSingleScroll.transform).size.y) { OnDragDownCall(); } }