zhaoyang 2 жил өмнө
parent
commit
f1a2626789

+ 8 - 7
FGUIProject/assets/poem/PoemGalleryPreviewUI.xml

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1,,2,,3," selected="2">
+  <controller name="c1" pages="0,,1,,2,,3,,5," selected="0">
     <remark page="0" value="推荐"/>
     <remark page="0" value="推荐"/>
-    <remark page="1" value="好友"/>
-    <remark page="2" value="收藏"/>
-    <remark page="3" value="我的"/>
+    <remark page="1" value="最新"/>
+    <remark page="2" value="好友"/>
+    <remark page="3" value="收藏"/>
+    <remark page="4" value="我的作品"/>
   </controller>
   </controller>
   <displayList>
   <displayList>
     <loader id="n1_r9ri" name="loaPicture" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,1920" align="center" vAlign="middle" fill="scaleMatchWidth"/>
     <loader id="n1_r9ri" name="loaPicture" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,1920" align="center" vAlign="middle" fill="scaleMatchWidth"/>
@@ -13,14 +14,14 @@
       <Button icon="ui://eg2y0ldpuyuxtj4"/>
       <Button icon="ui://eg2y0ldpuyuxtj4"/>
     </component>
     </component>
     <image id="n10_r9ri" name="n10" src="r9ri126" fileName="imagesGallery/hl_hyxxk.png" xy="165,35" group="n12_r9ri"/>
     <image id="n10_r9ri" name="n10" src="r9ri126" fileName="imagesGallery/hl_hyxxk.png" xy="165,35" group="n12_r9ri"/>
-    <component id="n9_r9ri" name="comHead" src="r9ri12m" fileName="componentsGallery/ComHead.xml" xy="200,62" group="n12_r9ri"/>
+    <component id="n9_r9ri" name="comHead" src="r9ri12m" fileName="componentsGallery/ComRoleHead.xml" xy="200,62" group="n12_r9ri"/>
     <text id="n4_r9ri" name="txtName" xy="361,103" size="71,46" group="n12_r9ri" fontSize="34" color="#9d7f5c" text="老六"/>
     <text id="n4_r9ri" name="txtName" xy="361,103" size="71,46" group="n12_r9ri" fontSize="34" color="#9d7f5c" text="老六"/>
     <component id="n7_r9ri" name="btnAddFriend" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="787,95" size="198,59" group="n12_r9ri">
     <component id="n7_r9ri" name="btnAddFriend" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="787,95" size="198,59" group="n12_r9ri">
-      <gearDisplay controller="c1" pages="0,2"/>
+      <gearDisplay controller="c1" pages="0,1,3"/>
       <Button icon="ui://iyz778gkr9ri129"/>
       <Button icon="ui://iyz778gkr9ri129"/>
     </component>
     </component>
     <component id="n8_r9ri" name="btnDelete" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="787,95" size="198,59" group="n12_r9ri">
     <component id="n8_r9ri" name="btnDelete" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="787,95" size="198,59" group="n12_r9ri">
-      <gearDisplay controller="c1" pages="3"/>
+      <gearDisplay controller="c1" pages="5"/>
       <Button icon="ui://iyz778gkr9ri12a"/>
       <Button icon="ui://iyz778gkr9ri12a"/>
     </component>
     </component>
     <group id="n12_r9ri" name="n12" xy="165,35" size="902,195"/>
     <group id="n12_r9ri" name="n12" xy="165,35" size="902,195"/>

+ 8 - 6
FGUIProject/assets/poem/componentsGallery/ComNormal.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1619" overflow="hidden" opaque="false">
 <component size="1080,1619" overflow="hidden" opaque="false">
-  <controller name="c1" pages="0,,1,,2," selected="0"/>
+  <controller name="c1" pages="0,,1,,2," selected="2"/>
   <displayList>
   <displayList>
     <component id="n11_r9ri" name="btnShop" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="900,56" size="180,113">
     <component id="n11_r9ri" name="btnShop" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="900,56" size="180,113">
       <gearDisplay controller="c1" pages="0,1"/>
       <gearDisplay controller="c1" pages="0,1"/>
@@ -12,13 +12,13 @@
     </component>
     </component>
     <image id="n5_r9ri" name="n5" src="uyuxzx" fileName="imagesPhoto/xc_xzdik.png" xy="165,206" size="750,76" group="n8_r9ri"/>
     <image id="n5_r9ri" name="n5" src="uyuxzx" fileName="imagesPhoto/xc_xzdik.png" xy="165,206" size="750,76" group="n8_r9ri"/>
     <component id="n6_r9ri" name="btnTab0" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="163,204" group="n8_r9ri">
     <component id="n6_r9ri" name="btnTab0" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="163,204" group="n8_r9ri">
