/** * 微信登录返回结果 */ public void weixinLoginCallBack(string msg) { Dictionary <string, string> dicMsg = UnityIOSAndroid.parseMsg(msg); Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("type", 3); dic.Add("key", dicMsg["openID"]); dic.Add("from", "jjjj"); dic.Add("unique_id", "UniqueId"); dic.Add("channel", "jjjj"); dic.Add("binding_param", ""); PopUtil.ShowLoadingView("登录中..."); HttpUtil.Http.Post(URLManager.thirdLoginUrl).Form(dic).OnSuccess(result => { handleGetUserInfo(result); }).OnFail(result => { if (_action != null) { _action(new Error(500, null), null); } }).GoSync(); }
/** * 购买信息回调 */ public void purchaseProductCallBack(string msg) { // 获取iOS传过来的消息 Dictionary <string, string> dicMsg = UnityIOSAndroid.parseMsg(msg); string purchaseStatus = dicMsg["purchaseStatus"]; string UUID = dicMsg["UUID"]; string productID = dicMsg["productID"]; PurchaseProductStatus status = (PurchaseProductStatus)Enum.Parse(typeof(PurchaseProductStatus), purchaseStatus); switch (status) { case PurchaseProductStatus.PKPurchaseProductStatusPurchased: string receipt = dicMsg["receipt"]; checkReceiptIsValid(productID, receipt, UUID, gameObject); break; case PurchaseProductStatus.PKPurchaseProductStatusRestored: PopUtil.ShowMessageBoxWithConfirm("提示", "恢复购买成功!"); break; case PurchaseProductStatus.PKPurchaseProductStatusPurchasing: //CommonUI.showLoadingView(gameObject, "正在获取支付信息"); break; case PurchaseProductStatus.PKPurchaseProductStatusFailed: PopUtil.ShowMessageBoxWithConfirm("提示", "购买失败!"); break; case PurchaseProductStatus.PKPurchaseProductStatusCancelled: PopUtil.ShowMessageBoxWithConfirm("提示", "用户取消购买!"); break; case PurchaseProductStatus.PKPurchaseProductStatusNotAllowed: PopUtil.ShowMessageBoxWithConfirm("提示", "该设备不支持内购"); break; case PurchaseProductStatus.PKPurchaseProductStatusPermissionDenied: PopUtil.ShowMessageBoxWithConfirm("提示", "用户不支持内购"); break; case PurchaseProductStatus.PKPurchaseProductStatusRequestingPurchase: PopUtil.ShowLoadingView("Loading...."); break; case PurchaseProductStatus.PKPurchaseProductStatusRequestPurchaseSuccess: //CommonUI.showLoadingView(gameObject, " 商品信息获取成功!"); break; case PurchaseProductStatus.PKPurchaseProductStatusRequestPurchaseFailed: PopUtil.ShowMessageBoxWithConfirm("提示", "拉取商品信息失败,请重试!"); break; } }
public void registBtnClick() { var count = countField.text; var password = passwordField.text; if (count == null || count == "") { PopUtil.ShowTotoast("帐号不能为空"); return; } if (password == null || password == "") { PopUtil.ShowTotoast("密码不能为空"); return; } PopUtil.ShowLoadingView("注册中..."); registHandle.registAction(count, password, (error, result) => { if (error == null) { PopUtil.ShowLoadingView("登录中..."); NetCore.Instance.RegisterAction(NetProto.Api.ENetMsgId.user_login_ack, (loginAction) => { UserLoginAck userLoginAck = (UserLoginAck)loginAction; if (userLoginAck.BaseAck.Ret == 1) { Application.LoadLevel("main"); } }); loginHandle.loginReq(); } else { if (error.code == 500) { PopUtil.ShowTotoast("网络有问题,或者联系: JX"); } else { PopUtil.ShowTotoast(error.msg); } } }); }
/** * 是否是正在加载的界面 */ public void isLoadingView(bool flag) { string loadingText = "登录中..."; if (UserManager.getUserAuthFromUserDefault() == null) { loadingText = "加载中..."; } if (flag) { PopUtil.ShowLoadingView(loadingText); } else { PopUtil.DismissLoadingView(); } login.SetActive(!flag); }
public void onLoginBtnClick() { string count = countField.text; string password = passwordField.text; if (count == null || count == "") { PopUtil.ShowTotoast("帐号不能为空"); return; } if (password == null || password == "") { PopUtil.ShowTotoast("密码不能为空"); return; } PopUtil.ShowLoadingView("登录中..."); loginHandle.login(count, password, (error, result) => { handleLoginResult(error, result); }); }