using System.Threading.Tasks; using ET; using FairyGUI; using UI.Store; namespace GFGGame { public class StorePayPropView : BaseWindow { private UI_StorePayPropUI _ui; //商品id private int _goodsId; //临时订单id private long _tempOrderId; //订单金额 private long _price; public override void Dispose() { if (_ui != null) { _ui.Dispose(); } _ui = null; base.Dispose(); } protected override void OnHide() { base.OnHide(); } protected override void OnInit() { base.OnInit(); packageName = UI_StorePayPropUI.PACKAGE_NAME; _ui = UI_StorePayPropUI.Create(); this.viewCom = _ui.target; this.viewCom.Center(); this.modal = true; viewAnimationType = EnumViewAnimationType.ZOOM_CENTER; _ui.m_payVxBtn.onClick.Add(OnVxBtnBuyClick); _ui.m_payAliBtn.onClick.Add(OnAliBtnBuyClick); _ui.m_payClose.onClick.Add(OnCloseClick); } protected override void OnShown() { base.OnShown(); _goodsId = (int)(this.viewData as object[])[0]; _tempOrderId = (int)(this.viewData as object[])[1]; _price = (int)(this.viewData as object[])[2]; ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId); _ui.m_txtTotal.text = _price + "元"; _ui.m_txtShopName.text = cfg.productName; _ui.m_txtXzf.text = _price + "元"; } private async void OnVxBtnBuyClick() { S2C_CreateAliOrder response = await ShopSProxy.ReqCreateAliOrder(_tempOrderId); if (response == null || string.IsNullOrEmpty(response.AliOrderStr)) { //TODO 提示调起支付宝失败 return; } AliManagerr.Instance.Pay(response.AliOrderStr); } private async void OnAliBtnBuyClick() { } private async void OnCloseClick() { } } }