This commit is contained in:
2020-08-04 21:58:27 +08:00
parent a7b47a6827
commit f913a2a0aa
91 changed files with 1671 additions and 965 deletions

View File

@@ -34,7 +34,8 @@ function _cell.show(go, data)
if content.success then
_cell.refreshContent(content.result)
end
end
end,
data.forceRefresh or false
)
end

View File

@@ -28,7 +28,8 @@ function _cell.show(go, data)
if content.success then
_cell.refreshContent(content.result)
end
end
end,
data.forceRefresh or false
)
end

View File

@@ -50,7 +50,8 @@ function _cell.show(go, data)
uiobjs.formRoot:setValue(mData)
end
end
end,
data.forceRefresh or false
)
end

View File

@@ -266,7 +266,6 @@ end
--设置进度条
function CLLPSplash.onProgress(...)
do return end
local args = {...}
local all = args[1] -- 总量
local v = args[2] -- 当前值

View File

@@ -15,7 +15,7 @@ function CSPMine.init(csObj)
CSPMine.contentRect = MyUtl.getUIContent(csSelf, nil, nil, true)
objs.Content = getCC(transform, "PanelContent", "UIPanel")
MyUtl.setContentView(objs.Content, 147 + 370)
MyUtl.setContentView(objs.Content, MyUtl.defaultBottomHeight + 370)
---@type CLUIFormRoot
objs.Top = getCC(transform, "Top", "CLUIFormRoot")

View File

@@ -1,13 +1,16 @@
-- xx界面
local CSPMsg = {}
---@type Coolape.CLPanelLua
local csSelf = nil
local transform = nil
CSPMsg.sizeAdjust = 1
CSPMsg.contentRect = Vector4.zero
local isShowdDragFrefresh = false
local dragVal = Vector3.zero
local objs = {}
local defaulList = {
{icon="news_news_1", bgColor=0xfff1c40f,type=DBMessage.MsgType.Sys, name="公告"},
{icon = "news_news_1", bgColor = 0xfff1c40f, type = DBMessage.MsgType.Sys, name = "公告"}
-- {icon="news_news_2", bgColor=0xff2990dc,type=DBMessage.MsgType.SysNotice, name="系统消息"},
-- {icon="news_news_3", bgColor=0xff1abc9c,type=DBMessage.MsgType.Task, name="待办任务"},
}
@@ -29,6 +32,9 @@ function CSPMsg.init(csObj)
---@type UITable
objs.Table = getCC(objs.scrollView.transform, "Table", "UITable")
objs.LoopGrid = getCC(objs.Table.transform, "msgList/Grid", "CLUILoopGrid")
objs.ButtonEndList = getChild(objs.Table.transform, "ButtonEndList")
objs.ButtonHeadList = getCC(objs.Table.transform, "ButtonHeadList", "UILabel")
end
-- 设置数据
@@ -37,9 +43,49 @@ end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function CSPMsg.show()
CSPMsg.setList()
objs.Content.onClipMove = CSPMsg.onClipMove
objs.scrollView.onDragStarted = CSPMsg.onDragStart
objs.scrollView.onDragFinished = CSPMsg.onDragEnd
end
function CSPMsg.setList()
objs.LoopGrid:setList(defaulList, CSPMsg.initCell)
objs.Table:Reposition()
objs.scrollView:ResetPosition()
csSelf:invoke4Lua(CSPMsg.repositon, 0.1)
end
function CSPMsg.onClipMove(panel)
if (not isShowdDragFrefresh) and objs.ButtonHeadList.isVisible then
isShowdDragFrefresh = true
dragVal = objs.Content.transform.localPosition
end
end
function CSPMsg.onDragStart()
objs.ButtonHeadList.transform.localPosition = Vector3.up * 30
SetActive(objs.ButtonHeadList.gameObject, true)
dragVal = Vector3.zero
isShowdDragFrefresh = false
end
function CSPMsg.onDragEnd()
SetActive(objs.ButtonHeadList.gameObject, false)
local offset = objs.Content.transform.localPosition - dragVal
if offset.y < -50 then
-- 刷数据
NetProto.send.announcement_query()
end
if isShowdDragFrefresh then
CSPMsg.repositon()
end
end
function CSPMsg.repositon()
objs.scrollView:ResetPosition()
end
function CSPMsg.initCell(cell, data)

View File

