protected override void OnInit(QFramework.IUIData uiData) { mData = uiData as DatePickerPanelData ?? new DatePickerPanelData(); // please add init code here // PickerPanel.Init(DateTime.Now, delegate // { // Log.I(PickerPanel._selectDate.ToString()); // } ); PickerPanel.Init(DateTime.Parse(mData.birthday)); BtnCancel.onClick.AddListener(() => { Back(); }); BtnConfirm.onClick.AddListener(() => { SimpleEventSystem.Publish(new SelectPickDate(PickerPanel._selectDate.ToString("yyyy-MM-dd"))); Back(); }); }
protected override void OnInit(QFramework.IUIData uiData) { mData = uiData as AddressPickerPanelData ?? new AddressPickerPanelData(); Dictionary <string, object> paramDict = new Dictionary <string, object>(); if (PlayerPrefsUtil.ProvinceModels.IsNull()) { HttpUtil.GetWithSign <List <ProvinceModel> >(UrlConst.ProvinceCityAreaList, paramDict) .Subscribe(response => { PlayerPrefsUtil.ProvinceModels = response; if (mData.selectAddress != null) { PickerPanel.Init(response, mData.selectAddress); } else { PickerPanel.Init(response); } } , e => { }).AddTo(this); } else { if (mData.selectAddress != null) { PickerPanel.Init(PlayerPrefsUtil.ProvinceModels, mData.selectAddress); } else { PickerPanel.Init(PlayerPrefsUtil.ProvinceModels); } } BtnCancel.onClick.AddListener(() => { Back(); }); BtnConfirm.onClick.AddListener(() => { SimpleEventSystem.Publish(new SelectAddressDate(PickerPanel.selectAddress)); Back(); }); }