using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class AwardExchangeWin : Window { [SerializeField] InputField input; [SerializeField] Button receiveBtn; const string exchangeUrl = "http://center.2460web.com:53003/Coupon/CouponCode.php?"; protected override void BindController() { } protected override void AddListeners() { receiveBtn.AddListener(ClickRecevieBtn); } protected override void OnPreOpen() { InitUI(); } protected override void OnAfterOpen() { this.transform.SetAsLastSibling(); } protected override void OnPreClose() { } protected override void OnAfterClose() { } private void InitUI() { input.text = string.Empty; } private void ClickRecevieBtn() { string passward = input.text; if(string.IsNullOrEmpty(passward)) { SysNotifyMgr.Instance.ShowTip("InputExchangeCode"); return; } else { var tables = new Dictionary(); tables["channel"] = VersionConfig.Get().appId; tables["code"] = passward; tables["accid"] = SDKUtility.Instance.FreePlatformInfo.account; tables["sid"] = ServerListCenter.Instance.currentServer.region_flag.ToString(); tables["pushurl"] = ServerListCenter.Instance.currentServer.region_domain; HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(exchangeUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType, 1, null); } } } }