@@ -1,12 +1,15 @@
-- xx界面
local CSPTasks = {}
---@type Coolape.CLPanelLua
local csSelf = nil
local transform = nil
CSPTasks.sizeAdjust = 1
CSPTasks.contentRect = Vector4.zero
local uiobjs = {}
local headData = {}
local dragVal = Vector3.zero
local isShowdDragFrefresh = false
-- 初始化,只会调用一次
function CSPTasks.init(csObj)
@@ -15,12 +18,16 @@ function CSPTasks.init(csObj)
CSPTasks.setEventDelegate()
CSPTasks.contentRect = MyUtl.getUIContent(csSelf, 360 + 220)
---@type UIPanel
uiobjs.Content = getCC(transform, "PanelContent", "UIPanel")
uiobjs.Content.transform.localPosition = Vector3.zero
uiobjs.Content.clipOffset = Vector2.zero
uiobjs.Content.baseClipRegion = CSPTasks.contentRect
uiobjs.TableContent = getCC(uiobjs.Content.transform, "Table", "UITable")
---@type UILabel
uiobjs.LabelDragRefresh = getCC(uiobjs.TableContent.transform, "LabelDragRefresh", "UILabel")
SetActive(uiobjs.LabelDragRefresh.gameObject, false)
---@type UIGrid
local CustManageGrid = getCC(uiobjs.TableContent.transform, "CustManage/grid", "UIGrid")
@@ -59,21 +66,32 @@ function CSPTasks.setData(paras)
end
-- 取得头像
CSPTasks.refreshData()
end
function CSPTasks.refreshData()
NetProto.send.person_view_query()
NetProto.send.sales_view_query()
if CSPTasks.reportform then
CSPTasks.reportform:init({forceRefresh = true}, nil)
end
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function CSPTasks.show()
local list = {}
for i = 1, 100 do
list[i] = i
end
-- uiobjs.TableTask:setList(list, nil)
uiobjs.ToggleOrder:Set(true)
CSPTasks.showReportform("reportform2")
uiobjs.scrollView:ResetPosition()
csSelf:invoke4Lua(
function()
uiobjs.scrollView:ResetPosition()
end,
0.1
)
uiobjs.Content.onClipMove = CSPTasks.onClipMove
uiobjs.scrollView.onDragStarted = CSPTasks.onDragStart
uiobjs.scrollView.onDragFinished = CSPTasks.onDragEnd
end
function CSPTasks.onClickBottonBtn(cell)
@@ -94,8 +112,34 @@ function CSPTasks.setHeadInfor()
)
end
function CSPTasks.onClipMove(panel)
if (not isShowdDragFrefresh) and uiobjs.LabelDragRefresh.isVisible then
isShowdDragFrefresh = true
dragVal = uiobjs.Content.transform.localPosition
end
end
function CSPTasks.onDragStart()
uiobjs.LabelDragRefresh.transform.localPosition = Vector3.zero
SetActive(uiobjs.LabelDragRefresh.gameObject, true)
dragVal = Vector3.zero
isShowdDragFrefresh = false
end
function CSPTasks.onDragEnd()
SetActive(uiobjs.LabelDragRefresh.gameObject, false)
local offset = uiobjs.Content.transform.localPosition - dragVal
if offset.y < -50 then
-- 刷数据
CSPTasks.refreshData()
end
if isShowdDragFrefresh then
uiobjs.scrollView:ResetPosition()
end
end
-- 关闭页面
function CSPTasks.hide()
csSelf:cancelInvoke4Lua()
if CSPTasks.reportform then
CLUIOtherObjPool.returnObj(CSPTasks.reportform.gameObject)
SetActive(CSPTasks.reportform.gameObject, false)

View File

@@ -10,7 +10,7 @@ function TRPAbout:init(csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 500, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 500, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
---@type UITable

View File

@@ -15,7 +15,7 @@ function TRPComFilter:init(csObj)
TRPComFilter.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 50, 190)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 50, 190)
---@type UIScrollView
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollview.dampenStrength = MyUtl.dampenStrength

View File

