Ejemplo n.º 1
0
        /// <summary>
        /// 加载的时候获取数据
        /// </summary>
        private async void InitData()
        {
            var netWorkDataResult = await this._netWorkServices.GetAsync <PersonalityRecommend>("FindMusic", "PersonalityRecommend", new { limit = 10 });

            if (!netWorkDataResult.Successed)
            {
                //todo 网络提示信息
                return;
            }
            var temp = netWorkDataResult.Data;

            if (temp?.RecommendList != null)
            {
                // RecommendList.Clear();
                //RecommendList.AddRange(temp.RecommendList.Select(x => new PlayListModel(x)));
                await RecommendList.AddRangeAsync(temp.RecommendList);
            }
            if (temp?.AnchorRadioList != null)
            {
                //AnchorRadioList.Clear();
                //AnchorRadioList.AddRange(temp.AnchorRadioList.Select(x => new RadioModel(x)));
                await AnchorRadioList.AddRangeAsync(temp.AnchorRadioList);
            }
            if (temp?.RecommendMvList != null)
            {
                await RecommendMvList.AddRangeAsync(temp.RecommendMvList);
            }
            if (temp?.NewMusicList != null)
            {
                //NewMusicList.Clear();
                //NewMusicList.AddRange(temp.NewMusicList);
                await NewMusicList.AddRangeAsync(temp.NewMusicList);
            }
            if (temp?.PrivateContentList != null)
            {
                await ExclusiveDeliveryList.AddRangeAsync(temp.PrivateContentList);
            }
            if (temp?.BannerList != null)
            {
                //BannerList.Clear();
                //BannerList.AddRange(temp.BannerList.Select(x => new BannerModel { Image = x.Pic }));
                await BannerList.AddRangeAsync(temp.BannerList);
            }
        }
