zhaoyang 2 年之前
父節點
當前提交
57b1802fec
共有 24 個文件被更改,包括 353 次插入67 次删除
  1. 4 1
      FGUIProject/assets/Common/AlertUI.xml
  2. 6 6
      FGUIProject/assets/DressUp/PhotographSaveUI.xml
  3. 5 5
      FGUIProject/assets/poem/PoemPhotoUI.xml
  4. 0 2
      FGUIProject/assets/poem/components/ListPhotoItem.xml
  5. 1 1
      FGUIProject/assets/poem/components/ListPhotoPreviewItem.xml
  6. 8 0
      GameClient/Assets/Game/HotUpdate/Data/PoemPhotoDataManager.cs
  7. 8 0
      GameClient/Assets/Game/HotUpdate/Data/VO/PoemPhotoData.cs
  8. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Common/UI_AlertUI.cs
  9. 0 6
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ListPhotoItem.cs
  10. 4 4
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ListPhotoPreviewItem.cs
  11. 62 3
      GameClient/Assets/Game/HotUpdate/ServerProxy/PoemPhotoSProxy.cs
  12. 11 0
      GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs
  13. 2 1
      GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertSystem.cs
  14. 2 1
      GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertUI.cs
  15. 27 1
      GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertWindow.cs
  16. 1 1
      GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs
  17. 74 4
      GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoPreView.cs
  18. 20 3
      GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoShareView.cs
  19. 114 27
      GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs
  20. 1 1
      GameClient/Assets/Game/HotUpdate/Views/Poem/PoemView.cs
  21. 二進制
      GameClient/Assets/ResIn/UI/Common/Common_fui.bytes
  22. 二進制
      GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes
  23. 二進制
      GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes
  24. 二進制
      GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes

+ 4 - 1
FGUIProject/assets/Common/AlertUI.xml

@@ -7,7 +7,10 @@
     <image id="n0_l55o" name="bg" src="lwri5u" fileName="imagesExport/hc_kuang_6.png" xy="72,766" size="936,388" group="n8_a8jv">
       <relation target="n5_l55o" sidePair="height-height"/>
     </image>
-    <text id="n5_l55o" name="txtContent" xy="183,853" size="714,49" group="n8_a8jv" fontSize="36" color="#876e54" align="center" vAlign="middle" autoSize="height" text=""/>
+    <text id="n5_l55o" name="txtContent" xy="183,853" size="714,49" group="n8_a8jv" fontSize="36" color="#876e54" align="center" vAlign="middle" autoSize="height" autoClearText="true" text="解锁后的照片可随意删除"/>
+    <text id="n9_uyux" name="txtTips" xy="183,912" size="714,42" group="n8_a8jv" fontSize="30" color="#876e54" align="center" vAlign="middle" autoSize="height" autoClearText="true" text="(解锁后的照片可随意删除)">
+      <relation target="n5_l55o" sidePair="top-bottom"/>
+    </text>
     <component id="n3_l55o" name="btnLeft" src="q08x6" fileName="components/Button1.xml" xy="126,1004" group="n8_a8jv">
       <relation target="n0_l55o" sidePair="bottom-bottom"/>
       <Button title="取消"/>

+ 6 - 6
FGUIProject/assets/DressUp/PhotographSaveUI.xml

@@ -13,23 +13,23 @@
     <component id="n8_i3ix" name="btnClose" src="ih753n" fileName="components/Button5.xml" xy="954,56">
       <relation target="n3_i3ix" sidePair="right-right,top-top"/>
     </component>
-    <component id="n4_i3ix" name="btnSave" src="i3ix5a" fileName="components/Button12.xml" xy="629,1654" size="140,116" group="n9_uyux">
+    <component id="n4_i3ix" name="btnSave" src="i3ix5a" fileName="components/Button12.xml" xy="647,1654" size="140,116" group="n9_uyux">
       <Button icon="ui://mbo439wbuyuxdq"/>
     </component>
-    <component id="n5_i3ix" name="btnShare" src="i3ix5a" fileName="components/Button12.xml" xy="751,1654" group="n9_uyux" visible="false">
+    <component id="n5_i3ix" name="btnShare" src="i3ix5a" fileName="components/Button12.xml" xy="769,1654" group="n9_uyux" visible="false">
       <Button icon="ui://mbo439wbxmtl4v"/>
     </component>
-    <component id="n6_i3ix" name="btnShareWX" src="i3ix5a" fileName="components/Button12.xml" xy="873,1654" group="n9_uyux" visible="false">
+    <component id="n6_i3ix" name="btnShareWX" src="i3ix5a" fileName="components/Button12.xml" xy="891,1654" group="n9_uyux" visible="false">
       <Button icon="ui://mbo439wbxmtl4w"/>
     </component>
