cc.Class({ extends: cc.BaseClass, properties: { }, OnShowView:function () { this.$('Label@Label').string = '積分數量:'+Score2Str(parseInt(this.m_Hook.m_SelClubInfo.llScore)); this.$('SendTo/InputBG/EditBox@EditBox').string = ''; this.$('SendScore/InputBG/EditBox@EditBox').string = ''; this.$('Remark/InputBG/EditBox@EditBox').string = ''; }, OnClick_BtSend:function(){ var EdGameID = this.$('SendTo/InputBG/EditBox@EditBox'); var EdScore = this.$('SendScore/InputBG/EditBox@EditBox'); var EdRemark = this.$('Remark/InputBG/EditBox@EditBox'); var GameID = parseInt(EdGameID.string); if( GameID > 0 && GameID < 1000000){ console.log(GameID); } 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) ) }, OnSetLeaderID:function(leaderID){ this.$('SendTo/InputBG/EditBox@EditBox').string = leaderID; }, // update (dt) {}, });