Ejemplo n.º 2
0
 public static void RefreshRecommendList()
 {
     RecommendList?.StopLoading();
     RecommendList = new RecommendIllustsCollection();
 }
        private Attachment getRecommendDialog(int rcmdDlgId)
        {
            //MEDIA 데이터 추출
            Attachment returnAttachment = new Attachment();

            List <Recommend_DLG_MEDIA> SelectRecommend_DLG_MEDIA = db.SelectRecommend_DLG_MEDIA(rcmdDlgId);

            if (rcmdDlgId != 4)
            {
                for (int i = 0; i < SelectRecommend_DLG_MEDIA.Count; i++)
                {
                    //CardImage 입력
                    cardImage = new CardImage()
                    {
                        Url = SelectRecommend_DLG_MEDIA[i].media_url
                    };

                    if (SelectRecommend_DLG_MEDIA[i].btn_1_context.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[i].btn_1_context,
                            Type  = SelectRecommend_DLG_MEDIA[i].btn_1_type,
                            Title = SelectRecommend_DLG_MEDIA[i].btn_1_title
                        };
                        cardButtons.Add(plButton);
                    }

                    if (SelectRecommend_DLG_MEDIA[i].btn_2_context.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[i].btn_2_context,
                            Type  = SelectRecommend_DLG_MEDIA[i].btn_2_type,
                            Title = SelectRecommend_DLG_MEDIA[i].btn_2_title
                        };
                        cardButtons.Add(plButton);
                    }

                    if (SelectRecommend_DLG_MEDIA[i].btn_3_context.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[i].btn_3_context,
                            Type  = SelectRecommend_DLG_MEDIA[i].btn_3_type,
                            Title = SelectRecommend_DLG_MEDIA[i].btn_3_title
                        };
                        cardButtons.Add(plButton);
                    }

                    if (SelectRecommend_DLG_MEDIA[i].btn_4_context.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[i].btn_4_context,
                            Type  = SelectRecommend_DLG_MEDIA[i].btn_4_type,
                            Title = SelectRecommend_DLG_MEDIA[i].btn_4_title
                        };
                        cardButtons.Add(plButton);
                    }

                    if (SelectRecommend_DLG_MEDIA[i].btn_5_context.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[i].btn_5_context,
                            Type  = SelectRecommend_DLG_MEDIA[i].btn_5_type,
                            Title = SelectRecommend_DLG_MEDIA[i].btn_5_title
                        };
                        cardButtons.Add(plButton);
                    }

                    //message.Attachments.Add(GetHeroCard(SelectRecommend_DLG_MEDIA[i].card_title, "", SelectRecommend_DLG_MEDIA[i].card_text, cardImage, cardButtons));
                    returnAttachment = GetHeroCard(SelectRecommend_DLG_MEDIA[i].card_title, "", SelectRecommend_DLG_MEDIA[i].card_text, cardImage, cardButtons);
                }
            }
            else
            {
                string domainURL = "https://bottest.hyundai.com";

                List <RecommendList> RecommendList = db.SelectedRecommendList(use, important, gender, age);
                RecommendList        recommend     = new RecommendList();

                for (var i = 0; i < RecommendList.Count; i++)
                {
                    string main_color_view    = "";
                    string main_color_view_nm = "";

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_1))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_1 + "/00001.jpg" + "@";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM1 + "@";
                    }
                    ;

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_2))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_2 + "/00001.jpg" + "@";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM2 + "@";
                    }
                    ;

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_3))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_3 + "/00001.jpg" + "@";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM3 + "@";
                    }
                    ;

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_4))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_4 + "/00001.jpg" + "@";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM4 + "@";
                    }
                    ;

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_5))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_5 + "/00001.jpg" + "@";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM5 + "@";
                    }
                    ;

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_6))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_6 + "/00001.jpg" + "@";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM6 + "@";
                    }
                    ;

                    if (!string.IsNullOrEmpty(RecommendList[i].MAIN_COLOR_VIEW_7))
                    {
                        main_color_view    += domainURL + "/assets/images/price/360/" + RecommendList[i].MAIN_COLOR_VIEW_7 + "/00001.jpg";
                        main_color_view_nm += RecommendList[i].MAIN_COLOR_VIEW_NM7 + "@";
                    }
                    ;

                    main_color_view    = main_color_view.TrimEnd('@');
                    main_color_view_nm = main_color_view_nm.TrimEnd('@');

                    var subtitle = RecommendList[i].TRIM_DETAIL + "|" + "가격: " + RecommendList[i].TRIM_DETAIL_PRICE + "|" +
                                   main_color_view + "|" +
                                   RecommendList[i].OPTION_1_IMG_URL + "|" +
                                   RecommendList[i].OPTION_1 + "|" +
                                   RecommendList[i].OPTION_2_IMG_URL + "|" +
                                   RecommendList[i].OPTION_2 + "|" +
                                   RecommendList[i].OPTION_3_IMG_URL + "|" +
                                   RecommendList[i].OPTION_3 + "|" +
                                   RecommendList[i].OPTION_4_IMG_URL + "|" +
                                   RecommendList[i].OPTION_4 + "|" +
                                   RecommendList[i].OPTION_5_IMG_URL + "|" +
                                   RecommendList[i].OPTION_5 + "|" +
                                   main_color_view_nm;

                    if (SelectRecommend_DLG_MEDIA[0].btn_1_title.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[0].btn_1_context,
                            Type  = SelectRecommend_DLG_MEDIA[0].btn_1_type,
                            Title = SelectRecommend_DLG_MEDIA[0].btn_1_title
                        };
                        cardButtons.Add(plButton);
                    }

                    if (SelectRecommend_DLG_MEDIA[0].btn_2_title.Length != 0)
                    {
                        CardAction plButton = new CardAction()
                        {
                            Value = SelectRecommend_DLG_MEDIA[0].btn_2_context,
                            Type  = SelectRecommend_DLG_MEDIA[0].btn_2_type,
                            Title = SelectRecommend_DLG_MEDIA[0].btn_2_title
                        };
                        cardButtons.Add(plButton);
                    }
                    returnAttachment = GetHeroCard("trim", subtitle, "", cardImage, cardButtons);
                }
            }
            return(returnAttachment);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 查询我推荐的会员
        /// </summary>
        /// <returns></returns>
        public ActionResult Recommend()
        {
            var list = RecommendList.GetRecommend(Package.UserId, this.ChangePage());

            return(SuccessResultList(list));
        }