@@ -11,7 +11,7 @@ function TRPCustDetail:init(csObj)
self:prepareMoreData()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 400 + 160 + 60, 200)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 400 + 160 + 60, 200)
uiobjs.bottomGrid = getCC(self.transform, "AnchorBottom/offset/Grid", "UIGrid")
local width = NumEx.getIntPart(CSPMain.contentRect.z / 4)
uiobjs.bottomGrid.cellWidth = width
@@ -261,6 +261,12 @@ function TRPCustDetail:reposition()
uiobjs.Table:Reposition()
uiobjs.scrollView.disableDragIfFits = true
uiobjs.scrollView:ResetPosition()
self.csSelf:invoke4Lua(
function()
uiobjs.scrollView:ResetPosition()
end,
0.1
)
end
---public 显示扩展字段
@@ -358,7 +364,7 @@ function TRPCustDetail:showOrders()
SetActive(uiobjs.Records.gameObject, false)
SetActive(uiobjs.OrderRoot.gameObject, true)
SetActive(uiobjs.MoreRoot.gameObject, false)
if self.orders == nil or #(self.orders.data) then
SetActive(uiobjs.ButtonEndListOrder.gameObject, true)
else
@@ -395,10 +401,10 @@ function TRPCustDetail:onOrderEndList(tail)
printw("到最后了==" .. tail.name)
if self.orders and self.orders.meta.current_page < self.orders.meta.total_pages then
showHotWheel()
-- //TODO:取得下一页
-- 取得下一页
NetProto.send.workFlowQuery({custId = self.mdata.custId}, "", self.orders.meta.current_page + 1)
else
uiobjs.ButtonEndListOrder.localPosition = tail.transform.localPosition + Vector3.up * -270
uiobjs.ButtonEndListOrder.localPosition = tail.transform.localPosition + Vector3.up * -240
SetActive(uiobjs.ButtonEndListOrder.gameObject, true)
end
end

View File

@@ -11,7 +11,7 @@ function TRPCustDetailSimple:init(csObj)
self:prepareMoreData()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 400 + 40, 200)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 400 + 40, 200)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")

View File

@@ -9,7 +9,7 @@ function TRPCustList:init(csObj)
TRPCustList.super.init(self, csObj)
self:setEventDelegate()
self:initFilters()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
@@ -112,6 +112,11 @@ function TRPCustList:showList(list)
self:wrapFunc(self.onEndList)
)
uiobjs.scrollView:ResetPosition()
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPCustList:reposition()
uiobjs.scrollView:ResetPosition()
end
function TRPCustList:appList(list)

View File

@@ -9,7 +9,7 @@ function TRPCustListProc:init(csObj)
TRPCustListProc.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 30, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 30, 0)
---@type UIScrollView
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollview.dampenStrength = MyUtl.dampenStrength

View File

@@ -14,7 +14,7 @@ function TRPFollowFilter:init(csObj)
TRPFollowFilter.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 50, 190)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 50, 190)
---@type UIScrollView
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollview.dampenStrength = MyUtl.dampenStrength

View File

@@ -9,7 +9,7 @@ function TRPFollowList:init(csObj)
TRPFollowList.super.init(self, csObj)
self:initFilters()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40, 0)
---@type UIInput
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
@@ -120,6 +120,11 @@ function TRPFollowList:showList(list)
self:wrapFunc(self.onEndList)
)
uiobjs.scrollView:ResetPosition()
self.csSelf:invoke4Lua(self.repositon, 0.1)
end
function TRPFollowList:repositon()
uiobjs.scrollView:ResetPosition()
end
function TRPFollowList:appList(list)
@@ -137,7 +142,7 @@ function TRPFollowList:onShowRefreshFlg()
end
function TRPFollowList:onhideRefreshFlg()
SetActive(uiobjs.ButtonHeadList.gameObject, false)
if uiobjs.Grid.list.Count == 0 then
if uiobjs.Grid.list.Count == 0 then
uiobjs.scrollView:ResetPosition()
end
end

View File