-    <component id="n7_i3ix" name="btnShareWB" src="i3ix5a" fileName="components/Button12.xml" xy="995,1654" group="n9_uyux" visible="false">
+    <component id="n7_i3ix" name="btnShareWB" src="i3ix5a" fileName="components/Button12.xml" xy="1013,1654" group="n9_uyux" visible="false">
       <Button icon="ui://mbo439wbxmtl4u"/>
     </component>
     <component id="n11_uyux" name="btnSavePhoto" src="i3ix5a" fileName="components/Button12.xml" xy="807,1654" size="141,116" group="n9_uyux">
       <Button icon="ui://mbo439wbuyuxdp"/>
     </component>
-    <group id="n9_uyux" name="n9" xy="629,1654" size="319,116" advanced="true" layout="hz" colGap="38" excludeInvisibles="true">
-      <relation target="" sidePair="right-right,bottom-bottom"/>
+    <group id="n9_uyux" name="n9" xy="647,1654" size="301,116" advanced="true" layout="hz" colGap="20" excludeInvisibles="true">
+      <relation target="n3_i3ix" sidePair="right-right,bottom-bottom"/>
     </group>
   </displayList>
 </component>

+ 5 - 5
FGUIProject/assets/poem/PoemPhotoUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1," selected="0"/>
+  <controller name="c1" pages="0,,1," selected="1"/>
   <controller name="c2" pages="0,,1," selected="0"/>
   <displayList>
     <loader id="n0_v482" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,2400" fill="scaleMatchWidth">
@@ -8,13 +8,13 @@
     </loader>
     <image id="n13_uyux" name="n13" src="uyuxzx" fileName="photImages/xc_xzdik.png" xy="265,173" group="n14_uyux"/>
     <component id="n11_11rzz" name="btnTab0" src="11rzzf" fileName="components/Button6.xml" xy="263,171" group="n14_uyux">
-      <Button checked="true" icon="ui://iyz778gkuyux108" selectedIcon="ui://iyz778gkuyuxzv" controller="c1" page="0"/>
+      <Button icon="ui://iyz778gkuyux108" selectedIcon="ui://iyz778gkuyuxzv" controller="c1" page="0"/>
     </component>
     <component id="n12_11rzz" name="btnTab1" src="11rzzf" fileName="components/Button6.xml" xy="536,171" group="n14_uyux">
-      <Button icon="ui://iyz778gkuyux109" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="1"/>
+      <Button checked="true" icon="ui://iyz778gkuyux109" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="1"/>
     </component>
     <group id="n14_uyux" name="n14" xy="263,171" size="553,82"/>
-    <list id="n8_v482" name="list" xy="0,294" size="1080,1478" layout="flow_hz" overflow="scroll" lineGap="16" colGap="7" defaultItem="ui://iyz778gkv4828" align="center">
+    <list id="n8_v482" name="list" xy="0,294" size="1080,1478" layout="flow_hz" overflow="scroll" lineGap="16" colGap="15" defaultItem="ui://iyz778gkv4828" align="center">
       <relation target="" sidePair="bottomext-bottom"/>
       <item/>
       <item/>
@@ -31,7 +31,7 @@
     <component id="n10_v482" name="btnDelete" src="v4829" fileName="components/Button3.xml" xy="590,1807" group="n17_uyux">
       <gearDisplay controller="c2" pages="0"/>
     </component>
-    <text id="n9_v482" name="txtCount" xy="412,1820" pivot="0.5,0" size="116,62" group="n17_uyux" fontSize="46" color="#b5926a" align="center" text="0/50">
+    <text id="n9_v482" name="txtCount" xy="412,1820" pivot="0.5,0" size="116,61" group="n17_uyux" fontSize="46" color="#b5926a" align="center" text="0/50">
       <gearDisplay controller="c2" pages="0"/>
     </text>
     <group id="n17_uyux" name="n17" xy="0,1775" size="1080,145" advanced="true">

+ 0 - 2
FGUIProject/assets/poem/components/ListPhotoItem.xml

@@ -1,7 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="493,740">
-  <controller name="c1" pages="0,,1," selected="0"/>
-  <controller name="c2" pages="0,,1," selected="0"/>
   <displayList>
     <component id="n4_v482" name="comIcon" src="uyux101" fileName="components/ComIcon.xml" xy="14,8"/>
     <image id="n12_uyux" name="n12" src="uyuxzr" fileName="photImages/xc_kuangdi.png" xy="0,0"/>

+ 1 - 1
FGUIProject/assets/poem/components/ListPhotoPreviewItem.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1000,1065">
   <displayList>
