예제 #1
0
        private async Task LoadingInit()
        {
            // 로딩 시작
            await Global.LoadingStartAsync();

            #region 네트워크 상태 확인
            var current_network = Connectivity.NetworkAccess; // 현재 네트워크 상태
            if (current_network != NetworkAccess.Internet)    // 네트워크 연결 불가
            {
                home = null;
                await DisplayAlert("알림", "네트워크에 연결할 수 없습니다!", "확인");

                return;
            }
            #endregion
            #region 네트워크 연결 가능
            else
            {
                home = SH_DB.PostSearchHomeToHome(home_index);
            }
            #endregion

            Init();
            // 로딩 완료
            await Global.LoadingEndAsync();
        }
예제 #2
0
 public WriteReviewPage(SH_Home home, ShopReviewView wrv)
 {
     InitializeComponent();
     this.home = home;
     this.wrv  = wrv;
     Init();
 }
예제 #3
0
        public ShopSaleView(string titleName, SH_Home home)
        {
            InitializeComponent();
            this.home = home;
            #region 네트워크 상태 확인
            var current_network = Connectivity.NetworkAccess; // 현재 네트워크 상태
            if (current_network != NetworkAccess.Internet)    // 네트워크 연결 불가
            {
                productList = null;
            }
            #endregion
            #region 네트워크 연결 가능
            else
            {
                productList = SH_DB.PostSearchProductToHome(home.SH_HOME_INDEX);
            }
            #endregion
            Init();

            myShopName = titleName;
        }
예제 #4
0
        public ShopDetailPage(string titleName, int productIndex, SH_Home home)
        {
            InitializeComponent();

            #region IOS의 경우 초기화
            NavigationPage.SetHasNavigationBar(this, false); // Navigation Bar 지우는 코드 생성자에 입력
            if (Device.OS == TargetPlatform.iOS)
            {
                MainGrid.RowDefinitions[0].Height = Global.title_size_value;
            }
            if (Global.ios_x_model == true) // ios X 이상의 모델일 경우
            {
                MainGrid.RowDefinitions[4].Height = 30;
            }
            #endregion
            myShopName        = titleName;
            this.productIndex = productIndex;
            this.home         = home;

            LoadingInit();
        }
예제 #5
0
 public ShopReviewView(string titleName, SH_Home home)
 {
     InitializeComponent();
     Device.BeginInvokeOnMainThread(async() =>
     {
         this.home = home;
         #region 네트워크 상태 확인
         var current_network = Connectivity.NetworkAccess; // 현재 네트워크 상태
         if (current_network != NetworkAccess.Internet)    // 네트워크 연결 불가
         {
             reviewList = null;
             await App.Current.MainPage.DisplayAlert("알림", "네트워크에 연결할 수 없습니다!", "확인");
             return;
         }
         #endregion
         #region 네트워크 연결 가능
         else
         {
             reviewList = SH_DB.PostSearchReviewToHome(home.SH_HOME_INDEX);
         }
         #endregion
         Init();
     });
 }
예제 #6
0
 public ShopInfoView(string titleName, SH_Home home)
 {
     InitializeComponent();
     this.home = home;
     Init();
 }
예제 #7
0
        // 최근 본 상품 목록 업데이트
        private void RecentViewUpdate()
        {
            SH_RecentView RecentView;

            if (Global.b_user_login == true) // 회원인 상태로 로그인이 되어있다면
            {
                RecentView = SH_DB.PostSelectRecentViewToID(Global.ID);
            }
            else // 비회원 상태
            {
                RecentView = SH_DB.PostSelectRecentViewToID(Global.non_user_id);
            }

            if (RecentView.SH_HOME_INDEX1 != 0)
            {
                SH_Home sh = SH_DB.PostSearchHomeToHome(RecentView.SH_HOME_INDEX1);
                HomeList.Add(sh);
            }
            if (RecentView.SH_HOME_INDEX2 != 0)
            {
                SH_Home sh = SH_DB.PostSearchHomeToHome(RecentView.SH_HOME_INDEX2);
                HomeList.Add(sh);
            }
            if (RecentView.SH_HOME_INDEX3 != 0)
            {
                SH_Home sh = SH_DB.PostSearchHomeToHome(RecentView.SH_HOME_INDEX3);
                HomeList.Add(sh);
            }

            Grid ColumnGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    }
                },
                Margin = new Thickness(15, 0, 15, 0),
            };

            RecentViewGrid.Children.Add(ColumnGrid);

            if (HomeList.Count == 0) // 최근 본 상품에 이미지가 없을 경우
            {
                CustomLabel errorLabel = new CustomLabel
                {
                    Size              = 18,
                    TextColor         = Color.Black,
                    HorizontalOptions = LayoutOptions.Center,
                    Text              = "최근 본 상품이 없습니다!",
                };
                RecentViewGrid.Children.Add(errorLabel);
                return;
            }

            for (int i = 0; i < HomeList.Count; i++)
            {
                Grid inGrid = new Grid
                {
                    RowDefinitions =
                    {
                        new RowDefinition {
                            Height = 100
                        },
                        new RowDefinition {
                            Height = 30
                        },
                    },
                    Margin = new Thickness(15, 0, 15, 0),
                };
                RecentGridClickList.Add(inGrid);
                ColumnGrid.Children.Add(inGrid, i, 0);
                CachedImage recentImage = new CachedImage
                {
                    LoadingPlaceholder = Global.LoadingImagePath,
                    ErrorPlaceholder   = Global.NotFoundImagePath,
                    HorizontalOptions  = LayoutOptions.Center,
                    VerticalOptions    = LayoutOptions.Center,
                    Aspect             = Aspect.AspectFit,
                };
                CustomLabel recentLabel = new CustomLabel
                {
                    Size              = 14,
                    TextColor         = Color.Black,
                    HorizontalOptions = LayoutOptions.Center,
                };

                recentImage.Source = HomeList[i].SH_HOME_IMAGE;
                recentLabel.Text   = HomeList[i].SH_HOME_NAME;

                inGrid.Children.Add(recentImage, 0, 0);
                inGrid.Children.Add(recentLabel, 0, 1);
            }

            #region 최근 본 목록 그리드 탭 이벤트
            for (int k = 0; k < RecentGridClickList.Count; k++)
            {
                Grid        tempGrid  = RecentGridClickList[k];
                CustomLabel tempLabel = (CustomLabel)tempGrid.Children.ElementAt(1);

                tempGrid.GestureRecognizers.Add(new TapGestureRecognizer()
                {
                    Command = new Command(() =>
                    {
                        // 탭을 한번 클릭했다면 다시 열리지 않도록 제어
                        if (Global.isOpen_ShopMainPage == true)
                        {
                            return;
                        }
                        Global.isOpen_ShopMainPage = true;

                        int tempIndex = 0;
                        for (int i = 0; i < HomeList.Count; i++)
                        {
                            if (tempLabel.Text == HomeList[i].SH_HOME_NAME)
                            {
                                tempIndex = HomeList[i].SH_HOME_INDEX; // 홈 메인 페이지의 인덱스를 찾음
                            }
                        }
                        Navigation.PushAsync(new ShopMainPage(tempIndex)); // 최근 본 상품 페이지 오픈
                    })
                });
            }
            #endregion
        }