@@ -10,7 +10,7 @@ function TRPMyInfor:init(csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 40 + 300, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 40 + 300, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
@@ -177,10 +177,12 @@ function TRPMyInfor:onClickField(go)
elseif el.jsonKey == "closeLog" then
if ReporterMessageReceiver.self and ReporterMessageReceiver.self.gameObject then
ReporterMessageReceiver.self.gameObject:SetActive(false)
MyUtl.toast("日志监听已关闭")
end
elseif el.jsonKey == "openLog" then
if ReporterMessageReceiver.self and ReporterMessageReceiver.self.gameObject then
ReporterMessageReceiver.self.gameObject:SetActive(true)
MyUtl.toast("日志监听已打开,画圈可查看")
end
else
getPanelAsy(

View File

@@ -11,7 +11,7 @@ function TRPNewCust:init(csObj)
TRPNewCust.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
@@ -39,7 +39,7 @@ end
-- 设置数据
---@param paras _ParamTRPNewCust
function TRPNewCust:setData(paras)
if paras and paras.custId > 0 then
if paras and paras.custId and paras.custId > 0 then
self.isNewCust = false
self.mdata = paras
self.mdata._phoneNo = MyUtl.hidePhone(self.mdata.phoneNo)

View File

@@ -11,7 +11,7 @@ function TRPNewFollow:init(csObj)
TRPNewFollow.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength

View File

@@ -11,7 +11,7 @@ function TRPNewFollowSimple:init(csObj)
TRPNewFollowSimple.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength

View File

@@ -11,7 +11,7 @@ function TRPNewFollowTask:init(csObj)
TRPNewFollowTask.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength

View File

@@ -11,7 +11,7 @@ function TRPNewOrder:init(csObj)
TRPNewOrder.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength

View File

@@ -9,7 +9,7 @@ function TRPOceanList:init(csObj)
TRPOceanList.super.init(self, csObj)
self:setEventDelegate()
self:initFilters()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
@@ -101,6 +101,11 @@ function TRPOceanList:showList(list)
self:wrapFunc(self.onEndList)
)
uiobjs.scrollView:ResetPosition()
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPOceanList:reposition()
uiobjs.scrollView:ResetPosition()
end
function TRPOceanList:appList(list)

View File

@@ -25,7 +25,7 @@ function TRPOrderDetail:init(csObj)
---@type UIToggle
uiobjs.ToggleDetail = getCC(uiobjs.ToggleGrid.transform, "ToggleDetail", "UIToggle")
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 160 + 30, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 160 + 30, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
@@ -215,6 +215,12 @@ function TRPOrderDetail:reposition()
uiobjs.Table:Reposition()
uiobjs.scrollView.disableDragIfFits = true
uiobjs.scrollView:ResetPosition()
self.csSelf:invoke4Lua(
function()
uiobjs.scrollView:ResetPosition()
end,
0.1
)
end
function TRPOrderDetail:showBaseFileds()
@@ -432,7 +438,8 @@ function TRPOrderDetail:setEventDelegate()
self.currToggle = 5
self:showSubOrders()
end,
ButtonAddAttachment = function()
ButtonAddAttachment = function(go)
self:addAttachment(go)
end,
ButtonAddMoney = function()
end,
@@ -442,11 +449,65 @@ function TRPOrderDetail:setEventDelegate()
end
}
end
function TRPOrderDetail:addAttachment(go)
-- 添加附件
---@type UIPopupList
local popList = go:GetComponent("UIPopupList")
if popList.value == "1" then
-- 相机
local permission = MyCamera.getImage(self:wrapFunc(self.onGetImage))
if permission ~= NativeCamera.Permission.Granted then
if permission == NativeCamera.Permission.ShouldAsk then
NativeCamera.RequestPermission()
else
CLUIUtl.showConfirm(
"没有使用相机的权限,打开设置允许使用相机",
function()
if not MyCamera.openSetting() then
MyUtl.toastW("打开权限设置失败")
end
end,
nil
)
end
end
elseif popList.value == "2" then
local permission = MyGallery.getImage(self:wrapFunc(self.onGetImage))
if permission ~= NativeGallery.Permission.Granted then
if permission == NativeGallery.Permission.ShouldAsk then
NativeGallery.RequestPermission()
else
CLUIUtl.showConfirm(
"没有使用相册的权限,打开设置允许使用相册",
function()
if not MyGallery.openSetting() then
MyUtl.toastW("打开权限设置失败")
end
end,
nil
)
end
NativeCamera.RequestPermission()
end
end
end
function TRPOrderDetail:onGetImage(path)
if isNilOrEmpty(path) then
return
end
-- table.insert(self.images, {path = path, onDelete = self:wrapFunc(self.onDelImage)})
--//TODO:
MyUtl.toastW("接口要修改")
end
-- 处理ui上的事件例如点击等
function TRPOrderDetail:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
func(go)
end
end

View File

@@ -9,7 +9,7 @@ function TRPOrderList:init(csObj)
TRPOrderList.super.init(self, csObj)
self:setEventDelegate()
self:initFilters()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
@@ -123,6 +123,13 @@ function TRPOrderList:showList(list)
self:wrapFunc(self.onHeadList),
self:wrapFunc(self.onEndList)
)
self:reposition()
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPOrderList:reposition()
uiobjs.scrollView:ResetPosition()
end