-    <component id="n5_v482" name="loaPhoto" src="uyux105" fileName="components/ComPhoto.xml" xy="3,2"/>
+    <component id="n5_v482" name="comPhoto" src="uyux105" fileName="components/ComPhoto.xml" xy="3,2"/>
     <image id="n8_uyux" name="n8" src="uyux100" fileName="photImages/xc_dakuang.png" xy="0,0"/>
   </displayList>
 </component>

+ 8 - 0
GameClient/Assets/Game/HotUpdate/Data/PoemPhotoDataManager.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 using ET;
+using FairyGUI;
 using UnityEngine;
 
 namespace GFGGame
@@ -137,5 +138,12 @@ namespace GFGGame
             return photoInfos;
         }
 
+
+        public NTexture BytesToTexture2D(byte[] bytes)
+        {
+            Texture2D texture2D = new Texture2D(UnityEngine.Screen.width, UnityEngine.Screen.height);
+            texture2D.LoadImage(bytes);
+            return new NTexture(texture2D);
+        }
     }
 }

+ 8 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/PoemPhotoData.cs

@@ -39,6 +39,14 @@ namespace GFGGame
         /// </summary>
         public string PictureTempUrl;
 
+        /// <summary>
+        /// 图片来源 -- 值由 PictureSourceType 定义
+        /// </summary>
+        public string SourceType;
+
+
+        public byte[] Bytes;
+
 
     }
 }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Common/UI_AlertUI.cs

@@ -10,6 +10,7 @@ namespace UI.Common
         public GGraph m_graphBg;
         public GImage m_bg;
         public GTextField m_txtContent;
+        public GTextField m_txtTips;
         public GButton m_btnLeft;
         public GButton m_btnRight;
         public const string URL = "ui://mk0fwx0xl55o0";
@@ -62,6 +63,7 @@ namespace UI.Common
             m_graphBg = (GGraph)comp.GetChild("graphBg");
             m_bg = (GImage)comp.GetChild("bg");
             m_txtContent = (GTextField)comp.GetChild("txtContent");
+            m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_btnLeft = (GButton)comp.GetChild("btnLeft");
             m_btnRight = (GButton)comp.GetChild("btnRight");
         }
@@ -70,6 +72,7 @@ namespace UI.Common
             m_graphBg = null;
             m_bg = null;
             m_txtContent = null;
+            m_txtTips = null;
             m_btnLeft = null;
             m_btnRight = null;
             if(disposeTarget && target != null)

+ 0 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ListPhotoItem.cs

@@ -7,8 +7,6 @@ namespace UI.Poem
     public partial class UI_ListPhotoItem
     {
         public GComponent target;
-        public Controller m_c1;
-        public Controller m_c2;
         public UI_ComIcon m_comIcon;
         public UI_Button1 m_btnLock;
         public UI_Button2 m_btnUp;
@@ -61,8 +59,6 @@ namespace UI.Poem
 
         private void Init(GComponent comp)
         {
-            m_c1 = comp.GetController("c1");
-            m_c2 = comp.GetController("c2");
             m_comIcon = (UI_ComIcon)UI_ComIcon.Create(comp.GetChild("comIcon"));
             m_btnLock = (UI_Button1)UI_Button1.Create(comp.GetChild("btnLock"));
             m_btnUp = (UI_Button2)UI_Button2.Create(comp.GetChild("btnUp"));
@@ -71,8 +67,6 @@ namespace UI.Poem
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_c1 = null;
-            m_c2 = null;
             m_comIcon.Dispose();
             m_comIcon = null;
             m_btnLock.Dispose();

+ 4 - 4
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ListPhotoPreviewItem.cs

@@ -7,7 +7,7 @@ namespace UI.Poem
     public partial class UI_ListPhotoPreviewItem
     {
         public GComponent target;
-        public UI_ComPhoto m_loaPhoto;
+        public UI_ComPhoto m_comPhoto;
         public const string URL = "ui://iyz778gkv482b";
         public const string PACKAGE_NAME = "Poem";
         public const string RES_NAME = "ListPhotoPreviewItem";
@@ -55,12 +55,12 @@ namespace UI.Poem
 
         private void Init(GComponent comp)
         {
-            m_loaPhoto = (UI_ComPhoto)UI_ComPhoto.Create(comp.GetChild("loaPhoto"));
+            m_comPhoto = (UI_ComPhoto)UI_ComPhoto.Create(comp.GetChild("comPhoto"));
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_loaPhoto.Dispose();
-            m_loaPhoto = null;
+            m_comPhoto.Dispose();
+            m_comPhoto = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 62 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/PoemPhotoSProxy.cs

@@ -18,7 +18,36 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-
+                    for (int i = 0; i < response.PictureInfosA.Count; i++)
+                    {
+                        PoemPhotoData photoData = new PoemPhotoData();
+                        photoData.PictureId = response.PictureInfosA[i].PictureId;
+                        photoData.CreationTime = response.PictureInfosA[i].CreationTime;
+                        photoData.ToppingTime = response.PictureInfosA[i].ToppingTime;
+                        photoData.ToppingStatus = response.PictureInfosA[i].ToppingStatus;
+                        photoData.LockingStatus = response.PictureInfosA[i].LockingStatus;
+                        photoData.PictureName = response.PictureInfosA[i].PictureName;
+                        photoData.PictureTempUrl = response.PictureInfosA[i].PictureTempUrl;
+                        byte[] bytes = DownloadFile(response.PictureInfosA[i].PictureTempUrl);
+                        photoData.Bytes = bytes;
+
+                        PoemPhotoDataManager.Instance.Add(photoData, (int)PictureSourceType.PersonalAlbum);
+                    }
+                    for (int i = 0; i < response.PictureInfosB.Count; i++)
+                    {
+                        PoemPhotoData photoData = new PoemPhotoData();
+                        photoData.PictureId = response.PictureInfosA[i].PictureId;
+                        photoData.CreationTime = response.PictureInfosA[i].CreationTime;
+                        photoData.ToppingTime = response.PictureInfosA[i].ToppingTime;
+                        photoData.ToppingStatus = response.PictureInfosA[i].ToppingStatus;
+                        photoData.LockingStatus = response.PictureInfosA[i].LockingStatus;
+                        photoData.PictureName = response.PictureInfosA[i].PictureName;
+                        photoData.PictureTempUrl = response.PictureInfosA[i].PictureTempUrl;
+                        byte[] bytes = DownloadFile(response.PictureInfosA[i].PictureTempUrl);
+                        photoData.Bytes = bytes;
+
+                        PoemPhotoDataManager.Instance.Add(photoData, (int)PictureSourceType.WanShuiQianShan);
+                    }
                     return true;
                 }
             }
@@ -39,7 +68,34 @@ namespace GFGGame
             }
             return null;
         }