-      <Button checked="true" icon="ui://iyz778gkr9ri11p" selectedIcon="ui://iyz778gkr9ri11h" controller="c1" page="0"/>
+      <Button icon="ui://iyz778gkr9ri11p" selectedIcon="ui://iyz778gkr9ri11h" controller="c1" page="0"/>
     </component>
     </component>
     <component id="n7_r9ri" name="btnTab1" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="414,204" group="n8_r9ri">
     <component id="n7_r9ri" name="btnTab1" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="414,204" group="n8_r9ri">
       <Button icon="ui://iyz778gkr9ri11o" selectedIcon="ui://iyz778gkr9ri11g" controller="c1" page="1"/>
       <Button icon="ui://iyz778gkr9ri11o" selectedIcon="ui://iyz778gkr9ri11g" controller="c1" page="1"/>
     </component>
     </component>
     <component id="n9_r9ri" name="btnTab2" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="665,204" group="n8_r9ri">
     <component id="n9_r9ri" name="btnTab2" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="665,204" group="n8_r9ri">
-      <Button icon="ui://iyz778gkr9ri11n" selectedIcon="ui://iyz778gkr9ri11f" controller="c1" page="2"/>
+      <Button checked="true" icon="ui://iyz778gkr9ri11n" selectedIcon="ui://iyz778gkr9ri11f" controller="c1" page="2"/>
     </component>
     </component>
     <group id="n8_r9ri" name="grpTab" xy="163,204" size="753,83"/>
     <group id="n8_r9ri" name="grpTab" xy="163,204" size="753,83"/>
     <image id="n25_r9ri" name="n25" src="r9ri11e" fileName="imagesGallery/hl_xzbtzt.png" xy="310,309" group="n26_r9ri"/>
     <image id="n25_r9ri" name="n25" src="r9ri11e" fileName="imagesGallery/hl_xzbtzt.png" xy="310,309" group="n26_r9ri"/>
@@ -53,9 +53,11 @@
       <gearDisplay controller="c1" pages="0"/>
       <gearDisplay controller="c1" pages="0"/>
       <ComboBox visibleItemCount="10"/>
       <ComboBox visibleItemCount="10"/>
     </component>
     </component>
-    <text id="n27_r9ri" name="txtTime" xy="266,430" size="317,39" group="n34_r9ri" fontSize="28" color="#b9a073" text="截止日期:11/01至11/2 "/>
-    <text id="n33_r9ri" name="txtRewardCount" xy="603,430" size="211,39" group="n34_r9ri" fontSize="28" color="#b9a073" text="奖励次数:10/30"/>
-    <group id="n34_r9ri" name="n34" xy="266,430" size="548,39" advanced="true" layout="hz" colGap="20" excludeInvisibles="true">
+    <text id="n27_r9ri" name="txtTime" xy="381,430" size="317,39" group="n34_r9ri" fontSize="28" color="#b9a073" text="截止日期:11/01至11/2 "/>
+    <text id="n33_r9ri" name="txtRewardCount" xy="718,430" size="211,39" group="n34_r9ri" fontSize="28" color="#b9a073" text="奖励次数:10/30">
+      <gearDisplay controller="c1" pages="0,1"/>
+    </text>
+    <group id="n34_r9ri" name="n34" xy="381,430" size="317,39" advanced="true" layout="hz" colGap="20" excludeInvisibles="true">
       <relation target="" sidePair="center-center"/>
       <relation target="" sidePair="center-center"/>
     </group>
     </group>
     <text id="n29_r9ri" name="txtRank" xy="830,427" pivot="1,0" size="169,41" fontSize="30" color="#c58383" text="我的排名:20">
     <text id="n29_r9ri" name="txtRank" xy="830,427" pivot="1,0" size="169,41" fontSize="30" color="#c58383" text="我的排名:20">

+ 36 - 0
GameClient/Assets/Game/HotUpdate/Data/PoemGalleryDataManager.cs

@@ -58,6 +58,23 @@ namespace GFGGame
         }
         }
 
 
 
 
+        private long _voteCount = 0;
+        /// <summary>
+        /// 我的最高排行
+        /// </summary>
+        public long VoteCount
+        {
+            get
+            {
+                return _voteCount;
+            }
+            set
+            {
+                _voteCount = value;
+            }
+        }
+
+
         /// <summary>
         /// <summary>
         /// 推荐数据
         /// 推荐数据
         /// </summary>
         /// </summary>
@@ -97,5 +114,24 @@ namespace GFGGame
             RankDatas.Clear();
             RankDatas.Clear();
         }
         }
 
 
+        public string GetThemeTime()
+        {
+            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); ;
+            return string.Format("截止日期:{0}至{1}", strStartTime, strEndTime);
+        }
     }
     }
 }
 }

+ 77 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryPreviewView.cs