View File

@@ -10,7 +10,7 @@ function TRPProductDetail:init(csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength

View File

@@ -31,7 +31,7 @@ end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPProductList:show()
uiobjs.InputSeachKey.value = ""
showHotWheel()
-- showHotWheel()
NetProto.send.selectProductInfo(uiobjs.InputSeachKey.value, 1)
self:showList({})
end
@@ -47,8 +47,14 @@ function TRPProductList:showList(products)
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
uiobjs.Grid:setList(list, self:wrapFunc(self.initCell), nil, self:wrapFunc(self.onEndList))
self:reposition()
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPProductList:reposition()
uiobjs.scrollView:ResetPosition()
end
function TRPProductList:appList(products)
local list = {}
for i, v in ipairs(products or {}) do

View File

@@ -48,8 +48,13 @@ function TRPSelectProduct:showList(products)
table.insert(list, {data = v, isSelected = selectedMap[v.id] and true or false})
end
uiobjs.Grid:setList(list, self:wrapFunc(self.initCell), nil, self:wrapFunc(self.onEndList))
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPSelectProduct:reposition()
uiobjs.scrollView:ResetPosition()
end
function TRPSelectProduct:appList(list)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:appendList(list)

View File

@@ -91,6 +91,9 @@ function TRPSetting:setEventDelegate()
pcall(releaseRes4GC, true)
end
--- 释放资源结束-------------------------------
--//TODO: 还要把已经下载了的附件也删除掉
pcall(cleanRes)
local panel = CLPanelManager.getPanel(CLMainBase.self.firstPanel)
if panel then

View File

@@ -13,7 +13,7 @@ function TRPSysMsgDetail:init(csObj)
---@type UIScrollView
self.uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
self.uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
MyUtl.setContentView(self.uiobjs.scrollView, 132 + 100 + 56 + 25 + 30 + 45, 0)
MyUtl.setContentView(self.uiobjs.scrollView, MyUtl.defaultTopHeight + 100 + 56 + 25 + 30 + 45, 0)
self.uiobjs.LabelContent = getCC(self.uiobjs.scrollView.transform, "LabelContent", "UILabel")
self.uiobjs.LabelTitle = getCC(self.transform, "Top/LabelTitle", "UILabel")
self.uiobjs.LabelTime = getCC(self.transform, "Top/LabelTime", "UILabel")

View File

@@ -9,7 +9,7 @@ function TRPSysMsgList:init(csObj)
self:setEventDelegate()
self.uiobjs = {}
self.uiobjs.PanelContent = getCC(self.transform, "PanelContent", "UIPanel")
MyUtl.setContentView(self.uiobjs.PanelContent, nil, 0)
MyUtl.setContentView(self.uiobjs.PanelContent, MyUtl.defaultTopHeight + 30, 0)
---@type UIScrollView
self.uiobjs.scrollView = self.uiobjs.PanelContent:GetComponent("UIScrollView")
self.uiobjs.Table = getCC(self.uiobjs.PanelContent.transform, "Table", "UITable")
@@ -91,11 +91,15 @@ end
---@param data _DBMessage
function TRPSysMsgList:onClickCell(cell, data)
if data.NOTICETYPE == DBMessage.MsgType.Sys then
NetProto.send.readNotice(data.ID, function(content)
if content.success then
data.READFLAG = DBMessage.ReadFlag.readed
NetProto.send.readNotice(
data.ID,
function(content)
if content.success then
data.READFLAG = DBMessage.ReadFlag.readed
self.uiobjs.LoopTable:refreshContentOnly()
end
end
end)
)
getPanelAsy("PanelSysMsgDetail", onLoadedPanelTT, data)
elseif data.NOTICETYPE == DBMessage.MsgType.Task4Cust then
getPanelAsy("PanelCustListProc", onLoadedPanelTT, data)

View File

@@ -9,7 +9,7 @@ function TRPTaskList:init(csObj)
TRPTaskList.super.init(self, csObj)
self:setEventDelegate()
self:initFilters()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
@@ -135,6 +135,11 @@ function TRPTaskList:showList(list)
self:wrapFunc(self.onHeadList),
self:wrapFunc(self.onEndList)
)
self:reposition()
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPTaskList:reposition()
uiobjs.scrollView:ResetPosition()
end