+        public static byte[] DownloadFile(string URL)
+        {
+            try
+            {
+                HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
+                webRequest.Method = "GET";
+                HttpWebResponse webResponse = webRequest.GetResponse() as HttpWebResponse;
+                System.IO.Stream st = webResponse.GetResponseStream();
+
+                byte[] bytes = new byte[st.Length];
+                st.Read(bytes, 0, bytes.Length);
+                // 设置当前流的位置为流的开始
+                st.Seek(0, SeekOrigin.Begin);
+
+                st.Close();
+                webResponse.Close();
+                webRequest.Abort();
+                return bytes;
+            }
+            catch (WebException ex)
+            {
+                //  webResponse = ex.Response as HttpWebResponse;
+                ET.Log.Debug(ex.Response.ToString());
+                return null;
+            }
+
 
+        }
         //将图片上传到华为云
         public static string PushToHWCloud(string signUrl, byte[] buffer)
         {
@@ -84,6 +140,9 @@ namespace GFGGame
                     photoData.LockingStatus = response.PictureInfo.LockingStatus;
                     photoData.PictureName = response.PictureInfo.PictureName;
                     photoData.PictureTempUrl = response.PictureInfo.PictureTempUrl;
+                    byte[] bytes = DownloadFile(photoData.PictureTempUrl);
+                    photoData.Bytes = bytes;
+
                     PoemPhotoDataManager.Instance.Add(photoData, sourceType);
                     EventAgent.DispatchEvent(ConstMessage.POEM_PHOTO_INFOS_CHANGE);
                     return true;
@@ -120,7 +179,7 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    PoemPhotoDataManager.Instance.ChangeLockingState(pictureId, state, sourceType);
+                    PoemPhotoDataManager.Instance.ChangeLockingState(response.PictureId, response.Status, sourceType);
                     EventAgent.DispatchEvent(ConstMessage.POEM_PHOTO_INFOS_CHANGE);
 
                     return true;
@@ -139,7 +198,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
 
-                    PoemPhotoDataManager.Instance.ChangeLockingState(pictureId, state, sourceType);
+                    PoemPhotoDataManager.Instance.ChangeLockingState(response.PictureId, response.Status, sourceType);
                     EventAgent.DispatchEvent(ConstMessage.POEM_PHOTO_INFOS_CHANGE);
 
                     return true;

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs

@@ -64,5 +64,16 @@ namespace GFGGame
 
             return str;
         }
+        /// <summary>
+        /// 将时间戳转换成yyyy-mm-dd hh-mm-ss格式
+        /// </summary>
+        /// <param name="timeSec"></param>
+        public static string FormattingTime1(long timeSec)
+        {
+            DateTime date = TimeInfo.Instance.ToDateTime(timeSec * 1000);
+            string str = date.ToString("yyyy-MM-dd hh-mm-ss");
+
+            return str;
+        }
     }
 }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertSystem.cs