@@ -8,7 +8,8 @@ namespace GFGGame
     public class PoemGalleryPreviewView : BaseWindow
     public class PoemGalleryPreviewView : BaseWindow
     {
     {
         private UI_PoemGalleryPreviewUI _ui;
         private UI_PoemGalleryPreviewUI _ui;
-
+        private int _sortType = 0;//由 GallerySortType 定义
+        private PoemGalleryData _galleryData;
         public override void Dispose()
         public override void Dispose()
         {
         {
             if (_ui != null)
             if (_ui != null)
@@ -27,6 +28,12 @@ namespace GFGGame
             this.viewCom = _ui.target;
             this.viewCom = _ui.target;
             isfullScreen = true;
             isfullScreen = true;
             // _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
             // _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
+
+            _ui.m_btnback.onClick.Add(OnBtnBackClick);
+            _ui.m_btnCollect.onClick.Add(OnBtnCollectClick);
+            _ui.m_btnVote.onClick.Add(OnBtnVoteClick);
+            _ui.m_btnAddFriend.onClick.Add(OnBtnAddFriendClick);
+            _ui.m_btnDelete.onClick.Add(OnBtnDeleteClick);
         }
         }
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
@@ -36,7 +43,24 @@ namespace GFGGame
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
+            _sortType = (int)(this.viewData as object[])[0];
+            _galleryData = (this.viewData as object[])[1] as PoemGalleryData;
+
+        }
 
 
+        private void UpdateView()
+        {
+            _ui.m_c1.selectedIndex = _sortType;
+            _ui.m_txtName.text = _galleryData.AuthorName;
+
+            string themeTime = PoemGalleryDataManager.Instance.GetThemeTime();
+            GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
+            string themeName = themeCfg.theme;
+            _ui.m_txtTheme.text = string.Format("{0} {1}", themeTime, themeName);// PoemGalleryDataManager.Instance.GetThemeTime();
+            _ui.m_btnCollect.selected = _galleryData.CollectOrNot;
+            _ui.m_btnCollect.title = _galleryData.CollectCount.ToString();
+            _ui.m_btnVote.selected = _galleryData.VoteOrNot;
+            _ui.m_btnVote.title = _galleryData.VoteCount.ToString();
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -50,5 +74,57 @@ namespace GFGGame
             base.RemoveEventListener();
             base.RemoveEventListener();
 
 
         }
         }
+
+        private void OnBtnBackClick()
+        {
+            ViewManager.GoBackFrom(typeof(PoemGalleryPreviewView).FullName);
+        }
+
+        private async void OnBtnCollectClick(EventContext context)
+        {
+            if (_galleryData.CollectOrNot)
+            {
+                bool result = await PoemGallerySProxy.ReqCancelCollecteGalleryWorks(_galleryData.WorkId);
+                if (result)
+                {
+                    _galleryData.CollectOrNot = false;
+                    _galleryData.CollectCount = _galleryData.CollectCount - 1;
+                    UpdateView();
+                }
+            }
+            else
+            {
+                bool result = await PoemGallerySProxy.ReqCollecteGalleryWorks(_galleryData.WorkId);
+                if (result)
+                {
+                    _galleryData.CollectOrNot = true;
+                    _galleryData.CollectCount = _galleryData.CollectCount + 1;
+                    UpdateView();
+                }
+            }
+
+        }
+
+        private async void OnBtnVoteClick(EventContext context)
+        {
+            if (_galleryData.VoteOrNot) return;
+            bool result = await PoemGallerySProxy.ReqVoteGalleryWorks(_galleryData.WorkId);
+            if (result)
+            {
+                _galleryData.VoteOrNot = true;
+                _galleryData.CollectCount = _galleryData.CollectCount + 1;
+                UpdateView();
+            }
+        }
+
+        private void OnBtnAddFriendClick(EventContext context)
+        {
+
+        }
+
+        private void OnBtnDeleteClick(EventContext context)
+        {
+
+        }
     }
     }
 }
 }

+ 20 - 18
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryView.cs

@@ -314,24 +314,25 @@ namespace GFGGame
         {
         {
             GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
             GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
             _ui.m_comNormal.m_txtTheme.text = string.Format("本期主题:{0}", themeCfg.theme);
             _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);
             _ui.m_comNormal.m_txtRank.text = string.Format("我的排名:{0}", PoemGalleryDataManager.Instance.MyRank);
+            _ui.m_comNormal.m_txtRewardCount.text = string.Format("奖励次数:{0}/{1}", PoemGalleryDataManager.Instance.VoteCount, GalleryRewardCfgArray.Instance.dataArray.Length);
+            // 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 = PoemGalleryDataManager.Instance.GetThemeTime();
         }
         }
         private void RenderListItem(int index, GObject obj)
         private void RenderListItem(int index, GObject obj)
         {
         {
@@ -380,7 +381,8 @@ namespace GFGGame
         {
         {
             GObject obj = context.data as GObject;
             GObject obj = context.data as GObject;
             PoemGalleryData data = obj.data as PoemGalleryData;
             PoemGalleryData data = obj.data as PoemGalleryData;
-
+            object[] gobackParamDatas = new object[] { _tabIndex, _subtabIndex };
+            ViewManager.Show<PoemGalleryPreviewView>(new object[] { _sortType, data }, new object[] { typeof(PoemGalleryView).FullName, gobackParamDatas });
         }
         }
 
 
         private void OnBtnCollectClick(EventContext context)
         private void OnBtnCollectClick(EventContext context)

BIN
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes