2026-02-13 14:34:15 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
#include "cocostudio/CocoStudio.h"
|
2026-02-24 21:53:24 +08:00
|
|
|
|
#include "ui/CocosGUI.h"
|
|
|
|
|
|
#include "MD5.h"
|
2026-02-13 14:34:15 +08:00
|
|
|
|
|
|
|
|
|
|
#include "MissionWeiXin.h"
|
|
|
|
|
|
#include "LoginMission.h"
|
|
|
|
|
|
|
|
|
|
|
|
USING_NS_CC;
|
|
|
|
|
|
using namespace cocos2d::ui;
|
|
|
|
|
|
|
|
|
|
|
|
class LogonScene
|
|
|
|
|
|
:public Scene
|
|
|
|
|
|
,public ILoginMissionSink
|
|
|
|
|
|
,public IWeiXinMissionSink
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
LogonScene();
|
|
|
|
|
|
~LogonScene();
|
|
|
|
|
|
public:
|
|
|
|
|
|
CREATE_FUNC(LogonScene);
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
|
|
|
|
|
|
|
|
virtual void onEnterTransitionDidFinish();
|
|
|
|
|
|
|
|
|
|
|
|
virtual void onExit();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
void RegisterAccount();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
virtual void onGPLoginSuccess();
|
|
|
|
|
|
virtual void onGPLoginComplete();
|
|
|
|
|
|
virtual void onGPLoginFailure(unsigned int iErrorCode,const char* szDescription);
|
|
|
|
|
|
virtual void onGPError(int err);
|
|
|
|
|
|
|
|
|
|
|
|
virtual void onWxLoginSuccess(WxUserInfo kWxUserInfo );
|
|
|
|
|
|
virtual void onWxLoginFail(std::string kError);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onWeiXinLogon(Ref*);
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void onKeyReleased(EventKeyboard::KeyCode keyCode, Event * pEvent);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>汾
|
|
|
|
|
|
void checkVersion();
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>汾<EFBFBD><E6B1BE>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|
|
|
|
|
void ResponseResult(rapidjson::Document* pDoc);
|
|
|
|
|
|
|
2026-02-24 21:53:24 +08:00
|
|
|
|
// Username login
|
|
|
|
|
|
void onShowAccountPanel(Ref*);
|
|
|
|
|
|
void onHideAccountPanel(Ref*);
|
|
|
|
|
|
void onUsernameLogon(Ref*);
|
|
|
|
|
|
|
2026-02-13 14:34:15 +08:00
|
|
|
|
private:
|
|
|
|
|
|
LoginMission m_kLoginMission;
|
|
|
|
|
|
std::string m_kPssword;
|
|
|
|
|
|
|
|
|
|
|
|
WxUserInfo m_kWeiXinUserInfo;
|
|
|
|
|
|
|
2026-02-24 21:53:24 +08:00
|
|
|
|
// Account login UI
|
|
|
|
|
|
Node* m_pPanelAccount;
|
|
|
|
|
|
cocos2d::ui::TextField* m_pTxtUsername;
|
|
|
|
|
|
cocos2d::ui::TextField* m_pTxtPassword;
|
|
|
|
|
|
cocos2d::ui::Button* m_pBtnLogin;
|
|
|
|
|
|
cocos2d::ui::Button* m_pBtnClose;
|
2026-02-13 14:34:15 +08:00
|
|
|
|
};
|