@@ -16,7 +16,7 @@ namespace GFGGame
     {
         private static AlertWindow _alertWindow;
 
-        public static IAlert Show(string message)
+        public static IAlert Show(string message, string tips = "")
         {
             if (_alertWindow == null)
             {
@@ -27,6 +27,7 @@ namespace GFGGame
             _alertWindow.viewName = "AlertSystem";
             _alertWindow.SetLayer(ConstViewLayer.ALERT);
             _alertWindow.SetMessage(message);
+            _alertWindow.SetTips(tips);
             _alertWindow.Show();
 
             return _alertWindow;

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertUI.cs

@@ -16,7 +16,7 @@ namespace GFGGame
     {
         private static AlertWindow _alertWindow;
 
-        public static IAlert Show(string message)
+        public static IAlert Show(string message, string tips = "")
         {
             if (_alertWindow == null)
             {
@@ -26,6 +26,7 @@ namespace GFGGame
             _alertWindow.viewName = "AlertUI";
             _alertWindow.SetLayer(ConstViewLayer.TOP);
             _alertWindow.SetMessage(message);
+            _alertWindow.SetTips(tips);
             _alertWindow.Show();
 
             return _alertWindow;

+ 27 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertWindow.cs

@@ -12,6 +12,7 @@ namespace GFGGame
         private float m_xLeftButton = 0;
         private float m_xRightButton = 0;
         private string m_content = "";
+        private string m_tips = "";
         private string m_textLeft = "取消";
         private string m_textRight = "确认";
         private bool m_isShowLeftButton = false;
@@ -50,6 +51,7 @@ namespace GFGGame
             m_xRightButton = _ui.m_btnRight.x;
             // this.sortingOrder = ConstSortingOrder.FLOATING_PROMPT;
             this.SetMessage(m_content);
+            this.SetTips(m_tips);
             this.SetLeftButton(m_isShowLeftButton, m_textLeft);
             this.SetRightButton(m_isShowRightButton, m_textRight);
 
@@ -124,6 +126,7 @@ namespace GFGGame
         public IAlert Reset()
         {
             m_content = "";
+            m_tips = "";
             m_textLeft = "取消";
             m_textRight = "确认";
             m_leftButtonCallback = null;
@@ -138,6 +141,10 @@ namespace GFGGame
             }
             if (this._ui != null)
             {
+                this._ui.m_txtTips.text = m_tips;
+            }
+            if (this._ui != null)
+            {
                 this._ui.m_btnLeft.text = m_textLeft;
                 this._ui.m_btnLeft.visible = m_isShowLeftButton;
             }
@@ -169,6 +176,25 @@ namespace GFGGame
             }
             return this;
         }
+        public IAlert SetTips(string message)
+        {
+            this.m_tips = message;
+            if (this._ui != null)
+            {
+                this._ui.m_txtTips.text = m_tips;
+                // Debug.Log("alert height=" + this._ui.m_txtContent.textHeight + " size=" + this._ui.m_txtContent.textFormat.size);
+                if (this._ui.m_txtTips.textHeight > this._ui.m_txtTips.textFormat.size * 2)
+                {
+                    this._ui.m_txtTips.align = AlignType.Left;
+                }
+                else
+                {
+                    this._ui.m_txtTips.align = AlignType.Center;
+                }
+                this._ui.target.Center();
+            }
+            return this;
+        }
 
         public IAlert SetLeftButton(bool isShow, string textLeft = "取消", AlertCallback callback = null)
         {
@@ -223,7 +249,7 @@ namespace GFGGame
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
-            if(GameGlobal.DataInited)
+            if (GameGlobal.DataInited)
             {
                 GuideController.TryGuide(_ui.m_btnRight, ConstGuideId.LUCKY_BOX, 4, "点击确定。");
                 GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX, 4);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -536,7 +536,7 @@ namespace GFGGame
             || (ActivityDataManager.Instance.dailyLoginId >= 7 && ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.GOT));
             _ui.m_btnField.target.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(FieldView).Name, false);
             _ui.m_btnHuanZhuang.target.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(DressUpView).Name, false);
-            _ui.m_btnStudio.target.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(PoemView).Name, false);
+            _ui.m_btnPoem.target.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(PoemView).Name, false);
 
             _btnGongGao.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(NoticeView).Name, false);
             _btnHaoYou.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(FriendView).Name, false);

+ 74 - 4
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoPreView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using FairyGUI;
 using UI.Poem;
