예제 #1
0
        private void list_Rank_ItemClick(object sender, ItemClickEventArgs e)
        {
            CBRankModel m = e.ClickedItem as CBRankModel;

            if (m.uid.Length != 0)
            {
                this.Frame.Navigate(typeof(UserInfoPage), m.uid);
            }
        }
예제 #2
0
        private async void GetRankInfo()
        {
            try
            {
                pr_load.Visibility = Visibility.Visible;
                wc = new WebClientClass();
                string url = string.Empty;
                if (cb_Rank.SelectedIndex == 0)
                {
                    url = string.Format("http://bangumi.bilibili.com/sponsor/rank/get_sponsor_week_list?access_key={0}&appkey={1}&build=418000&mobi_app=android&page=1&pagesize=25&platform=android&season_id={2}&ts={3}", ApiHelper.access_key, ApiHelper._appKey_Android, banID, ApiHelper.GetTimeSpen);
                }
                else
                {
                    url = string.Format("http://bangumi.bilibili.com/sponsor/rank/get_sponsor_total?access_key={0}&appkey={1}&build=418000&mobi_app=android&page=1&pagesize=25&platform=android&season_id={2}&ts={3}", ApiHelper.access_key, ApiHelper._appKey_Android, banID, ApiHelper.GetTimeSpen);
                }
                url += "&sign=" + ApiHelper.GetSign_Android(url);
                string results = await wc.GetResults(new Uri(url));

                CBRankModel model = JsonConvert.DeserializeObject <CBRankModel>(results);
                if (model.code == 0)
                {
                    CBRankModel        resultModel = JsonConvert.DeserializeObject <CBRankModel>(model.result.ToString());
                    List <CBRankModel> ls          = JsonConvert.DeserializeObject <List <CBRankModel> >(resultModel.list.ToString());
                    list_Rank.ItemsSource = ls;
                }
                else
                {
                    messShow.Show("读取承包失败," + model.message, 3000);
                }
            }
            catch (Exception)
            {
                messShow.Show("读取承包失败", 3000);
                //throw;
            }
            finally
            {
                pr_load.Visibility = Visibility.Collapsed;
            }
        }