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

@@ -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