示例#1
0
        protected override void OnFreshView()
        {
            base.OnFreshView();
            _curData = GetData <ExtractItemData>();
            if (_curData == null)
            {
                YxDebug.LogError("_curData==========null");
                return;
            }
            BindState = _curData.BindInfo.BindState;
            if (gameObject.activeInHierarchy)
            {
                StartCoroutine(OnBindStateShow.WaitExcuteCalls());
            }
            var platfomName = _curData.PlatformName;

            platfomName = BindState
                ? string.Format(TitleBindStateFormat, platfomName)
                : string.Format(TitleUnBindStateFormat, platfomName);
            var btnNotice = BindState ? BtnBindStateFormat : BtnUnBindStateFormat;

            TitleLabel.TrySetComponentValue(platfomName);
            BtnLabel.TrySetComponentValue(btnNotice);
            if (PhoneInput != null)
            {
                var phone = _curData.BindInfo.BindPhoneNumber;
                PhoneInput.enabled = string.IsNullOrEmpty(phone);
                PhoneInput.value   = phone;
            }
        }
示例#2
0
 protected override void DealShowData()
 {
     if (Data is Dictionary <string, object> )
     {
         ExtractData data = new ExtractData(Data, GetType());
         if (ShowArea)
         {
             var visible = data.Visible;
             ShowArea.SetActive(visible);
             if (visible)
             {
                 if (Option)
                 {
                     _dataDic = data.DataDic;
                     Option.Clear();
                     foreach (var item in data.DataDic)
                     {
                         Option.AddItem(item.Key);
                     }
                     if (Option.items.Count > 0)
                     {
                         var showName = Option.items[0];
                         Option.Set(showName);
                         _curCostType = showName;
                         _curCostData = _dataDic[showName] as ExtractItemData;
                     }
                     else
                     {
                         YxDebug.LogError("Extract types count is zero,please check again!");
                     }
                 }
             }
         }
     }
 }
示例#3
0
 public void OnCostTypeChange(string value)
 {
     if (_dataDic.ContainsKey(value))
     {
         _curCostType = value;
         _curCostData = _dataDic[value] as ExtractItemData;
     }
     else
     {
         YxDebug.LogError("There is not exist such key in dic,key is:" + value);
     }
 }
示例#4
0
 public void OnBindStateChange(object obj)
 {
     if (obj != null)
     {
         var getData = obj as ExtractItemData;
         if (getData != null)
         {
             _curCostData           = getData;
             _dataDic[_curCostType] = _curCostData;
             var key = string.Format(BindTypeFormat, _curCostData.PlatformType);
             BindInfo[key] = _curCostData.BindInfo;
             FreshBindInfo();
         }
         else
         {
             YxDebug.LogError("OnBindStateChange getData is null");
         }
     }
     else
     {
         YxDebug.LogError("OnBindStateChange obj is null");
     }
 }
示例#5
0
 protected override void DealShowData()
 {
     if (Data is Dictionary <string, object> )
     {
         ExtractData data = new ExtractData(Data, GetType());
         ViewVisible     = data.ExtractVisible;
         RecordVisible   = data.RecordVisible;
         BindCouldChange = data.CouldChangeBind;
         if (gameObject.activeInHierarchy)
         {
             StartCoroutine(OnVisibleAction.WaitExcuteCalls());
         }
         ExtracNotice.TrySetComponentValue(data.ExtractNotice);
         if (ViewVisible)
         {
             _dataDic = data.DataDic;
             if (Option)
             {
                 Option.Clear();
                 foreach (var item in data.DataDic)
                 {
                     Option.AddItem(item.Key);
                 }
                 if (Option.items.Count > 0)
                 {
                     var showName = Option.items[0];
                     Option.Set(showName);
                     _curCostType = showName;
                     _curCostData = _dataDic[showName] as ExtractItemData;
                 }
                 else
                 {
                     YxDebug.LogError("Extract types count is zero,please check again!");
                 }
             }
             else
             {
                 var tabWindow = MainYxView as YxTabPageWindow;
                 if (tabWindow)
                 {
                     List <TabData> datas = new List <TabData>();
                     foreach (var item in data.DataDic)
                     {
                         var     itemData = item.Value as ExtractItemData;
                         var     tabName  = itemData != null ? itemData.PlatformType: item.Key;
                         TabData tabData  = new TabData()
                         {
                             Name          = item.Key,
                             UpStateName   = string.Format(TabUpFormat, tabName),
                             DownStateName = string.Format(TabDownFormat, tabName),
                             Data          = item.Key
                         };
                         datas.Add(tabData);
                     }
                     tabWindow.TabDatas = datas.ToArray();
                     tabWindow.UpdateView();
                 }
             }
         }
     }
 }