cc.Class({ extends: cc.BaseClass, properties: { }, ctor:function(){ this.m_bNeedUpdate = false; this._page = 1; this._totalPage = 1; this._searchID = 0; }, onLoad:function(){ this.$('BtBack').active = false; }, OnShowSubData:function (type,UserID,GameID, ClubLv, DlgLv) { if(UserID){ this.m_SelClubInfo = this.m_Hook.m_SelClubInfo; this.m_DlgLevel = DlgLv; this.m_dwClubID = this.m_SelClubInfo.dwClubID; this.m_dwLeaderID = UserID; this.m_dwLeaderGameID = GameID; this.m_ClubLv = ClubLv; this.$('EditBox@EditBox').string = ''; this.m_Type = type; } var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData(); //this.$('BtGet').active = ( this.m_dwLeaderID == pGlobalUserData.dwUserID); if(this.m_ListCtrl == null) this.m_ListCtrl = this.$('@CustomListCtrl'); this.m_ListCtrl.InitList(0, 'ClubPartnerPre', this); //自己旗下合伙人 this.$('LeaderID@Label').string = GameID; this.$('BtInvite').active = pGlobalUserData.dwGameID == GameID; this.$('BtSetLeader').active = pGlobalUserData.dwGameID != GameID; if(type == 0){ cc.gPreLoader.LoadRes('Image_ClubPartner_T-xiashuhehuoren','Club',function (spriteFrame) { this.$('BGB/TBillList@Sprite').spriteFrame = spriteFrame; }.bind(this)); this.$('ScrollView/view/content/ClubUserPre/YWinner').active = false; this.$('ScrollView/view/content/ClubUserPre/YScore').active = false; this.$('ScrollView/BGTitle2/t6').active = true; this.$('ScrollView/BGTitle2/t7').active = false; this.$('ScrollView/BGTitle2/t8').active = false; } else{ this.$('ScrollView/view/content/ClubUserPre/Layout').active = false; this.$('ScrollView/view/content/ClubUserPre/YWinner').active = true; this.$('ScrollView/view/content/ClubUserPre/YScore').active = true; this.$('ScrollView/BGTitle2/t6').active = false; this.$('ScrollView/BGTitle2/t7').active = true; this.$('ScrollView/BGTitle2/t8').active = true; cc.gPreLoader.LoadRes('Image_ClubPartner_T-xiashuwanjia','Club',function (spriteFrame) { this.$('BGB/TBillList@Sprite').spriteFrame = spriteFrame; }.bind(this)); } this.ShowPrefabDLG('FilterNode',this.node,function(Js){ this._filter = Js; this._filter.SetMode(FILTER_MENU_PAGE,function(o){ this._page = o.p; this.m_bNeedUpdate = true; }.bind(this),cc.Vec2(450,-330)); }.bind(this)); }, OnShowInfor:function(type,UserID){ var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData(); var webUrl = window.PHP_HOME+'/League.php?GetMark=67&dwUserID='+this.m_dwLeaderID+'&dwClubID='+this.m_dwClubID; webUrl += `&start=${(this._page - 1) * window.PAGE_ITEM_CNT + 1}`; webUrl += `&end=${(this._page) * window.PAGE_ITEM_CNT}`; webUrl += `&searchID=${this._searchID}`; webUrl += `&type=${type}`; WebCenter.GetData(webUrl, 1, function (data) { this.m_ListCtrl.InitList(0, 'ClubPartnerPre', this); var idArr = JSON.parse(data); this._inforArr = []; for(var i = 0; i 0) this._totalPage = Math.ceil(idArr[0][5] / window.PAGE_ITEM_CNT); else this._totalPage = 1; this._filter.SetPageTotalCnt(this._totalPage,this._page); this._inforArr = []; for(var i = 0; i= 0 && Res <= 100){ var webUrl = window.PHP_HOME+'/League.php?GetMark=35&dwUserID='+pGlobalUserData.dwUserID+'&ClubID='+this.m_dwClubID; webUrl += '&LeaderID='+UserID+'&Rate='+Res; WebCenter.GetData(webUrl, null, function (data) { this.ShowAlert(data); WebCenter.SetDataOutTime('GetMark=61'); this.m_bNeedUpdate = true; }.bind(this)); }else{ return this.ShowAlert('請輸入1-100之間的有效數字'); } }.bind(this)); }.bind(this)); }, OnClick_GetScore:function(){ this.m_Hook.OnBtShowDlg(null, 'ClubGetScore'); }, OnClick_ChangeRateList:function(){ cc.gSoundRes.PlaySound('Button'); this.ShowPrefabDLG('ClubRateList',this.node,function(Js){ Js.OnLoadData(this.m_dwLeaderID); }.bind(this)); }, OnClick_ShowUserRevenueList:function () { this.m_Hook.OnShowRevenueList(this.m_dwLeaderID); }, OnShowRevenueList:function (LeaderID) { this.m_Hook.OnShowRevenueList(LeaderID); }, //////////////////////////////////////////////////////////中转 //成员等级调整 OnOpClubUserLv:function (UserID, Lv,Code,CallBack) { this.m_Hook.OnOpClubUserLv(UserID, Lv,Code, CallBack); }, //俱乐部赠送 OnGiveScore:function(UserID, Type, Score) { this.m_Hook.OnGiveScore(UserID, Type, Score); }, //俱乐部下分 OnTakeScore:function(UserID, Type, Score) { this.m_Hook.OnTakeScore(UserID, Type, Score); }, OnBtClickRetaNum:function(Tag, Data){ cc.gSoundRes.PlaySound('Button'); if(Data == 'Reset'){ //重置 this.$('ClubReta/BGM/EditBox@EditBox').string = ''; this.$('ClubReta/BGM/InputNum@Label').string = ''; }else{ if(this.$('ClubReta/BGM/InputNum@Label').string.length >= 3) return //0-9 this.$('ClubReta/BGM/InputNum@Label').string += Data; } //this.$('ClubReta/BGM/EditBox@EditBox').string = this.$('ClubReta/BGM/InputNum@Label').string; }, OnBtClickCloseRetaNode:function(Tag, Data){ cc.gSoundRes.PlaySound('Button'); this.$('ClubReta/BGM/InputNum@Label').string = ''; this.$('ClubReta').active = false; }, OnBtClickRetaSure:function(){ cc.gSoundRes.PlaySound('Button'); var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData(); if(parseInt(this.$('ClubReta/BGM/InputNum@Label').string) >= 0 && parseInt(this.$('ClubReta/BGM/InputNum@Label').string) <= 100){ var webUrl = window.PHP_HOME+'/League.php?GetMark=35&dwUserID='+pGlobalUserData.dwUserID+'&ClubID='+this.m_dwClubID; webUrl += '&LeaderID='+this.m_RetaUserID+'&Rate='+parseInt(this.$('ClubReta/BGM/InputNum@Label').string); WebCenter.GetData(webUrl, null, function (data) { this.ShowAlert(data); WebCenter.SetDataOutTime('GetMark=61'); this.m_bNeedUpdate = true; this.$('ClubReta').active = false; }.bind(this)); }else{ return this.ShowAlert('請輸入1-100之間的有效數字'); } }, update:function(){ if(this.m_bNeedUpdate == false) return; this.m_bNeedUpdate = false; this.OnShowInfor(this.m_Type, this.m_dwLeaderID,this.m_dwLeaderGameID); }, });