This commit is contained in:
2020-07-14 22:04:03 +08:00
parent e54411e2c2
commit a47cabede2
119 changed files with 5115 additions and 1061 deletions

View File

@@ -40,7 +40,7 @@ function CLToastRoot.borrow()
else
cell = queue:deQueue()
end
cell.name = string.format("%11d",index)
cell.name = string.format("%11d", index)
index = index + 1
return cell
end
@@ -51,6 +51,9 @@ function CLToastRoot.returnToast(cell)
end
function CLToastRoot.toast(msg, type, staySec)
if isNilOrEmpty(msg) then
return
end
local cell = CLToastRoot.borrow()
SetActive(cell.gameObject, true)
cell:init({msg = msg, type = type, staySec = staySec}, nil)

View File

@@ -39,9 +39,9 @@ function _cell.init(csObj)
uiobjs.spriteBg = getCC(transform, "Background", "UISprite")
end
if uiobjs.spriteBg then
uiobjs.spriteBg.width = NumEx.getIntPart(CSPMain.contentRect.z)
end
-- if uiobjs.spriteBg then
-- uiobjs.spriteBg.width = NumEx.getIntPart(CSPMain.contentRect.z)
-- end
uiobjs.boxCollider = csSelf:GetComponent("BoxCollider")
---@type UIInput

View File

@@ -88,16 +88,6 @@ function _cell.onLoadField(name, go, orgs)
local param = mData.fields[index]
local cell = go:GetComponent("CLCellLua")
SetActive(go, true)
--[[
---@type _ParamCellExtendFiled
local param = {
attr = fileAttr,
onMultTextInputChg = _cell.onMultTextInputChg,
isEditMode = isEditMode,
onClick = mData.onClick,
onSelect = mData.onSelect
}
]]
if param.attr.attrType == DBCust.FieldType.multext then
-- 要设置一次
param.orgOnMultTextInputChg = param.onMultTextInputChg

View File

@@ -0,0 +1,44 @@
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
local mData = nil
local uiobjs = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
---@type UIToggle
uiobjs.Toggle = getCC(transform, "Toggle", "UIToggle")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
uiobjs.formRoot:setValue(mData.data, true)
_cell.selected(mData.isSelected)
end
-- 取得数据
function _cell.getData()
return mData
end
function _cell.selected(val)
mData.isSelected = val
uiobjs.Toggle.value = val
end
function _cell.uiEventDelegate(go)
if go.name == "Toggle" then
_cell.selected(uiobjs.Toggle.value)
end
end
--------------------------------------------
return _cell

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 156c8a77e4fb8424da798e7fd2682597
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
local mData = nil
local uiobjs = {}
_cell.onDeleteProduct = nil
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
uiobjs.formRoot:setValue(mData)
end
-- 取得数据
function _cell.getData()
return mData
end
function _cell.uiEventDelegate(go)
if go.name == "ButtonEdit" then
getPanelAsy("PanelEditPrice", onLoadedPanelTT, {data = mData, callback = _cell.onFinishEditPrice})
elseif go.name == "ButtonDel" then
Utl.doCallback(_cell.onDeleteProduct, mData)
end
end
function _cell.onFinishEditPrice(d)
mData = d
uiobjs.formRoot:setValue(mData)
end
--------------------------------------------
return _cell

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4500701b5daa743d7bcb2147cedf4101
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: