|
@@ -13,6 +13,8 @@ namespace GFGGame
|
|
private List<PoemGalleryData> _galleryDatas = new List<PoemGalleryData>();
|
|
private List<PoemGalleryData> _galleryDatas = new List<PoemGalleryData>();
|
|
private int _sortType = 0;//由GallerySortType定义
|
|
private int _sortType = 0;//由GallerySortType定义
|
|
private int _pageCount = 10;
|
|
private int _pageCount = 10;
|
|
|
|
+ private int _tabIndex = 0;//当前选中大页签下标,首页0投稿1收藏2
|
|
|
|
+ private int _subtabIndex = 0;//当前选中小页签下标,推荐0好友1排行榜2;我的收藏0我的作品1
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
@@ -42,7 +44,6 @@ namespace GFGGame
|
|
_ui.m_comNormal.m_listRecommend.itemRenderer = RenderListItem;
|
|
_ui.m_comNormal.m_listRecommend.itemRenderer = RenderListItem;
|
|
_ui.m_comNormal.m_listRecommend.SetVirtual();
|
|
_ui.m_comNormal.m_listRecommend.SetVirtual();
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.onPullDownRelease.Add(onPullDownRelease);
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.onPullDownRelease.Add(onPullDownRelease);
|
|
- _ui.m_comNormal.m_listRecommend.scrollPane.header.onSizeChanged.Add(OnSizeChanged);
|
|
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.onScroll.Add(onScroll);
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.onScroll.Add(onScroll);
|
|
|
|
|
|
_ui.m_comNormal.m_listFriend.itemRenderer = RenderListItem;
|
|
_ui.m_comNormal.m_listFriend.itemRenderer = RenderListItem;
|
|
@@ -82,14 +83,35 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
|
|
|
|
|
|
+ _tabIndex = 0;
|
|
|
|
+ _subtabIndex = 0;
|
|
|
|
+ if (this.viewData != null)
|
|
|
|
+ {
|
|
|
|
+ _tabIndex = (int)(this.viewData as object[])[0];
|
|
|
|
+ _subtabIndex = (int)(this.viewData as object[])[1];
|
|
|
|
+ }
|
|
|
|
+ _ui.m_c1.selectedIndex = _tabIndex;
|
|
|
|
+
|
|
|
|
+ if (_tabIndex == 0)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_comNormal.m_c1.selectedIndex = _subtabIndex;
|
|
|
|
+ OnNormalTabChange();
|
|
|
|
+ }
|
|
|
|
+ else if (_tabIndex == 2)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_comFavorites.m_c1.selectedIndex = _subtabIndex;
|
|
|
|
+ OnFavoritesTabChange();
|
|
|
|
+ }
|
|
_list = _ui.m_comNormal.m_listRecommend;
|
|
_list = _ui.m_comNormal.m_listRecommend;
|
|
- _list.numItems = 4;
|
|
|
|
|
|
+ _list.numItems = 10;
|
|
|
|
+ UpdateView();
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
ResetPullDownRelease();
|
|
ResetPullDownRelease();
|
|
|
|
+ _ui.m_comNormal.m_comBoBox.selectedIndex = 0;
|
|
}
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
@@ -103,20 +125,15 @@ namespace GFGGame
|
|
{
|
|
{
|
|
ViewManager.GoBackFrom(typeof(PoemGalleryView).FullName);
|
|
ViewManager.GoBackFrom(typeof(PoemGalleryView).FullName);
|
|
}
|
|
}
|
|
- /// <summary>
|
|
|
|
- /// 投稿
|
|
|
|
- /// </summary>
|
|
|
|
- private void OnBtnJoinClick()
|
|
|
|
- {
|
|
|
|
- ViewManager.Show<DressUpView>(1, new object[] { typeof(PoemGalleryView).FullName, this.viewData }, true);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 首页
|
|
/// 首页
|
|
/// </summary>
|
|
/// </summary>
|
|
private void OnBtnRecoverClick()
|
|
private void OnBtnRecoverClick()
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ _tabIndex = _ui.m_c1.selectedIndex;
|
|
if (_ui.m_comNormal.m_c1.selectedIndex == 0)
|
|
if (_ui.m_comNormal.m_c1.selectedIndex == 0)
|
|
{
|
|
{
|
|
onPullDownRelease();
|
|
onPullDownRelease();
|
|
@@ -129,10 +146,22 @@ namespace GFGGame
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
|
+ /// 投稿
|
|
|
|
+ /// </summary>
|
|
|
|
+ private void OnBtnJoinClick()
|
|
|
|
+ {
|
|
|
|
+ // int tabIndex = _ui.m_c1.selectedIndex;
|
|
|
|
+ // int subType = _ui.m_c1.selectedIndex
|
|
|
|
+ object[] gobackParamDatas = new object[] { _tabIndex, _subtabIndex };
|
|
|
|
+ ViewManager.Show<DressUpView>(1, new object[] { typeof(PoemGalleryView).FullName, gobackParamDatas }, true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
///收藏夹
|
|
///收藏夹
|
|
/// </summary>
|
|
/// </summary>
|
|
private void OnBtnFavoritesClick()
|
|
private void OnBtnFavoritesClick()
|
|
{
|
|
{
|
|
|
|
+ _tabIndex = _ui.m_c1.selectedIndex;
|
|
if (_ui.m_comFavorites.m_c1.selectedIndex != 0)
|
|
if (_ui.m_comFavorites.m_c1.selectedIndex != 0)
|
|
{
|
|
{
|
|
_ui.m_comFavorites.m_c1.selectedIndex = 0;
|
|
_ui.m_comFavorites.m_c1.selectedIndex = 0;
|
|
@@ -176,6 +205,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
ResetPullDownRelease();
|
|
ResetPullDownRelease();
|
|
|
|
|
|
|
|
+ _subtabIndex = _ui.m_comNormal.m_c1.selectedIndex;
|
|
if (_ui.m_comNormal.m_c1.selectedIndex == 2)//排行榜
|
|
if (_ui.m_comNormal.m_c1.selectedIndex == 2)//排行榜
|
|
{
|
|
{
|
|
|
|
|
|
@@ -208,12 +238,14 @@ namespace GFGGame
|
|
|
|
|
|
ReqGalleryList(0);
|
|
ReqGalleryList(0);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 切换收藏页签
|
|
/// 切换收藏页签
|
|
/// </summary>
|
|
/// </summary>
|
|
private void OnFavoritesTabChange()
|
|
private void OnFavoritesTabChange()
|
|
{
|
|
{
|
|
|
|
+ _subtabIndex = _ui.m_comFavorites.m_c1.selectedIndex;
|
|
if (_ui.m_comFavorites.m_c1.selectedIndex == 0)//我的收藏
|
|
if (_ui.m_comFavorites.m_c1.selectedIndex == 0)//我的收藏
|
|
{
|
|
{
|
|
_sortType = (int)GallerySortType.MyCollect;
|
|
_sortType = (int)GallerySortType.MyCollect;
|
|
@@ -228,11 +260,13 @@ namespace GFGGame
|
|
}
|
|
}
|
|
if (_list.numItems > 0) _list.ScrollToView(0);
|
|
if (_list.numItems > 0) _list.ScrollToView(0);
|
|
ReqGalleryList(0);
|
|
ReqGalleryList(0);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//分页刷新
|
|
//分页刷新
|
|
private void onScroll()
|
|
private void onScroll()
|
|
{
|
|
{
|
|
|
|
+ if (_list == null) return;
|
|
int itemIndex = _list.ChildIndexToItemIndex(0);
|
|
int itemIndex = _list.ChildIndexToItemIndex(0);
|
|
int startIndex = itemIndex + 1;
|
|
int startIndex = itemIndex + 1;
|
|
if (startIndex >= _list.numItems && startIndex % _pageCount == 0)
|
|
if (startIndex >= _list.numItems && startIndex % _pageCount == 0)
|
|
@@ -250,11 +284,12 @@ namespace GFGGame
|
|
private void UpdateGalleryList()
|
|
private void UpdateGalleryList()
|
|
{
|
|
{
|
|
_list.numItems = _galleryDatas.Count;
|
|
_list.numItems = _galleryDatas.Count;
|
|
-
|
|
|
|
|
|
+ UpdateView();
|
|
}
|
|
}
|
|
private void UpdateGalleryRankList()
|
|
private void UpdateGalleryRankList()
|
|
{
|
|
{
|
|
_ui.m_comNormal.m_listRank.numItems = _galleryDatas.Count;
|
|
_ui.m_comNormal.m_listRank.numItems = _galleryDatas.Count;
|
|
|
|
+ UpdateView();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -263,10 +298,10 @@ namespace GFGGame
|
|
/// </summary>
|
|
/// </summary>
|
|
private void OnBtnShopClick()
|
|
private void OnBtnShopClick()
|
|
{
|
|
{
|
|
- ViewManager.Show<ClothingShopView>(new object[] { ConstStoreId.GALLERY_STORE_ID }, new object[] { typeof(PoemGalleryView).FullName, this.viewData }, true);
|
|
|
|
|
|
+ object[] gobackParamDatas = new object[] { _tabIndex, _subtabIndex };
|
|
|
|
+ ViewManager.Show<ClothingShopView>(new object[] { ConstStoreId.GALLERY_STORE_ID }, new object[] { typeof(PoemGalleryView).FullName, gobackParamDatas }, true);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 排行榜奖励
|
|
/// 排行榜奖励
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -275,11 +310,45 @@ namespace GFGGame
|
|
ViewManager.Show<PoemGalleryRewardView>(null, new object[] { typeof(PoemGalleryView).FullName, this.viewData });
|
|
ViewManager.Show<PoemGalleryRewardView>(null, new object[] { typeof(PoemGalleryView).FullName, this.viewData });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void UpdateView()
|
|
|
|
+ {
|
|
|
|
+ GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
|
|
|
|
+ _ui.m_comNormal.m_txtTheme.text = string.Format("本期主题:{0}", themeCfg.theme);
|
|
|
|
+ long monday = TimeUtil.GetCurWeekMondayTime(GlobalCfgArray.globalCfg.refreshTime);//本周一5点
|
|
|
|
+ long startTime = 0;
|
|
|
|
+ long endTime = 0;
|
|
|
|
+ if ((TimeInfo.Instance.ServerNow() / 1000) < monday)//本周一5点之前显示上周
|
|
|
|
+ {
|
|
|
|
+ startTime = TimeUtil.GetLastWeekMondayTime(GlobalCfgArray.globalCfg.refreshTime);
|
|
|
|
+ endTime = TimeUtil.GetLastWeekSundayTime("23:59:59");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ startTime = monday * 1000;
|
|
|
|
+ endTime = TimeUtil.GetCurWeekSundayTime("23:59:59") * 1000; ;
|
|
|
|
+ }
|
|
|
|
+ string strStartTime = TimeUtil.FormattingTime3(startTime);
|
|
|
|
+ string strEndTime = TimeUtil.FormattingTime3(endTime); ;
|
|
|
|
+
|
|
|
|
+ _ui.m_comNormal.m_txtTime.text = string.Format("截止日期:{0}至{1}", strStartTime, strEndTime);
|
|
|
|
+ _ui.m_comNormal.m_txtRank.text = string.Format("我的排名:{0}", PoemGalleryDataManager.Instance.MyRank);
|
|
|
|
+ }
|
|
private void RenderListItem(int index, GObject obj)
|
|
private void RenderListItem(int index, GObject obj)
|
|
{
|
|
{
|
|
// PoemGalleryData data = _galleryDatas[index];
|
|
// PoemGalleryData data = _galleryDatas[index];
|
|
- // UI_ListItem item = UI_ListItem.Proxy(obj);
|
|
|
|
-
|
|
|
|
|
|
+ UI_ListItem item = UI_ListItem.Proxy(obj);
|
|
|
|
+ // item.m_loaIcon.height = 550 + Random.Range(40, 100);
|
|
|
|
+ // if (index > 1)
|
|
|
|
+ // {
|
|
|
|
+ // item.target.y=
|
|
|
|
+ // }
|
|
|
|
+ // item.target.height = item.m_loaIcon.height + 80;
|
|
|
|
+ // item.m_loaIcon.texture = data.Ntexture;
|
|
|
|
+ // item.m_txtName.text = data.AuthorName;
|
|
|
|
+ // item.m_btnCollect.title = data.CollectCount.ToString();
|
|
|
|
+ // item.m_btnCollect.selected = data.CollectOrNot;
|
|
|
|
+ // item.m_btnVote.title = data.VoteCount.ToString();
|
|
|
|
+ // item.m_btnVote.selected = data.VoteOrNot;
|
|
|
|
|
|
// if (item.m_loaIcon.data == null)
|
|
// if (item.m_loaIcon.data == null)
|
|
// {
|
|
// {
|
|
@@ -296,7 +365,7 @@ namespace GFGGame
|
|
// item.m_btnVote.onClick.Add(OnBtnVoteClick);
|
|
// item.m_btnVote.onClick.Add(OnBtnVoteClick);
|
|
// }
|
|
// }
|
|
// item.m_btnVote.data = data;
|
|
// item.m_btnVote.data = data;
|
|
- // UI_ListItem.ProxyEnd();
|
|
|
|
|
|
+ UI_ListItem.ProxyEnd();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -336,28 +405,21 @@ namespace GFGGame
|
|
// ReqGalleryList(0);
|
|
// ReqGalleryList(0);
|
|
|
|
|
|
GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
|
|
GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
|
|
- Controller controller = header.GetController("c1");
|
|
|
|
- controller.selectedIndex = 1;
|
|
|
|
|
|
+ if (header.height < header.sourceHeight) return;
|
|
|
|
+ // Transition transition = header.GetTransition("t0");
|
|
|
|
+ // transition.Play();
|
|
|
|
+ // controller.selectedIndex = 1;
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(header.sourceHeight);
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(header.sourceHeight);
|
|
Timers.inst.Add(2, 1, OnTimeComplete);
|
|
Timers.inst.Add(2, 1, OnTimeComplete);
|
|
}
|
|
}
|
|
private void OnTimeComplete(object param)
|
|
private void OnTimeComplete(object param)
|
|
{
|
|
{
|
|
GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
|
|
GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
|
|
- // Controller controller = header.GetController("c1");
|
|
|
|
- header.GetController("c1").selectedIndex = 2;
|
|
|
|
|
|
+ Transition transition = header.GetTransition("t0");
|
|
|
|
+ transition.Stop();
|
|
|
|
+ // header.GetController("c1").selectedIndex = 2;
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(0);
|
|
_ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(0);
|
|
}
|
|
}
|
|
- private void OnSizeChanged()
|
|
|
|
- {
|
|
|
|
- GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
|
|
|
|
- Controller controller = _ui.m_comNormal.m_listRecommend.scrollPane.header.GetController("c1");
|
|
|
|
-
|
|
|
|
- if (header.height <= 1)
|
|
|
|
- {
|
|
|
|
- controller.selectedIndex = 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 重置下拉刷新状态
|
|
/// 重置下拉刷新状态
|