This commit is contained in:
2020-07-05 15:44:30 +08:00
parent a8f02e4da5
commit e344c54d82
32 changed files with 647 additions and 209 deletions

View File

@@ -12,12 +12,18 @@ function TRPCustList:init(csObj)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
---@type CLUIScrollViewWithEvent
uiobjs.scrollView = getCC(self.transform, "PanelContent", "CLUIScrollViewWithEvent")
uiobjs.scrollView:init(
self:wrapFunc(self.onShowRefreshFlg),
self:wrapFunc(self.onhideRefreshFlg),
self:wrapFunc(self.refreshList)
)
---@type Coolape.CLUILoopGrid
uiobjs.Grid = getCC(uiobjs.scrollView.transform, "Grid", "CLUILoopGrid")
uiobjs.ButtonEndList = getChild(uiobjs.Grid.transform, "ButtonEndList")
uiobjs.ButtonEndListLb = getCC(uiobjs.ButtonEndList, "Label", "UILabel")
uiobjs.ButtonHeadList = getChild(uiobjs.Grid.transform, "ButtonHeadList")
end
-- 设置数据
@@ -35,6 +41,7 @@ function TRPCustList:show()
end
function TRPCustList:showList(list)
SetActive(uiobjs.ButtonHeadList.gameObject, false)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:setList(
list or {},
@@ -50,8 +57,25 @@ function TRPCustList:appList(list)
uiobjs.Grid:appendList(list)
end
function TRPCustList:onShowRefreshFlg()
-- printe("TRPCustList:onShowRefreshFlg")
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 250, 0)
SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPCustList:onhideRefreshFlg()
-- printe("TRPCustList:onhideRefreshFlg")
SetActive(uiobjs.ButtonHeadList.gameObject, false)
end
function TRPCustList:refreshList()
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
NetProto.send.list_customers(self.filterValue, queryKey, 1)
end
function TRPCustList:onHeadList(head)
printw("到最顶端了")
-- uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 250, 0)
-- SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPCustList:onEndList(tail)
@@ -171,9 +195,9 @@ function TRPCustList:onSetFilter(filters, queryKey)
showHotWheel()
self.filterValue = self:getFilterStr()
-- if oldqueryKey == queryKey then
NetProto.send.list_customers(self.filterValue, queryKey, 1)
NetProto.send.list_customers(self.filterValue, queryKey, 1)
-- else
-- 会触发input的onChange事件
-- 会触发input的onChange事件
-- end
end