forked from sin365/AxibugEmuOnline
解决翻页时丢失搜索关键字的问题
This commit is contained in:
parent
90f23a1d3f
commit
7c2709f335
@ -20,6 +20,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
private HttpAPI.GetRomListAPI m_romGetFunc;
|
private HttpAPI.GetRomListAPI m_romGetFunc;
|
||||||
private HttpAPI.SearchRomListAPI m_romSearchFunc;
|
private HttpAPI.SearchRomListAPI m_romSearchFunc;
|
||||||
private EnumSupportEmuPlatform m_platform;
|
private EnumSupportEmuPlatform m_platform;
|
||||||
|
private string lastSearchKey;
|
||||||
|
|
||||||
public RomLib(EnumSupportEmuPlatform platform)
|
public RomLib(EnumSupportEmuPlatform platform)
|
||||||
{
|
{
|
||||||
@ -71,6 +72,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
/// <param name="callback"></param>
|
/// <param name="callback"></param>
|
||||||
public void FetchRomCount(Action<RomFile[]> callback, string searchKey = null)
|
public void FetchRomCount(Action<RomFile[]> callback, string searchKey = null)
|
||||||
{
|
{
|
||||||
|
lastSearchKey = searchKey;
|
||||||
if (string.IsNullOrWhiteSpace(searchKey))
|
if (string.IsNullOrWhiteSpace(searchKey))
|
||||||
{
|
{
|
||||||
m_romGetFunc((romList) =>
|
m_romGetFunc((romList) =>
|
||||||
@ -121,9 +123,16 @@ namespace AxibugEmuOnline.Client
|
|||||||
if (FetchPageCmd.Count == 0) return;
|
if (FetchPageCmd.Count == 0) return;
|
||||||
|
|
||||||
foreach (var pageNo in FetchPageCmd)
|
foreach (var pageNo in FetchPageCmd)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(lastSearchKey))
|
||||||
|
{
|
||||||
|
m_romSearchFunc(SaveRomInfoFromWeb, lastSearchKey, pageNo, PAGE_SIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
m_romGetFunc(SaveRomInfoFromWeb, pageNo, PAGE_SIZE);
|
m_romGetFunc(SaveRomInfoFromWeb, pageNo, PAGE_SIZE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FetchPageCmd.Clear();
|
FetchPageCmd.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user