Exemplo n.º 1
0
        /// <summary>
        /// 加载Tab
        /// </summary>
        public async void LoadTabData()
        {
            _loading    = true;
            showLoading = Visibility.Visible;

            var data = await home.GetTabData(tab.id);

            if (data.success)
            {
                tabData = data.data;
            }
            else
            {
                Utils.ShowMessageToast(data.message);
            }
            showLoading = Visibility.Collapsed;
            _loading    = false;
        }
Exemplo n.º 2
0
        public async Task GetTabData()
        {
            try
            {
                var result = await homeAPI.TabDetail(tab_id).Request();

                if (result.status)
                {
                    var model = await result.GetData <TabDataModel>();

                    if (model.code == 0)
                    {
                        var banner = model.data.item.FirstOrDefault(x => x.@goto == "banner");
                        if (banner != null)
                        {
                            var list = banner.banner_item.Where(x => string.IsNullOrEmpty(x.image)).ToList();
                            foreach (var item in list)
                            {
                                banner.banner_item.Remove(item);
                            }
                            if (banner.banner_item.Count == 0)
                            {
                                model.data.item.Remove(banner);
                            }
                        }
                        Detail = model.data;
                    }
                    else
                    {
                        Utils.ShowMessageToast(model.message);
                    }
                }
                else
                {
                    Utils.ShowMessageToast(result.message);
                }
            }
            catch (Exception ex)
            {
                var result = HandelError(ex);
                Utils.ShowMessageToast(ex.Message);
            }
        }