コード例 #1
0
    void OnClickGift()
    {
        string errorInfo = "";

        if (kGiftID.value.Length == 0)
        {
            errorInfo = ZPLocalization.Instance.Get("GiftID");
        }
        else if (kGiftMoney.value.Length == 0)
        {
            errorInfo = ZPLocalization.Instance.Get("GiftMoney");
        }
        else if (!isLogin && kBankPassword.value.Length == 0 && kPhoneCode.value.Length == 0)
        {
            errorInfo = ZPLocalization.Instance.Get("GiftPassword");
        }

        if (errorInfo.Length > 0)
        {
            EginProgressHUD.Instance.ShowPromptHUD(errorInfo);
        }
        else
        {
//			EginProgressHUD.Instance.ShowWaitHUD(ZPLocalization.Instance.Get("HttpConnectWait"));
            if (nickName.Length == 0)
            {
                EginProgressHUD.Instance.ShowPromptHUD("用户ID不存在");
            }
            else
            {
                string moneyStr   = kGiftMoney.value;
                string moneyZhStr = EginTools.numToCnNum(moneyStr);
//				if (moneyStr.Length > 8) {
//					moneyZhStr = moneyStr.Substring(0, moneyStr.Length - 8);
//					moneyZhStr += ZPLocalization.Instance.Get("GiftNumberZH_1");
//					moneyZhStr += moneyStr.Substring(moneyStr.Length - 8, 4);
//					moneyZhStr += ZPLocalization.Instance.Get("GiftNumberZH_0");
//					moneyZhStr += moneyStr.Substring(moneyStr.Length - 4, 4);
//				}else if (moneyStr.Length > 4) {
//					moneyZhStr = moneyStr.Substring(0, moneyStr.Length - 4);
//					moneyZhStr += ZPLocalization.Instance.Get("GiftNumberZH_0");
//					moneyZhStr += moneyStr.Substring(moneyStr.Length - 4, 4);
//				}else {
//					moneyZhStr = moneyStr;
//				}
                kConfirmID.text       = kGiftID.value;
                kConfirmMoney.text    = kGiftMoney.value;
                kConfirmMoneyZh.text  = moneyZhStr;
                kConfirmNickname.text = nickName;
                vConfirm.SetActive(true);
            }
        }
    }