This commit is contained in:
2020-07-28 21:02:59 +08:00
parent 5a53995fff
commit 8c38fea011
120 changed files with 7097 additions and 1930 deletions

View File

@@ -0,0 +1,48 @@
---@class _ParamCellCustFilter
---@field name string
---@field value number
---@field selected boolean
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
---@type _ParamCellCustFilter
local mData = nil
local uiobjs = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
uiobjs.Label = getCC(transform, "Label", "UILabel")
uiobjs.bg = csSelf:GetComponent("UISprite")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
uiobjs.Label.text = mData.name
_cell.setSelect(mData.selected)
end
function _cell.setSelect(val)
mData.selected = val
if val then
uiobjs.bg.color = ColorEx.getColor(0xff2990dc)
uiobjs.Label.color = ColorEx.getColor(0xffffffff)
else
uiobjs.bg.color = ColorEx.getColor(0xfff4f4f4)
uiobjs.Label.color = ColorEx.getColor(0xff999999)
end
end
-- 取得数据
function _cell.getData()
return mData
end
--------------------------------------------
return _cell

View File

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

View File

@@ -0,0 +1,114 @@
---@class _ParamCellCustFilterGroup
---@field title
---@field key
---@field key2
---@field panel TRPCustFilter
---@field list
---@field type 1:dateTime 其它情况为选择
---@field isDateRange
---@field isNeedTime
---@field value
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
---@type _ParamCellCustFilterGroup
local mData = nil
local uiobjs = {}
local cells = {}
local firstCell
local selectedCells = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
uiobjs.LabelTitle = getCC(transform, "LabelTitle", "UILabel")
uiobjs.grid = getCC(transform, "Grid", "UIGrid")
uiobjs.gridPrefab = getChild(uiobjs.grid.transform, "00000").gameObject
---@type CLUIElementDate
uiobjs.InputDate = getCC(transform, "InputDate", "CLUIElementDate")
uiobjs.InputDateEl = getCC(transform, "InputDate", "CLUIElement")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
uiobjs.LabelTitle.text = mData.title
if mData.type and mData.type == 1 then
SetActive(uiobjs.InputDate.gameObject, true)
SetActive(uiobjs.grid.gameObject, false)
uiobjs.InputDate.isSetTime = mData.isNeedTime or false
uiobjs.InputDate.isDateRange = mData.isDateRange or false
uiobjs.InputDateEl.value = mData.value
else
SetActive(uiobjs.InputDate.gameObject, false)
SetActive(uiobjs.grid.gameObject, true)
selectedCells = {}
cells = {}
CLUIUtl.resetList4Lua(uiobjs.grid, uiobjs.gridPrefab, mData.list, _cell.initCell)
end
end
function _cell.initCell(cell, data)
cell:init(data, _cell.onClickCell)
if data.value == -1 then
firstCell = cell
else
table.insert(cells, cell)
end
end
function _cell.onClickCell(cell, data)
data.selected = not data.selected
cell.luaTable.setSelect(data.selected)
if data.value == -1 then
-- 说明是全部
for i, v in ipairs(cells) do
v.luaTable.setSelect(data.selected)
end
else
local isAllSelected = true
for i, v in ipairs(cells) do
local d = v.luaTable.getData()
if not d.selected then
isAllSelected = false
break
end
end
if firstCell then
firstCell.luaTable.setSelect(isAllSelected)
end
end
mData.panel:refreshFilterBtnStatus()
end
-- 取得数据
function _cell.getData()
return mData
end
function _cell.uiEventDelegate(go)
if go.name == "ButtonReset" then
-- 说明是全部
for i, v in ipairs(cells) do
v.luaTable.setSelect(false)
end
if uiobjs.InputDateEl then
uiobjs.InputDateEl.value = ""
mData.value = ""
end
mData.panel:refreshFilterBtnStatus()
elseif go.name == "InputDate" then
if mData.type == 1 then
mData.value = uiobjs.InputDateEl.value
end
mData.panel:refreshFilterBtnStatus()
end
end
--------------------------------------------
return _cell

View File

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

View File

@@ -142,10 +142,9 @@ function _cell.getData()
return mData
end
function _cell.OnDisable()
if #(fieldsObjs) > 0 then
printe("动态加载的字段没有释放")
printe("动态加载的字段没有释放" .. csSelf.name)
end
end
--------------------------------------------

View File

@@ -0,0 +1,43 @@
-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
---@type _DBCust
local mData = nil
local uiobjs = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
---@type UIPopupList
uiobjs.LabelStatus = getCC(transform, "LabelStatus", "UIPopupList")
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
uiobjs.SpriteStatus = getChild(transform, "SpriteStatus")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
mData._phoneNo = MyUtl.hidePhone(mData.phoneNo)
mData.lastFollowUpTime = isNilOrEmpty(mData.upTime) and "" or mData.upTime
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
uiobjs.formRoot:setValue(mData)
if tostring(mData.dealFlag) == "0" then
SetActive(uiobjs.SpriteStatus.gameObject, true)
else
SetActive(uiobjs.SpriteStatus.gameObject, false)
end
end
-- 取得数据
function _cell.getData()
return mData
end
--------------------------------------------
return _cell

View File

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

View File

@@ -24,7 +24,7 @@ end
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
mData.money = mData.prodNum * mData.salePrice
-- mData.money = mData.prodNum * mData.salePrice
mData._phoneNo = MyUtl.hidePhone(mData.phoneNo)
local optionInfor = DBOrder.getPopupList(DBOrder.PopListGroup.orderStatus)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)