@@ -8,7 +9,9 @@ namespace GFGGame
     public class PoemPhotoPreView : BaseWindow
     {
         private UI_PoemPhotoPreviewUI _ui;
+        private List<PoemPhotoData> _photoInfos;
         private int _curIndex = 0;
+        private int _sourceType = 0;
 
         public override void Dispose()
         {
@@ -47,9 +50,21 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _curIndex = (int)this.viewData;
-            _ui.m_list.numItems = 0;
-            _ui.m_list.ScrollToView(_curIndex);
+            _curIndex = (int)(this.viewData as object[])[0];
+            _sourceType = (int)(this.viewData as object[])[1];
+
+            if (_sourceType == (int)PictureSourceType.PersonalAlbum)
+            {
+                _photoInfos = PoemPhotoDataManager.Instance.PersonalPhotoInfos;
+            }
+            else
+            {
+                _photoInfos = PoemPhotoDataManager.Instance.WsqsPhotoInfos;
+            }
+
+            _ui.m_list.numItems = _photoInfos.Count;
+            if (_photoInfos.Count > 0) _ui.m_list.ScrollToView(_curIndex);
+            UpdateView();
         }
 
         protected override void OnHide()
@@ -73,11 +88,28 @@ namespace GFGGame
         {
             _ui.m_btnLeft.enabled = _curIndex > 0;
             _ui.m_btnRight.enabled = _curIndex < _ui.m_list.numItems - 1;
+
+            _ui.m_txtTime.text = TimeUtil.FormattingTime1(_photoInfos[_curIndex].CreationTime);
+
+            if (_ui.m_btnLock.target.data == null)
+            {
+                _ui.m_btnLock.target.onClick.Add(OnBtnLockClick);
+            }
+            _ui.m_btnLock.target.data = _curIndex;
+
+            if (_ui.m_btnUp.target.data == null)
+            {
+                _ui.m_btnUp.target.onClick.Add(OnBtnUpClick);
+            }
+            _ui.m_btnUp.target.data = _curIndex;
+
         }
         private void RenderListItem(int index, GObject obj)
         {
             UI_ListPhotoPreviewItem item = UI_ListPhotoPreviewItem.Proxy(obj);
 
+            item.m_comPhoto.m_loaPhoto.texture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+
             UI_ListPhotoPreviewItem.ProxyEnd();
         }
 
@@ -87,25 +119,63 @@ namespace GFGGame
             _curIndex = Mathf.Max(0, _curIndex);
             UpdateView();
         }
+
         private void OnBtnRightClick()
         {
             _curIndex++;
             _curIndex = Mathf.Min(_ui.m_list.numItems - 1, _curIndex);
             UpdateView();
         }
+
         private void OnBtnLockClick()
         {
+            PoemPhotoData photoData = _photoInfos[_curIndex];
+            if (photoData.LockingStatus == false)
+            {
+                AlertUI.Show("是否确认锁定此照片?", "(锁住的照片无法被删除)")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeLockingState(photoData.PictureId, true, _sourceType).Coroutine();
 
+               });
+            }
+            else
+            {
+                AlertUI.Show("是否确认解锁此照片?", "(解锁后的照片可随意删除)")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeLockingState(photoData.PictureId, false, _sourceType).Coroutine();
 
+               });
+            }
         }
+
         private void OnBtnUpClick()
         {
+            PoemPhotoData photoData = _photoInfos[_curIndex];
+            if (photoData.ToppingStatus == false)
+            {
+                AlertUI.Show("是否确认置顶此照片?")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeToppingState(photoData.PictureId, true, _sourceType).Coroutine();
 
+               });
+            }
+            else
+            {
+                AlertUI.Show("是否确认取消置顶此照片?")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeToppingState(photoData.PictureId, false, _sourceType).Coroutine();
 
+               });
+            }
         }
+
         private void OnBtnShareClick()
         {
-            ViewManager.Show<PoemPhotoShareView>(_curIndex, new object[] { typeof(PoemPhotoPreView).FullName, _curIndex });
+            ViewManager.Show<PoemPhotoShareView>(new object[] { _curIndex, _sourceType }, new object[] { typeof(PoemPhotoPreView).FullName, _curIndex });
         }
     }
 }

+ 20 - 3
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoShareView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using FairyGUI;
 using UI.Poem;
@@ -8,6 +9,9 @@ namespace GFGGame
     public class PoemPhotoShareView : BaseWindow
     {
         private UI_PoemPhotoShareUI _ui;
+        private List<PoemPhotoData> _photoInfos;
+        private int _curIndex = 0;
+        private int _sourceType = 0;
 
         public override void Dispose()
         {
@@ -26,7 +30,7 @@ namespace GFGGame
             _ui = UI_PoemPhotoShareUI.Create();
             this.viewCom = _ui.target;
             isfullScreen = true;
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("xc_bjbj");
 
             _ui.m_btnback.onClick.Add(OnBtnBackClick);
             _ui.m_btnSave.onClick.Add(OnBtnSaveClick);
@@ -41,7 +45,18 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            _curIndex = (int)(this.viewData as object[])[0];
+            _sourceType = (int)(this.viewData as object[])[1];
 
+            if (_sourceType == (int)PictureSourceType.PersonalAlbum)
+            {
+                _photoInfos = PoemPhotoDataManager.Instance.PersonalPhotoInfos;
+            }
+            else
+            {
+                _photoInfos = PoemPhotoDataManager.Instance.WsqsPhotoInfos;
+            }
+            _ui.m_loaBg.texture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[_curIndex].Bytes);
         }
 
         protected override void OnHide()
