浏览代码

相册滚动结束前切到明信片会报错

zhaoyang 2 年之前
父节点
当前提交
33b549b386
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

+ 10 - 2
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

@@ -90,11 +90,16 @@ namespace GFGGame
         }
         }
         private void OnBtnDeleteClick()
         private void OnBtnDeleteClick()
         {
         {
-            if (_ui.m_list.numItems == 0)
+            if (_ui.m_c1.selectedIndex == 0 && _ui.m_list.numItems == 0)
             {
             {
                 PromptController.Instance.ShowFloatTextPrompt("暂无照片可删除");
                 PromptController.Instance.ShowFloatTextPrompt("暂无照片可删除");
                 return;
                 return;
             }
             }
+            if (_ui.m_c1.selectedIndex == 1 && _ui.m_listTravel.numItems == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("暂无明信片可删除");
+                return;
+            }
             _ui.m_c2.selectedIndex = 1;
             _ui.m_c2.selectedIndex = 1;
         }
         }
 
 
@@ -109,6 +114,8 @@ namespace GFGGame
         {
         {
             if (_ui.m_c1.selectedIndex == 0)
             if (_ui.m_c1.selectedIndex == 0)
             {
             {
+                _ui.m_listTravel.numItems = 0;
+
                 _photoInfos = PoemPhotoDataManager.Instance.PersonalPhotoInfos;
                 _photoInfos = PoemPhotoDataManager.Instance.PersonalPhotoInfos;
                 _sourceType = (int)PictureSourceType.PersonalAlbum;
                 _sourceType = (int)PictureSourceType.PersonalAlbum;
                 _ui.m_list.numItems = _photoInfos.Count;
                 _ui.m_list.numItems = _photoInfos.Count;
@@ -116,6 +123,8 @@ namespace GFGGame
             }
             }
             else
             else
             {
             {
+                _ui.m_list.numItems = 0;
+
                 _photoInfos = PoemPhotoDataManager.Instance.WsqsPhotoInfos;
                 _photoInfos = PoemPhotoDataManager.Instance.WsqsPhotoInfos;
                 _sourceType = (int)PictureSourceType.WanShuiQianShan;
                 _sourceType = (int)PictureSourceType.WanShuiQianShan;
                 _ui.m_listTravel.numItems = _photoInfos.Count;
                 _ui.m_listTravel.numItems = _photoInfos.Count;
@@ -129,7 +138,6 @@ namespace GFGGame
         private void RenderListItem(int index, GObject obj)
         private void RenderListItem(int index, GObject obj)
         {
         {
             UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
             UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
-
             item.m_imgSelect.visible = _ui.m_c2.selectedIndex == 1 && _listDelete.IndexOf(_photoInfos[index].PictureId) >= 0;
             item.m_imgSelect.visible = _ui.m_c2.selectedIndex == 1 && _listDelete.IndexOf(_photoInfos[index].PictureId) >= 0;
             GLoader loaIcon = item.m_comIcon.m_loaIcon;
             GLoader loaIcon = item.m_comIcon.m_loaIcon;
             loaIcon.visible = true;
             loaIcon.visible = true;