cc.Class({ extends: cc.BaseClass, properties: { m_NdSubView:cc.Node, }, ctor:function () { this.m_ScoreCnt = 0; this.m_PoolCnt = 0; this.m_Psw = ''; this._page = 1; this._totalPage = 1; this._day = 0;// 0- 今天 1- 昨天 2- 前天 this._searchID = 0; this._type = 0; // 0- 收取, 1 增加 this._tagIndex = 0; }, OnShowView:function () { if(this.m_ListCtrl == null) this.m_ListCtrl = this.$('@CustomListCtrl'); this.m_ListCtrl.InitList(0, 'ClubScoreRecordPre', this); this.m_ListCtrl.InitList(1, 'ClubScoreBankRecord', this); if(this.m_ToggleArr == null){ this.m_ToggleArr = this.node.getComponentsInChildren(cc.Toggle); } this._searchNode = this.$('SearchNode'); this.OnUpdateView(); this.$('SearchNode/BtSearch').active = true; this.$('SearchNode/BtBack').active = false; this.$('SearchNode/IDEditBox@EditBox').string = ''; this.$('ScrollView/ScrollView3/EdOldPsw@EditBox').string = ''; this.$('ScrollView/ScrollView3/EdNewPsw@EditBox').string = ''; this.$('ScrollView/ScrollView3/EdNewPsw1@EditBox').string = ''; this.$('NdSetPsw/EdPsw1@EditBox').string = ''; this.$('Take&Save/EdCnt@EditBox').string = ''; this.ShowPrefabDLG('FilterNode',this.node,function(Js){ this._filter = Js; this._filter.SetMode(this._tagIndex == 1?FILTER_MENU_PAGE:FILTER_MENU_PAGE|FILTER_MENU_DAY|FILTER_MENU_KIND,function(o){ this._day = o.d; this._page = o.p; this._type = o.k; this.m_bNeedUpdate = true; }.bind(this),cc.Vec2(510,-330)); }.bind(this)); }, OnUpdateView:function () { for(var i=0;i0) { this.ShowAlert('確認清楚玩家積分?',Alert_YesNo, function(Res) { if(Res) { this.m_Hook.OnTakeScore(UseID, 1, Score); this.HideView(); } }.bind(this)); }else{ return this.m_Hook.ShowTips('輸入金額錯誤!'); } }, update:function(){ if( this.m_bNeedUpdate ){ this.m_bNeedUpdate = false; }else{ return; } if(!this._filter) return; var RandType = 0; for (var i = 0; i < 5; i++) { if (this.$('Toggle/' + i + '@Toggle').isChecked) RandType = i; } var ShowName = 'ScrollView'+RandType; for(var i = 0;i 0) this._totalPage = Math.ceil(Info[0][2] / window.PAGE_ITEM_CNT); else this._totalPage = 1; this._filter.SetPageTotalCnt(this._totalPage,this._page); if(Info.length > 0)this.m_ListCtrl.InsertListInfoArr(0,Info); }.bind(this)); } //俱乐部银行 if(RandType == 2){ var webUrl = window.PHP_HOME+'/League.php?GetMark=136&dwUserID='+pGlobalUserData.dwUserID; webUrl += '&ClubID='+this.m_Hook.m_SelClubInfo.dwClubID; webUrl += `&start=${(this._page - 1) * window.PAGE_ITEM_CNT + 1}`; webUrl += `&end=${(this._page) * window.PAGE_ITEM_CNT}`; webUrl += `&day=${this._day}`; webUrl += `&searchID=${this._searchID}`; webUrl += `&type=${this._type}`; WebCenter.GetData(webUrl, null, function (data) { var Info = JSON.parse(data); if (Info.length > 0) this._totalPage = Math.ceil(Info[0][9] / window.PAGE_ITEM_CNT); else this._totalPage = 1; this._filter.SetPageTotalCnt(this._totalPage,this._page); //for(var i in Info) this.m_ListCtrl.InsertListInfo(1, Info[i]); if(Info.length > 0)this.m_ListCtrl.InsertListInfoArr(1,Info); }.bind(this)); } }, GetSelUserStr:function(){ if(this.m_EdUserFind && this.m_EdUserFind.node.active){ return this.m_EdUserFind.string; } return ""; }, SetClubList: function(UserMap){ var findStr = this.GetSelUserStr(); var bShowFullID = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER || (this.m_Hook.m_SelClubInfo.dwRules & this.HIDE_ID) == 0 ; for(var Lv = CLUB_LEVEL_OWNER; Lv >= CLUB_LEVEL_MEMBER; Lv--){ for(var i in UserMap){ if(i == 'Revenue' || i == 'ARevenue') continue if(Lv != UserMap[i][1]) continue; var UserID = UserMap[i][0]; if(findStr != '' && g_GlobalUserInfo.m_UserInfoMap[UserID] != null){ var Name = g_GlobalUserInfo.m_UserInfoMap[UserID].NickName; var ID = g_GlobalUserInfo.m_UserInfoMap[UserID].GameID+''; if(Name.indexOf(findStr) < 0 && ID.indexOf(findStr) < 0) continue } this.m_ListCtrl.InsertListInfo(1, [i, UserID, UserMap[i][1], UserMap[i][2], bShowFullID]); } } }, /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //银行功能 OnClick_Save:function(){ this.m_type = 0; this.$('Take&Save').active = true; cc.gPreLoader.LoadRes('Image_ClubScoreRecord_T-chunjifen','Club',function (spriteFrame) { this.$('Take&Save/BGM/TPsw@Sprite').spriteFrame = spriteFrame; }.bind(this)); this.$('Take&Save/ScoreCnt@Label').string = '當前積分:'+this.m_ScoreCnt; this.$('Take&Save/PoolCnt@Label').string = '積分池積分:'+this.m_PoolCnt; this.$('Take&Save/Label@Label').string = '存入:'; this.$('Take&Save/EdCnt/PLACEHOLDER_LABEL@Label').string = '輸入要存入的積分數'; this.$('Take&Save/EdCnt/TEXT_LABEL@Label').string = '輸入要存入的積分數'; }, //取 OnClick_Take:function(){ this.m_type = 1; this.$('Take&Save').active = true; cc.gPreLoader.LoadRes('Image_ClubScoreRecord_T-qujifen','Club',function (spriteFrame) { this.$('Take&Save/BGM/TPsw@Sprite').spriteFrame = spriteFrame; }.bind(this)); this.$('Take&Save/ScoreCnt@Label').string = '當前積分:'+this.m_ScoreCnt; this.$('Take&Save/PoolCnt@Label').string = '積分池:'+this.m_PoolCnt; this.$('Take&Save/Label@Label').string = '取出:'; this.$('Take&Save/EdCnt@EditBox').Placeholder = '輸入要取出的積分數'; this.$('Take&Save/EdCnt/PLACEHOLDER_LABEL@Label').string = '輸入要取出的積分數'; this.$('Take&Save/EdCnt/TEXT_LABEL@Label').string = '輸入要取出的積分數'; }, //首次设置银行密码 OnClick_SetPsw:function(){ var OldPsw = this.$('ScrollView/ScrollView3/EdOldPsw@EditBox').string; var NewPsw1 = this.$('ScrollView/ScrollView3/EdNewPsw@EditBox').string; var NewPsw2 = this.$('ScrollView/ScrollView3/EdNewPsw1@EditBox').string; if(NewPsw1!=NewPsw2) return this.ShowTips('請輸入相同的密碼!') if(NewPsw1.length!=6) return this.ShowTips('請輸入6比特密碼!') var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData(); var webUrl = window.PHP_HOME+'/League.php?GetMark=54&dwUserID='+pGlobalUserData.dwUserID; webUrl += '&LogonPsw='+pGlobalUserData.szPassword; webUrl += '&ClubID='+this.m_Hook.m_SelClubInfo.dwClubID; webUrl += '&NewPsw='+hex_md5(NewPsw1); webUrl += '&OldPsw='+hex_md5(OldPsw); WebCenter.GetData(webUrl, null, function (data) { var Info = JSON.parse(data); this.ShowAlert(Info[1]); if(Info[0]==0){ CLUB_SCORE_LOGON_PSW = NewPsw1; this.OnUpdateView(); } }.bind(this)); }, OnClick_BtSend:function(){ var EdGameID = this.$('ScrollView/ScrollView4/Edit1@EditBox'); var EdScore = this.$('ScrollView/ScrollView4/Edit2@EditBox'); var EdRemark = this.$('ScrollView/ScrollView4/Edit3@EditBox'); var GameID = parseInt(EdGameID.string); if( GameID > 100000 && GameID < 1000000){ } else { return this.ShowTips('請輸入有效ID') }; var SendScore = Number(EdScore.string); if(SendScore > 0) { } else { return this.ShowTips('請輸入有效數量') }; var webUrl = window.PHP_HOME+'/UserFunc.php?GetMark=13&dwGameID='+GameID; WebCenter.GetData(webUrl, null, function (data) { var UserInfo = JSON.parse(data); if(UserInfo.UserID == null){ return this.ShowTips('用戶査詢失敗'); }else{ this.OnSureDo(UserInfo.UserID, SendScore, UserInfo.NickName,EdRemark.string); } }.bind(this)); }, OnSureDo:function(UserID, Score, Nick,Remark){ this.ShowAlert('確定贈送【'+Nick+'】 '+ Score+' 積分?', Alert_YesNo, function(Res) { if(Res) { this.m_Hook.OnGiveScore(UserID, 1, Score,Remark); this.HideView(); } }.bind(this) ) }, //隐藏设置密码界面 OnClick_SetPswHideView:function(){ this.$('Toggle/3@Toggle').check(); }, //隐藏设置密码界面 OnClick_SetTakeAndSaveHideView:function(){ this.$('Take&Save').active = false; }, OnClick_Sure:function(){ this.$('Take&Save').active = false; var Score = Number (this.$('Take&Save/EdCnt@EditBox').string); if(Score <= 0||Score==NaN){ this.ShowTips('請輸入有效數值!'); return; } this.$('Take&Save/EdCnt@EditBox').string = ''; //Score = Score * window.PLATFORM_RATIO; Score = parseFloat((Score*window.PLATFORM_RATIO).toPrecision(12));//window.PLATFORM_RATIO; var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData(); var webUrl = window.PHP_HOME+'/League.php?GetMark='+(this.m_type == 0?52:53)+'&dwUserID='+pGlobalUserData.dwUserID; webUrl += '&Score='+Score; webUrl += '&ClubID='+this.m_Hook.m_SelClubInfo.dwClubID; webUrl += '&Psw='+hex_md5(CLUB_SCORE_LOGON_PSW); WebCenter.GetData(webUrl, null, function (data) { var Info = JSON.parse(data); //this.ShowAlert(Info[1]); this.ShowTips(Info[1]); if(Info[0]==0){ this.OnUpdateView(); this.m_Hook.UpdateScore(this.m_type == 0?-Score:Score); } this.m_Hook.OnClick_BtUpdate(); }.bind(this)); }, /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// OnClick_CloseSearch:function(){ this.$('SearchNode/IDEditBox@EditBox').string = ''; this._searchID = 0; this.$('SearchNode/BtSearch').active = true; this.$('SearchNode/BtBack').active = false; this.OnCheckChange(null, 2); }, OnClick_Search:function(){ var strGameID = this.$('SearchNode/IDEditBox@EditBox').string; if(strGameID.length < 6) { this.ShowTips('ID格式錯誤'); return; } this._searchID = parseInt(strGameID); this._page = 1; this.$('SearchNode/BtSearch').active = false; this.$('SearchNode/BtBack').active = true; this.OnCheckChange(null, 2); }, });