@@ -61,9 +76,11 @@ namespace GFGGame
         }
         private void OnBtnSaveClick()
         {
-            // Texture2D tex = this.viewData as Texture2D;
 
-            // PoemPhotoDataManager.Instance.SavePicturoToLocal(tex);
+            byte[] bytes = _photoInfos[_curIndex].Bytes;
+            string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
+
+            PhotographDataManager.Instance.SavePicturoToLocal(bytes, fileName);
         }
         private void OnBtnShareClick()
         {

+ 114 - 27
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

@@ -9,9 +9,10 @@ namespace GFGGame
     public class PoemPhotoView : BaseWindow
     {
         private UI_PoemPhotoUI _ui;
-        private List<int> _listDelete = new List<int>();
+        private List<long> _listDelete = new List<long>();
+        private List<PoemPhotoData> _photoInfos;
+        private int _sourceType = 0;
 
-        private bool _deleting = false;//是否删除状态
 
         public override void Dispose()
         {
@@ -30,13 +31,14 @@ namespace GFGGame
             _ui = UI_PoemPhotoUI.Create();
             this.viewCom = _ui.target;
             isfullScreen = true;
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("xc_bjbj");
 
             _ui.m_list.SetVirtual();
             _ui.m_list.itemRenderer = RenderListItem;
 
             _ui.m_btnback.onClick.Add(OnBtnBackClick);
             _ui.m_btnDelete.onClick.Add(OnBtnDeleteClick);
+            _ui.m_btnConfirmDelete.target.onClick.Add(OnBtnConfirmDeleteClick);
             _ui.m_c1.onChanged.Add(OnBtnTabChange);
 
 
@@ -44,6 +46,7 @@ namespace GFGGame
         protected override void AddEventListener()
         {
             base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.POEM_PHOTO_INFOS_CHANGE, OnBtnTabChange);
 
         }
         protected override void OnShown()
@@ -55,75 +58,118 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
-            _listDelete.Clear();
         }
 
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.POEM_PHOTO_INFOS_CHANGE, OnBtnTabChange);
 
         }
         private void OnBtnBackClick()
         {
-            ViewManager.GoBackFrom(typeof(PoemPhotoView).FullName);
-        }
+            if (_ui.m_c2.selectedIndex == 1)
+            {
+                _ui.m_c2.selectedIndex = 0;
+            }
+            else
+            {
+                ViewManager.GoBackFrom(typeof(PoemPhotoView).FullName);
+                if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
+                _ui.m_c1.selectedIndex = 0;
+            }
+            _ui.m_c2.selectedIndex = 0;
+            _listDelete.Clear();
 
+        }
         private void OnBtnDeleteClick()
         {
-
+            if (_ui.m_list.numItems == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("暂无照片可删除");
+                return;
+            }
+            _ui.m_c2.selectedIndex = 1;
         }
+        private void OnBtnConfirmDeleteClick()
+        {
+            AlertUI.Show("删除后的照片无法恢复,是否确认删除?")
+            .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+            {
+                PoemPhotoSProxy.ReqRemovedPhoto(_listDelete, _sourceType).Coroutine();
+            });
+        }
+
         private void OnBtnTabChange()
         {
-            _deleting = false;
+            _ui.m_c2.selectedIndex = 0;
+            _listDelete.Clear();
+
+            if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
+            UpdateView();
+
+        }
+        private void UpdateView()
+        {
             if (_ui.m_c1.selectedIndex == 0)
             {
-                _ui.m_list.numItems = 0;
+                _photoInfos = PoemPhotoDataManager.Instance.PersonalPhotoInfos;
+                _sourceType = (int)PictureSourceType.PersonalAlbum;
             }
             else
             {
-                _ui.m_list.numItems = 0;
+                _photoInfos = PoemPhotoDataManager.Instance.WsqsPhotoInfos;
+                _sourceType = (int)PictureSourceType.WanShuiQianShan;
             }
+            _ui.m_list.numItems = _photoInfos.Count;
+
+            _ui.m_txtCount.text = string.Format("({0}/{1})", _photoInfos.Count, GlobalCfgArray.globalCfg.maxPhotoCount);
+            _ui.m_btnConfirmDelete.m_txtTitle.text = string.Format("删除({0}/{1})", _listDelete.Count, _photoInfos.Count);
         }
 
         private void RenderListItem(int index, GObject obj)
         {
             UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
-            int id = 0;
-            item.m_c1.selectedIndex = _deleting ? 1 : 0;
-            item.m_c2.selectedIndex = !_deleting || _listDelete.IndexOf(id) < 0 ? 0 : 1;
+
+            item.m_imgSelect.visible = _ui.m_c2.selectedIndex == 1 && _listDelete.IndexOf(_photoInfos[index].PictureId) >= 0;
+            item.m_comIcon.m_loaIcon.texture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+            item.m_txtTime.text = TimeUtil.FormattingTime1(_photoInfos[index].CreationTime);
+
             if (item.m_btnLock.target.data == null)
             {
                 item.m_btnLock.target.onClick.Add(OnBtnLockClick);
             }
-            item.m_btnLock.target.data = id;
+            item.m_btnLock.target.data = index;
+
             if (item.m_btnUp.target.data == null)
             {
                 item.m_btnUp.target.onClick.Add(OnBtnUpClick);
             }
-            item.m_btnUp.target.data = id;
-            if (item.m_comIcon.m_loaIcon.data == null)
+            item.m_btnUp.target.data = index;
+
+            if (item.m_comIcon.target.data == null)
             {
-                item.m_comIcon.m_loaIcon.onClick.Add(OnLoaIconClick);
+                item.m_comIcon.target.onClick.Add(OnLoaIconClick);
             }
-            item.m_comIcon.m_loaIcon.data = id;
-            item.target.data = index;
+
             UI_ListPhotoItem.ProxyEnd();
         }
 
         private void OnLoaIconClick(EventContext context)
         {
             GObject obj = context.sender as GObject;
-            if (!_deleting)
+            int index = (int)obj.data;
+            PoemPhotoData photoData = _photoInfos[index];
+            if (_ui.m_c2.selectedIndex == 0)
             {
-                int index = (int)obj.parent.data;
-                ViewManager.Show<PoemPhotoPreView>(index, new object[] { typeof(PoemView).FullName, this.viewData });
+                ViewManager.Show<PoemPhotoPreView>(new object[] { index, _sourceType }, new object[] { typeof(PoemView).FullName, this.viewData });
             }
-            else
+            else if (_ui.m_c2.selectedIndex == 1)
             {
-                int id = (int)obj.data;
-                UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
-                item.m_c2.selectedIndex = item.m_c2.selectedIndex == 0 ? 1 : 0;
-                if (item.m_c2.selectedIndex == 1)
+                long id = photoData.PictureId;
+                UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj.parent);
+                item.m_imgSelect.visible = !item.m_imgSelect.visible;
+                if (item.m_imgSelect.visible)
                 {
                     _listDelete.Add(id);
                 }
@@ -132,16 +178,57 @@ namespace GFGGame
                     _listDelete.Remove(id);
                 }
                 UI_ListPhotoItem.ProxyEnd();
+                _ui.m_btnConfirmDelete.m_txtTitle.text = string.Format("删除({0}/{1})", _listDelete.Count, _photoInfos.Count);
             }
         }
         private void OnBtnLockClick(EventContext context)
         {
             GObject item = context.sender as GObject;
+            int index = (int)item.data;
+            PoemPhotoData photoData = _photoInfos[index];
+            if (photoData.LockingStatus == false)
+            {
+                AlertUI.Show("是否确认锁定此照片?", "(锁住的照片无法被删除)")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeLockingState(photoData.PictureId, true, _sourceType).Coroutine();
+
+               });
+            }
+            else
+            {
+                AlertUI.Show("是否确认解锁此照片?", "(解锁后的照片可随意删除)")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeLockingState(photoData.PictureId, false, _sourceType).Coroutine();
+
+               });
+            }
 
         }
         private void OnBtnUpClick(EventContext context)
         {
             GObject item = context.sender as GObject;
+            int index = (int)item.data;
+            PoemPhotoData photoData = _photoInfos[index];
+            if (photoData.ToppingStatus == false)
+            {
+                AlertUI.Show("是否确认置顶此照片?")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeToppingState(photoData.PictureId, true, _sourceType).Coroutine();
+
+               });
+            }
+            else
+            {
+                AlertUI.Show("是否确认取消置顶此照片?")
+               .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
+               {
+                   PoemPhotoSProxy.ReqChangeToppingState(photoData.PictureId, false, _sourceType).Coroutine();
+
+               });
+            }
 
         }
 

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

@@ -27,7 +27,7 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
 
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_1");
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zjm_11");
 
             _ui.m_btnback.onClick.Add(OnBtnBackClick);
             _ui.m_comphoto.target.onClick.Add(OnComPhotoClick);

二進制
GameClient/Assets/ResIn/UI/Common/Common_fui.bytes


二進制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


二進制
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes


二進制
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes