add
This commit is contained in:
9
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/cell.meta
Normal file
9
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/cell.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74d73ec3374544eb3a2a209cf97e1fd2
|
||||
folderAsset: yes
|
||||
timeCreated: 1498220621
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
-- xx单元
|
||||
do
|
||||
local _cell = {}
|
||||
local csSelf = nil;
|
||||
local transform = nil;
|
||||
local mData = nil;
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init (csObj)
|
||||
csSelf = csObj;
|
||||
transform = csSelf.transform;
|
||||
--[[
|
||||
上的组件:getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
|
||||
--]]
|
||||
uiobjs.Background = getCC(transform, "Background", "UISprite")
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
uiobjs.LabelStat = getCC(transform, "LabelStat", "UILabel")
|
||||
uiobjs.LabelNew = getCC(transform, "LabelNew", "UILabel")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show ( go, data )
|
||||
mData = data;
|
||||
uiobjs.Label.text = mData.name
|
||||
local stateDesc = ""
|
||||
local status = bio2number(mData.status)
|
||||
if status == 2 then
|
||||
stateDesc = joinStr("[00ffff]", LGet("StateCrowded"),"[-]")
|
||||
elseif status == 3 then
|
||||
stateDesc = LGet("StateMaintain")
|
||||
stateDesc = joinStr("[ff0000]", LGet("StateMaintain"),"[-]")
|
||||
else
|
||||
stateDesc = joinStr("[00ff00]", LGet("StateNomal"),"[-]")
|
||||
end
|
||||
uiobjs.LabelStat.text = stateDesc
|
||||
SetActive(uiobjs.LabelNew.gameObject, mData.isnew and true or false)
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData ( )
|
||||
return mData;
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell;
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0f5fb10e29b948f5bc764c795610637
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,50 @@
|
||||
-- 界面元素对象
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
|
||||
local Label
|
||||
local ProgressBar
|
||||
|
||||
-- 属性值变量
|
||||
local mData = nil
|
||||
|
||||
local uiCell = {}
|
||||
|
||||
function uiCell.init(go)
|
||||
transform = go.transform
|
||||
csSelf = transform:GetComponent("CLCellLua")
|
||||
|
||||
Label = getChild(transform, "Label"):GetComponent("UILabel")
|
||||
ProgressBar = getChild(transform, "Progress Bar"):GetComponent("UISlider")
|
||||
end
|
||||
|
||||
function uiCell.show(go, data)
|
||||
mData = data
|
||||
NGUITools.SetActive(ProgressBar.gameObject, true)
|
||||
Label.text = ""
|
||||
InvokeEx.cancelInvokeByUpdate(uiCell.refresh)
|
||||
uiCell.refresh()
|
||||
end
|
||||
|
||||
function uiCell.refresh()
|
||||
if (mData == nil or mData.www == nil) then
|
||||
NGUITools.SetActive(ProgressBar.gameObject, false)
|
||||
Label.text = ""
|
||||
return
|
||||
end
|
||||
-- Label.text = PStr.b():a(mData.url):a("..."):a(mData.www.progress*100):a("%"):e()
|
||||
Label.text = PStr.b():a(math.floor(mData.www.downloadProgress * 100)):a("%"):e()
|
||||
ProgressBar.value = mData.www.downloadProgress
|
||||
InvokeEx.invokeByUpdate(uiCell.refresh, 0.02)
|
||||
end
|
||||
|
||||
function uiCell.OnDisable()
|
||||
InvokeEx.cancelInvokeByUpdate(uiCell.refresh)
|
||||
end
|
||||
|
||||
function uiCell.getdata()
|
||||
return mData, uiCell
|
||||
end
|
||||
|
||||
------------------------------------
|
||||
return uiCell
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23975cf82b438402e8adf415427ca74d
|
||||
timeCreated: 1498220629
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
-- 通用ui框1
|
||||
---@class _BGFrame1Param init时传入参数
|
||||
---@field title string 标题
|
||||
---@field isHideCloseBtn boolean 是否隐藏关闭按钮
|
||||
---@field closeCallback function 关闭回调
|
||||
---@field panel CLPanelLua 所在的Panel
|
||||
|
||||
local _cell = {}
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
---@type UISprite
|
||||
uiobjs.bg = csSelf:GetComponent("UISprite")
|
||||
-- uiobjs.topBg = getCC(transform, "top", "UISprite")
|
||||
-- uiobjs.topBg.width = NumEx.getIntPart(MyUtl.getSizeAdjust() * Screen.width)
|
||||
uiobjs.LabelTitle = getCC(transform, "top/LabelTitle", "UILabel")
|
||||
uiobjs.bg.width = NumEx.getIntPart(MyUtl.getSizeAdjust() * Screen.width)
|
||||
uiobjs.bg.height = NumEx.getIntPart(MyUtl.getSizeAdjust() * Screen.height)
|
||||
uiobjs.ButtonClose = getCC(transform, "top/ButtonClose", "UISprite")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.LabelTitle.text = mData.title
|
||||
SetActive(uiobjs.ButtonClose.gameObject, not (mData.isHideCloseBtn or false))
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonClose" then
|
||||
if mData.closeCallback then
|
||||
Utl.doCallback(mData.closeCallback)
|
||||
else
|
||||
hideTopPanel(mData.panel)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fff9d5644abf04a23bf81de467d55aee
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,57 @@
|
||||
-- 通用ui框1
|
||||
---@class _BGFrame2Param init时传入参数
|
||||
---@field title string 标题
|
||||
---@field closeCallback function 关闭回调
|
||||
---@field panel CLPanelLua 所在的Panel
|
||||
---@field hideClose boolean true时隐藏关闭按钮
|
||||
---@field hideTitle boolean true时隐藏标题
|
||||
|
||||
local _cell = {}
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
uiobjs.BtnClose = getChild(transform, "ButtonClose").gameObject
|
||||
uiobjs.LabelTitle = getCC(transform, "LabelTitle", "UILabel")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
if mData.hideClose then
|
||||
SetActive(uiobjs.BtnClose, false)
|
||||
else
|
||||
SetActive(uiobjs.BtnClose, true)
|
||||
end
|
||||
if mData.hideTitle then
|
||||
SetActive(uiobjs.LabelTitle.gameObject, false)
|
||||
else
|
||||
uiobjs.LabelTitle.text = mData.title
|
||||
SetActive(uiobjs.LabelTitle.gameObject, true)
|
||||
end
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonClose" then
|
||||
if mData.closeCallback then
|
||||
Utl.doCallback(mData.closeCallback)
|
||||
else
|
||||
hideTopPanel(mData.panel)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c5e867419f5d4dfcbe71b74bca24703
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,59 @@
|
||||
-- 单元
|
||||
|
||||
local uiCell = {}
|
||||
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local gameObject = nil
|
||||
local Background = nil
|
||||
local Label = nil
|
||||
|
||||
local mData = nil
|
||||
|
||||
function uiCell.init(go)
|
||||
gameObject = go
|
||||
transform = go.transform
|
||||
csSelf = gameObject:GetComponent("CLCellLua")
|
||||
|
||||
Background = getChild(transform, "Background"):GetComponent("UISprite")
|
||||
Label = getChild(transform, "Label"):GetComponent("UILabel")
|
||||
end
|
||||
|
||||
function uiCell.show(go, data)
|
||||
mData = data
|
||||
if (mData.day < 0) then
|
||||
Label.text = ""
|
||||
else
|
||||
Label.text = tostring(mData.day)
|
||||
end
|
||||
local isSelected = MapEx.getBool(mData, "isSelected")
|
||||
uiCell.refreshState(isSelected)
|
||||
end
|
||||
|
||||
function uiCell.refreshState(isSelected)
|
||||
if (mData == nil) then
|
||||
return
|
||||
end
|
||||
mData.isSelected = isSelected
|
||||
if (mData.isToday) then
|
||||
Background.color = ColorEx.getColor(133, 255, 133)
|
||||
Label.color = ColorEx.getColor(0xff363636)
|
||||
else
|
||||
Background.color = ColorEx.getColor(242, 242, 242)
|
||||
Label.color = ColorEx.getColor(0xff363636)
|
||||
end
|
||||
|
||||
if (isSelected) then
|
||||
Background.color = ColorEx.getColor(0xff2990dc)
|
||||
Label.color = Color.white
|
||||
end
|
||||
end
|
||||
|
||||
function uiCell.refresh(flag)
|
||||
end
|
||||
|
||||
function uiCell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
return uiCell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48071f648fc834738b1465dccb2289dd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,101 @@
|
||||
-- xx单元
|
||||
do
|
||||
local _cell = {}
|
||||
local csSelf = nil;
|
||||
local transform = nil;
|
||||
local grid;
|
||||
local dayPrefab = nil;
|
||||
local mData = nil;
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj;
|
||||
transform = csSelf.transform;
|
||||
grid = getChild(transform, "Grid"):GetComponent("UIGrid");
|
||||
dayPrefab = getChild(grid.transform, "00000").gameObject;
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
end
|
||||
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.refresh(data, pageIndex)
|
||||
mData = data;
|
||||
if (mData == nil) then
|
||||
mData = {}
|
||||
local curYear, curMonth = PanelCalender.getData();
|
||||
if (pageIndex < 0) then
|
||||
mData.year, mData.month = PanelCalender.getYYHH_ByaddMonth(curYear, curMonth, -6 + pageIndex);
|
||||
else
|
||||
mData.year, mData.month = PanelCalender.getYYHH_ByaddMonth(curYear, curMonth, -6 + pageIndex);
|
||||
end
|
||||
end
|
||||
|
||||
CLUIUtl.resetList4Lua(grid, dayPrefab,
|
||||
_cell.resetCalender(mData.year, mData.month),
|
||||
_cell.initCellDay);
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData;
|
||||
end
|
||||
|
||||
function _cell.initCellDay(cell, day)
|
||||
local data = {}
|
||||
data.day = day;
|
||||
-- print(mData.year);
|
||||
-- print(mData.month);
|
||||
-- print(day);
|
||||
-- print("=================");
|
||||
if (mData.year == DateTime.Now.Year and
|
||||
mData.month == DateTime.Now.Month and
|
||||
day == DateTime.Now.Day) then
|
||||
data.isToday = true;
|
||||
PanelCalender.setDefalutSelectDate(cell, mData.year, mData.month, day);
|
||||
else
|
||||
data.isToday = false;
|
||||
data.isSelected = false;
|
||||
end
|
||||
local selectedYear, selectedMonth, selectedDay = PanelCalender.getSelectDate();
|
||||
if (mData.year == selectedYear and mData.month == selectedMonth and selectedDay == data.day) then
|
||||
data.isSelected = true;
|
||||
end
|
||||
cell:init(data, _cell.onClickDay);
|
||||
end
|
||||
|
||||
function _cell.onClickDay(cell)
|
||||
local d = cell.luaTable.getData();
|
||||
if (d.day == -1) then
|
||||
return;
|
||||
end
|
||||
|
||||
local selectedDay = cell.luaTable.getData().day;
|
||||
local selectedMonth = mData.month;
|
||||
local selectedYear = mData.year;
|
||||
|
||||
PanelCalender.setSelectDate(cell, selectedYear, selectedMonth, selectedDay);
|
||||
end
|
||||
|
||||
function _cell.resetCalender(year, month)
|
||||
local list = ArrayList();
|
||||
local dayCount = DateEx.getMothDays(year, month);
|
||||
local week = DateEx.getWeek(year, month, 1);
|
||||
for i = 0, week - 1 do
|
||||
list:Add(-1);
|
||||
end
|
||||
for i = week, dayCount - 1 + week do
|
||||
-- print(i .. "-" .. week .. "+1");
|
||||
list:Add(i - week + 1);
|
||||
end
|
||||
for i = dayCount + week, 41 do
|
||||
list:Add(-1);
|
||||
end
|
||||
return list;
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell;
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faabfe2c47942447cb2f79efd27030e3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,35 @@
|
||||
-- 单元
|
||||
do
|
||||
|
||||
local uiCell = {}
|
||||
|
||||
local csSelf = nil;
|
||||
local transform = nil;
|
||||
local gameObject = nil;
|
||||
-- local Background = nil;
|
||||
local Label = nil;
|
||||
|
||||
local mData = nil;
|
||||
|
||||
function uiCell.init (go)
|
||||
gameObject = go;
|
||||
transform = go.transform;
|
||||
csSelf = gameObject:GetComponent("CLCellLua");
|
||||
|
||||
-- Background = getChild(transform, "Background"):GetComponent("UISprite");
|
||||
Label = csSelf:GetComponent("UILabel")
|
||||
end;
|
||||
|
||||
function uiCell.show ( go, data )
|
||||
mData = data;
|
||||
Label.text = isNilOrEmpty(mData) and "请选择" or mData
|
||||
end;
|
||||
|
||||
function uiCell.refresh ( flag )
|
||||
end
|
||||
|
||||
function uiCell.getData ( )
|
||||
return mData;
|
||||
end;
|
||||
return uiCell;
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d462a4d5910ea43c8a6983d8a54fbe9d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
---@class CellBottomBtn
|
||||
local _cell = {}
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
--[[
|
||||
上的组件:getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
|
||||
--]]
|
||||
---@type UIToggle
|
||||
uiobjs.toggle = csSelf:GetComponent("UIToggle")
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
-- uiobjs.LabelCheck = getCC(transform, "LabelCheck", "UILabel")
|
||||
uiobjs.boxCollider = csSelf:GetComponent("BoxCollider")
|
||||
uiobjs.Background = getCC(transform, "Background", "UISprite")
|
||||
uiobjs.Checkmark = getCC(transform, "Checkmark", "UISprite")
|
||||
uiobjs.LabelReddotNum = getCC(transform, "LabelReddotNum", "UILabel")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.Label.text = mData.name
|
||||
-- uiobjs.LabelCheck.text = mData.name
|
||||
uiobjs.boxCollider.center = Vector3.zero
|
||||
uiobjs.boxCollider.size = Vector3(mData.width, 150, 0)
|
||||
uiobjs.Background.spriteName = mData.Background
|
||||
uiobjs.Checkmark.spriteName = mData.Checkmark
|
||||
_cell.setReddotNum(0)
|
||||
end
|
||||
|
||||
function _cell.setReddotNum(num)
|
||||
if num and num > 0 then
|
||||
SetActive(uiobjs.LabelReddotNum.gameObject, true)
|
||||
if num > 9 then
|
||||
uiobjs.LabelReddotNum.text = "…"
|
||||
else
|
||||
uiobjs.LabelReddotNum.text = tostring(num)
|
||||
end
|
||||
else
|
||||
SetActive(uiobjs.LabelReddotNum.gameObject, false)
|
||||
end
|
||||
end
|
||||
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.setSelected(val)
|
||||
uiobjs.toggle:Set(val)
|
||||
end
|
||||
|
||||
function _cell.refreshState()
|
||||
if uiobjs.toggle.value then
|
||||
uiobjs.Background.color = Color.white
|
||||
uiobjs.Label.color = ColorEx.getColor(0xff2990dc)
|
||||
else
|
||||
uiobjs.Background.color = ColorEx.getColor(153, 153, 153)
|
||||
uiobjs.Label.color = ColorEx.getColor(153, 153, 153)
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
_cell.refreshState()
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 584abe18673e54467a28a58cabbdc22d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
-- 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
|
||||
uiobjs.bg = csSelf:GetComponent("UISprite")
|
||||
uiobjs.SpriteIcon = getCC(transform, "SpriteIcon", "UISprite")
|
||||
uiobjs.LabelName = getCC(transform, "LabelName", "UILabel")
|
||||
uiobjs.LabelState = getCC(transform, "LabelState", "UILabel")
|
||||
uiobjs.SpriteState = getCC(uiobjs.LabelState.transform, "SpriteState", "UISprite")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
-- uiobjs.SpriteIcon.spriteName = ""
|
||||
uiobjs.LabelName.text = mData.company_name
|
||||
_cell.selected(false)
|
||||
end
|
||||
|
||||
function _cell.selected(val)
|
||||
if val then
|
||||
uiobjs.bg.color = ColorEx.getColor(0xff2990dc)
|
||||
uiobjs.SpriteIcon.color = Color.white
|
||||
uiobjs.LabelName.color = Color.white
|
||||
-- uiobjs.LabelState.color = Color.white
|
||||
uiobjs.LabelState.text = "已进入"
|
||||
uiobjs.SpriteState.color = ColorEx.getColor(0xff1971b8)
|
||||
else
|
||||
uiobjs.bg.color = ColorEx.getColor(0xfff4f4f4)
|
||||
uiobjs.SpriteIcon.color = ColorEx.getColor(0xff2990dc)
|
||||
uiobjs.LabelName.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.LabelState.text = "未进入"
|
||||
-- uiobjs.LabelState.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.SpriteState.color = ColorEx.getColor(0xffcccccc)
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5aa37c501f07408b8b5a81624f825cd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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(0xff2990dc)
|
||||
else
|
||||
uiobjs.bg.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.Label.color = ColorEx.getColor(0xff999999)
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d5b176eb48a524ecba3f4e4e95603880
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,86 @@
|
||||
---@class _ParamCellCustFilterGroup
|
||||
---@field title
|
||||
---@field panel TRPCustFilter
|
||||
---@field list
|
||||
|
||||
-- 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
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.LabelTitle.text = mData.title
|
||||
selectedCells = {}
|
||||
cells = {}
|
||||
CLUIUtl.resetList4Lua(uiobjs.grid, uiobjs.gridPrefab, mData.list, _cell.initCell)
|
||||
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
|
||||
mData.panel:refreshFilterBtnStatus()
|
||||
end
|
||||
end
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ac5c1a0c6c1b467e8371305ca26efd8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,56 @@
|
||||
-- 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
|
||||
-- uiobjs.LabelCompanyName = getCC(transform, "LabelCompanyName", "UILabel")
|
||||
-- uiobjs.LabelTime = getCC(transform, "LabelTime", "UILabel")
|
||||
---@type UIPopupList
|
||||
uiobjs.LabelStatus = getCC(transform, "LabelStatus", "UIPopupList")
|
||||
-- uiobjs.LabelCustName = getCC(transform, "LabelCustName", "UILabel")
|
||||
-- uiobjs.SpriteStatus = getCC(transform, "SpriteStatus", "UISprite")
|
||||
-- uiobjs.LabelServerNo = getCC(transform, "LabelServerNo", "UILabel")
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
|
||||
uiobjs.SpriteStatus = getChild(transform, "SpriteStatus")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
mData.lastFollowUpTime = isNilOrEmpty(mData.lastFollowUpTime) and "无" or mData.lastFollowUpTime
|
||||
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
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonFollow" then
|
||||
elseif goName == "ButtonTask" then
|
||||
elseif goName == "ButtonContact" then
|
||||
MyUtl.callCust(mData)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a638791df10c24243889127c08cff35f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
---@type _DBTaskCust
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
uiobjs.LabelName = getCC(transform, "LabelName", "UILabel")
|
||||
uiobjs.LabelTime = getCC(transform, "LabelTime", "UILabel")
|
||||
uiobjs.SpriteReddot = getChild(transform, "SpriteReddot").gameObject
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.LabelName.text = mData.custName
|
||||
uiobjs.LabelTime.text = DateEx.formatByMs(mData.bookingtime)
|
||||
SetActive(uiobjs.SpriteReddot, mData.bookingDone == DBMessage.BookingDone.effect)
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75a61a1b2b23c4148b1bab590b0f9fc5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
-- 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
|
||||
--[[
|
||||
上的组件:getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
|
||||
--]]
|
||||
uiobjs.sprite = csSelf:GetComponent("UISprite")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
if mData.value then
|
||||
uiobjs.sprite.color = ColorEx.getColor(0xffFFC000)
|
||||
CLUIUtl.setSpriteFit(uiobjs.sprite, "cust_full_star")
|
||||
else
|
||||
uiobjs.sprite.color = ColorEx.getColor(0xffd9d9d9)
|
||||
CLUIUtl.setSpriteFit(uiobjs.sprite, "cust_star")
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a7228ecb8f2e4386a6fee7ac39c2e8b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,164 @@
|
||||
---@class _ParamFieldAttr
|
||||
---@field attrType
|
||||
---@field ifMust
|
||||
---@field attrName
|
||||
---@field attrValue
|
||||
---@field id
|
||||
---@field checkMin
|
||||
---@field checkMax
|
||||
|
||||
---@class _ParamCellExtendField
|
||||
---@field
|
||||
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
---@type _ParamFieldAttr
|
||||
local attr
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
---@type UISprite
|
||||
uiobjs.spriteBg = csSelf:GetComponent("UISprite")
|
||||
if uiobjs.spriteBg == nil then
|
||||
uiobjs.spriteBg = getCC(transform, "Background", "UISprite")
|
||||
end
|
||||
|
||||
if uiobjs.spriteBg then
|
||||
uiobjs.spriteBg.width = NumEx.getIntPart(CSPMain.contentRect.z)
|
||||
end
|
||||
|
||||
uiobjs.boxCollider = csSelf:GetComponent("BoxCollider")
|
||||
---@type UIInput
|
||||
uiobjs.input = csSelf:GetComponent("UIInput")
|
||||
---@type CLUIElement
|
||||
uiobjs.element = csSelf:GetComponent("CLUIElement")
|
||||
---@type UIPopupList
|
||||
uiobjs.popList = csSelf:GetComponent("UIPopupList")
|
||||
---@type CLUICheckbox
|
||||
uiobjs.checkbox = csSelf:GetComponent("CLUICheckbox")
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
uiobjs.inputLabel = uiobjs.Label and uiobjs.Label.text or ""
|
||||
uiobjs.Label2 = getCC(transform, "Label2", "UILabel")
|
||||
uiobjs.Label4 = getCC(transform, "Label4", "UILabel")
|
||||
uiobjs.SpriteRight = getCC(transform, "SpriteRight", "UISprite")
|
||||
uiobjs.ButtonReset = getCC(transform, "ButtonReset", "MyInputReset")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
attr = mData.attr
|
||||
|
||||
if data.isEditMode then
|
||||
_cell.enabeldObj(uiobjs.boxCollider, true)
|
||||
if uiobjs.Label then
|
||||
uiobjs.Label.text = uiobjs.inputLabel
|
||||
end
|
||||
if uiobjs.input then
|
||||
uiobjs.input.defaultText = uiobjs.inputLabel
|
||||
end
|
||||
_cell.enabeldObj(uiobjs.Label4, true)
|
||||
_cell.enabeldObj(uiobjs.SpriteRight, true)
|
||||
if uiobjs.ButtonReset then
|
||||
uiobjs.ButtonReset.disabled = false
|
||||
end
|
||||
else
|
||||
_cell.enabeldObj(uiobjs.boxCollider, false)
|
||||
if uiobjs.Label then
|
||||
uiobjs.Label.text = ""
|
||||
end
|
||||
if uiobjs.input then
|
||||
uiobjs.input.defaultText = ""
|
||||
end
|
||||
_cell.enabeldObj(uiobjs.Label4, false)
|
||||
_cell.enabeldObj(uiobjs.SpriteRight, false)
|
||||
|
||||
if uiobjs.ButtonReset then
|
||||
uiobjs.ButtonReset.disabled = true
|
||||
end
|
||||
end
|
||||
|
||||
local jsonKey = joinStr(attr.id, "_", attr.attrName)
|
||||
if uiobjs.element then
|
||||
uiobjs.element.valueIsNumber = false
|
||||
uiobjs.element.isPhoneNum = false
|
||||
uiobjs.element.canNull = (attr.ifMust == 1 and false or true)
|
||||
uiobjs.element.jsonKey = jsonKey
|
||||
uiobjs.element.labeName.text = attr.attrName
|
||||
elseif uiobjs.checkbox then
|
||||
uiobjs.checkbox.canNull = (attr.ifMust == 1 and false or true)
|
||||
uiobjs.checkbox.jsonKey = jsonKey
|
||||
uiobjs.checkbox.labeName.text = attr.attrName
|
||||
end
|
||||
|
||||
_cell.enabeldObj(uiobjs.input, true)
|
||||
if attr.attrType == DBCust.FieldType.text then
|
||||
uiobjs.input.keyboardType = UIInput.KeyboardType.Default
|
||||
elseif attr.attrType == DBCust.FieldType.number then
|
||||
uiobjs.input.keyboardType = UIInput.KeyboardType.NumberPad
|
||||
uiobjs.element.valueIsNumber = true
|
||||
elseif attr.attrType == DBCust.FieldType.phone then
|
||||
uiobjs.input.keyboardType = UIInput.KeyboardType.PhonePad
|
||||
uiobjs.element.isPhoneNum = true
|
||||
elseif attr.attrType == DBCust.FieldType.multext then
|
||||
uiobjs.input.keyboardType = UIInput.KeyboardType.Default
|
||||
elseif attr.attrType == DBCust.FieldType.dateTime then
|
||||
_cell.enabeldObj(uiobjs.input, false)
|
||||
elseif attr.attrType == DBCust.FieldType.checkbox then
|
||||
_cell.enabeldObj(uiobjs.input, false)
|
||||
local max = tonumber(attr.checkMax) or 0
|
||||
uiobjs.checkbox.isMultMode = (max > 1) or (max == 0)
|
||||
uiobjs.checkbox:init(attr)
|
||||
elseif attr.attrType == DBCust.FieldType.popuplist then
|
||||
_cell.enabeldObj(uiobjs.input, false)
|
||||
local strs = strSplit(attr.attrValue, "|")
|
||||
local array = ArrayList()
|
||||
array:Add("")
|
||||
for i, v in ipairs(strs) do
|
||||
array:Add(v)
|
||||
end
|
||||
uiobjs.popList:refreshItems(array, array)
|
||||
end
|
||||
end
|
||||
|
||||
function _cell.enabeldObj(obj, val)
|
||||
if obj then
|
||||
obj.enabled = val
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
if attr.attrType == DBCust.FieldType.multext then
|
||||
-- 说明大文本框改变了
|
||||
mData.parent.onMultTextInputChg()
|
||||
NGUITools.AddWidgetCollider(csSelf.gameObject, false)
|
||||
uiobjs.Label4.enabled = (uiobjs.element.value == "" and true or false)
|
||||
end
|
||||
end
|
||||
|
||||
function _cell.onNotifyLua(go)
|
||||
if
|
||||
attr.attrType == DBCust.FieldType.popuplist or attr.attrType == DBCust.FieldType.checkbox or
|
||||
attr.attrType == DBCust.FieldType.dateTime
|
||||
then
|
||||
Utl.doCallback(mData.onSelect, csSelf.gameObject)
|
||||
else
|
||||
Utl.doCallback(mData.onClick, csSelf.gameObject)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f702a2f309df7411399008841f82674a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,127 @@
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
---@type _DBCust
|
||||
local cust
|
||||
local fields
|
||||
local fieldsObjs = {}
|
||||
local isEditMode = true
|
||||
local taskId = nil
|
||||
local isFieldLoading = false
|
||||
local oldtaskId
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
|
||||
---@type UITable
|
||||
uiobjs.Table = csSelf:GetComponent("UITable")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
cust = data.data or {}
|
||||
isEditMode = data.isEditMode
|
||||
_cell.release()
|
||||
local taskId = tostring(cust.taskId)
|
||||
if (not isFieldLoading) or taskId ~= oldtaskId then
|
||||
isFieldLoading = true
|
||||
oldtaskId = taskId
|
||||
fields = DBCust.getFieldsByTask(taskId)
|
||||
if fields and #fields > 0 then
|
||||
showHotWheel()
|
||||
_cell.initField(1, taskId)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function _cell.initField(index, taskId)
|
||||
if taskId ~= oldtaskId then
|
||||
return
|
||||
end
|
||||
local fileAttr = fields[index]
|
||||
local name = ""
|
||||
if fileAttr.attrType == DBCust.FieldType.popuplist then
|
||||
name = "InputPoplist"
|
||||
elseif fileAttr.attrType == DBCust.FieldType.dateTime then
|
||||
name = "InputDate"
|
||||
elseif fileAttr.attrType == DBCust.FieldType.multext then
|
||||
name = "InputMultText"
|
||||
elseif fileAttr.attrType == DBCust.FieldType.checkbox then
|
||||
name = "InputCheckboxs"
|
||||
else
|
||||
name = "InputText"
|
||||
end
|
||||
CLUIOtherObjPool.borrowObjAsyn(name, _cell.onLoadField, {index = index, taskId = taskId})
|
||||
end
|
||||
|
||||
---@param go UnityEngine.GameObject
|
||||
function _cell.onLoadField(name, go, orgs)
|
||||
local index = orgs.index
|
||||
local taskId = orgs.taskId
|
||||
if taskId ~= oldtaskId then
|
||||
hideHotWheel()
|
||||
CLUIOtherObjPool.returnObj(go)
|
||||
SetActive(go, false)
|
||||
return
|
||||
end
|
||||
go.transform.parent = transform
|
||||
go.transform.localScale = Vector3.one
|
||||
go.transform.localEulerAngles = Vector3.zero
|
||||
local fileAttr = fields[index]
|
||||
local cell = go:GetComponent("CLCellLua")
|
||||
SetActive(go, true)
|
||||
cell:init(
|
||||
{
|
||||
attr = fileAttr,
|
||||
parent = _cell,
|
||||
isEditMode = isEditMode,
|
||||
onClick = mData.onClick,
|
||||
onSelect = mData.onSelect
|
||||
},
|
||||
nil
|
||||
)
|
||||
table.insert(fieldsObjs, cell)
|
||||
uiobjs.Table:Reposition()
|
||||
if index == #fields then
|
||||
_cell.onFinisInitFields()
|
||||
else
|
||||
_cell.initField(index + 1, taskId)
|
||||
end
|
||||
end
|
||||
|
||||
function _cell.onFinisInitFields()
|
||||
isFieldLoading = false
|
||||
uiobjs.Table:Reposition()
|
||||
uiobjs.formRoot:setValue(cust.jsonstr)
|
||||
Utl.doCallback(mData.onFinish)
|
||||
hideHotWheel()
|
||||
end
|
||||
|
||||
function _cell.release()
|
||||
for i, v in ipairs(fieldsObjs) do
|
||||
SetActive(v.gameObject, false)
|
||||
CLUIOtherObjPool.returnObj(v.gameObject)
|
||||
end
|
||||
fieldsObjs = {}
|
||||
end
|
||||
|
||||
function _cell.onMultTextInputChg()
|
||||
uiobjs.Table.repositionNow = true
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de0b061c450a64f2f8b8e883fe6b9885
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
---@class _ParamCellMessageGroup
|
||||
---@field public icon string
|
||||
---@field public bgColor number
|
||||
---@field public type number
|
||||
---@field public name string
|
||||
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
---@type _ParamCellMessageGroup
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
uiobjs.LabelNewest = getCC(transform, "LabelNewest", "UILabel")
|
||||
uiobjs.LabelTime = getCC(transform, "LabelTime", "UILabel")
|
||||
uiobjs.LabelReddotNum = getCC(transform, "LabelReddotNum", "UILabel")
|
||||
uiobjs.SpriteIconBg = getCC(transform, "SpriteIconBg", "UISprite")
|
||||
uiobjs.Icon = getCC(uiobjs.SpriteIconBg.transform, "Icon", "UISprite")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.Label.text = mData.name
|
||||
uiobjs.SpriteIconBg.color = ColorEx.getColor(mData.bgColor)
|
||||
uiobjs.Icon.spriteName = mData.icon
|
||||
if mData.type == DBMessage.MsgType.Sys then
|
||||
---@type _DBMessage
|
||||
local newestMsg = DBMessage.getNewestMessage(mData.type)
|
||||
uiobjs.LabelNewest.text = newestMsg and newestMsg.CONTENT or ""
|
||||
if newestMsg then
|
||||
local time = tonumber(newestMsg.CREATETIME) or 0
|
||||
uiobjs.LabelTime.text = DateEx.ToTimeCost(DateEx.nowMS - time * 1000)
|
||||
else
|
||||
uiobjs.LabelTime.text = ""
|
||||
end
|
||||
elseif mData.type == DBMessage.MsgType.Task then
|
||||
---@type _DBTaskCust
|
||||
-- local newestMsg = DBMessage.getNewestMessage(mData.type)
|
||||
-- local time = tonumber(newestMsg.createtime) or 0
|
||||
uiobjs.LabelTime.text = "" --DateEx.ToTimeCost(DateEx.nowMS - time * 1000)
|
||||
local num = DBMessage.getUnreadNum(mData.type)
|
||||
uiobjs.LabelNewest.text = joinStr("您有", num, "代办任务未处理")
|
||||
end
|
||||
|
||||
if DBMessage.getUnreadNum(mData.type) > 0 then
|
||||
local unreadNum = DBMessage.getUnreadNum(mData.type) or 0
|
||||
if unreadNum and unreadNum > 9 then
|
||||
uiobjs.LabelReddotNum.text = "…"
|
||||
else
|
||||
uiobjs.LabelReddotNum.text = joinStr(unreadNum)
|
||||
end
|
||||
SetActive(uiobjs.LabelReddotNum.gameObject, true)
|
||||
else
|
||||
SetActive(uiobjs.LabelReddotNum.gameObject, false)
|
||||
end
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 908ed969d14cf44e1ab60d7cf0d76dc5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,59 @@
|
||||
---@class _ParamPopCheckbox
|
||||
---@field label
|
||||
---@field isMultMode
|
||||
---@field checked
|
||||
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
---@type _ParamPopCheckbox
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
---@type UIToggle
|
||||
uiobjs.toggle = getCC(transform, "Toggle", "UIToggle")
|
||||
uiobjs.toggleBg = uiobjs.toggle:GetComponent("UISprite")
|
||||
uiobjs.toggleCheckMark = getCC(uiobjs.toggle.transform, "Checkmark", "UISprite")
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.Label.text = mData.label
|
||||
if mData.isMultMode then
|
||||
uiobjs.toggle.group = 0
|
||||
CLUIUtl.setSpriteFit(uiobjs.toggleBg, "public_check")
|
||||
CLUIUtl.setSpriteFit(uiobjs.toggleCheckMark, "public_check_full")
|
||||
else
|
||||
uiobjs.toggle.group = 909090
|
||||
CLUIUtl.setSpriteFit(uiobjs.toggleBg, "public_radio")
|
||||
CLUIUtl.setSpriteFit(uiobjs.toggleCheckMark, "public_radio_full")
|
||||
end
|
||||
uiobjs.toggle:Set(mData.checked)
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
mData.checked = uiobjs.toggle.value
|
||||
if mData.checked then
|
||||
uiobjs.Label.color = ColorEx.getColor(0xff2990dc)
|
||||
else
|
||||
uiobjs.Label.color = ColorEx.getColor(0xff363636)
|
||||
end
|
||||
mData.panel:onClickToggle()
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f80e16a8f2774d65bfd72659fc0b0fc
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
-- 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 UIButton
|
||||
uiobjs.ButtonPlayVoice = getCC(transform, "ButtonPlayVoice", "UIButton")
|
||||
uiobjs.LabelLen = getCC(transform, "LabelLen", "UILabel")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.formRoot:setValue(mData)
|
||||
uiobjs.ButtonPlayVoice.isEnabled = (not isNilOrEmpty(mData.recordfile))
|
||||
|
||||
uiobjs.LabelLen.text = joinStr("录音:", DateEx.toStrCn(tonumber(mData.answertime)*1000))
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
function _cell.uiEventDelegate(go)
|
||||
if go.name == "ButtonPlayVoice" then
|
||||
getPanelAsy("PanelPlaySoundRecord", onLoadedPanelTT, mData)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f985b8ea3fc7f4fc19eac1d5775794ea
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,143 @@
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
local colors = {0xff2990dc, 0xffE74C3C, 0xff27EA60, 0xffF39C12}
|
||||
local fromPosCache = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
uiobjs.grid = getCC(transform, "grid", "UIGrid")
|
||||
uiobjs.prefab = getChild(uiobjs.grid.transform, "00000").gameObject
|
||||
uiobjs.cells = {}
|
||||
uiobjs.lines = {}
|
||||
uiobjs.persentLbs = {}
|
||||
for i = 1, 4 do
|
||||
local path = joinStr("cell", i, "/Sprite")
|
||||
uiobjs.cells[i] = getCC(transform, path, "UISprite")
|
||||
uiobjs.lines[i] = getCC(transform, "SpriteLine" .. i, "UISprite")
|
||||
uiobjs.persentLbs[i] = getCC(transform, "LabelPersent" .. i, "UILabel")
|
||||
end
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
-- mData = data
|
||||
DBStatistics.custtype_report(
|
||||
function(content)
|
||||
if content.success then
|
||||
_cell.refreshContent(content.result)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function _cell.getNearestFromPos(fromPos)
|
||||
local minY = 10000
|
||||
local result
|
||||
for i, v in ipairs(fromPosCache) do
|
||||
if (fromPos.x <= 0 and v.x <= 0) or (fromPos.x > 0 and v.x > 0) then
|
||||
local diffY = math.abs(fromPos.y - v.y)
|
||||
if diffY < minY then
|
||||
minY = diffY
|
||||
result = v
|
||||
end
|
||||
end
|
||||
end
|
||||
return result, minY
|
||||
end
|
||||
|
||||
function _cell.getFromPos(dis, angle)
|
||||
if dis < 10 then
|
||||
return nil
|
||||
end
|
||||
local fromPos = AngleEx.getCirclePointV2(Vector2.zero, dis, angle)
|
||||
local nearestPos, minY = _cell.getNearestFromPos(fromPos)
|
||||
if nearestPos and minY < 30 then
|
||||
fromPos = _cell.getFromPos(dis - 10, angle) or fromPos
|
||||
end
|
||||
table.insert(fromPosCache, fromPos)
|
||||
return fromPos
|
||||
end
|
||||
|
||||
function _cell.refreshContent(list)
|
||||
-- list = {0.05, 0.35, 0.2, 0.4}
|
||||
---@type UISprite
|
||||
local sprite
|
||||
local amoutCount = 0
|
||||
|
||||
fromPosCache = {}
|
||||
for i, v in ipairs(list) do
|
||||
v.i = i -- 方便后面用
|
||||
local name = v.name
|
||||
local persentValStr = v.value
|
||||
local persentVal = tonumber(v.value) / 100
|
||||
local line = uiobjs.lines[i]
|
||||
local lb = uiobjs.persentLbs[i]
|
||||
sprite = uiobjs.cells[i]
|
||||
if persentVal > 0 then
|
||||
local color = ColorEx.getColor(colors[i])
|
||||
sprite.color = color
|
||||
sprite.fillAmount = persentVal
|
||||
sprite.transform.parent.localEulerAngles = Vector3(0, 0, -360 * amoutCount)
|
||||
-- 画线
|
||||
---@type UnityEngine.Vector3
|
||||
-- local fromPos = AngleEx.getCirclePointV2(Vector2.zero, 160, 90 - (amoutCount + persentVal / 2) * 360)
|
||||
local fromPos = _cell.getFromPos(160, 90 - (amoutCount + persentVal / 2) * 360)
|
||||
fromPos = Vector3(fromPos.x, fromPos.y, 0)
|
||||
|
||||
-- if i % 2 ~= 0 then
|
||||
-- sprite.transform.parent.localPosition = Vector3.zero
|
||||
-- else
|
||||
-- sprite.transform.parent.localPosition = fromPos.normalized * 5
|
||||
-- end
|
||||
|
||||
local toPos
|
||||
local maxX = 300
|
||||
if fromPos.x > 0 then
|
||||
toPos = Vector3(maxX, fromPos.y, 0)
|
||||
else
|
||||
toPos = fromPos
|
||||
fromPos = Vector3(-maxX, fromPos.y, 0)
|
||||
end
|
||||
line.transform.localPosition = fromPos
|
||||
line.width = NumEx.getIntPart(toPos.x - fromPos.x)
|
||||
|
||||
lb.text = joinStr(persentValStr, "%")
|
||||
if fromPos.x > 0 then
|
||||
lb.transform.localPosition = toPos + Vector3.right * 60
|
||||
else
|
||||
lb.transform.localPosition = fromPos + Vector3.left * 60
|
||||
end
|
||||
-- lb.color = color
|
||||
SetActive(line.gameObject, true)
|
||||
-----------
|
||||
amoutCount = amoutCount + persentVal -- 这句一定要放到最后
|
||||
else
|
||||
SetActive(line.gameObject, false)
|
||||
lb.text = ""
|
||||
end
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.grid, uiobjs.prefab, list, _cell.initCell)
|
||||
end
|
||||
|
||||
function _cell.initCell(cell, data)
|
||||
local label = cell:GetComponent("UILabel")
|
||||
local SpriteColor = getCC(cell.transform, "SpriteColor", "UISprite")
|
||||
label.text = data.name
|
||||
SpriteColor.color = ColorEx.getColor(colors[data.i])
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34e3a1e1a7e804adbb4a520eca21ddd9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,84 @@
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
local maxHeigth = 70 * 7
|
||||
local maxValue
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
uiobjs.gridX = getCC(transform, "gridX", "UIGrid")
|
||||
uiobjs.PrefabX = getChild(uiobjs.gridX.transform, "00000").gameObject
|
||||
uiobjs.gridY = getCC(transform, "gridY", "UIGrid")
|
||||
uiobjs.PrefabY = getChild(uiobjs.gridY.transform, "00000").gameObject
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
maxValue = nil
|
||||
DBStatistics.order_report(
|
||||
function(content)
|
||||
if content.success then
|
||||
_cell.refreshContent(content.result)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function _cell.refreshContent(list)
|
||||
for i, v in ipairs(list) do
|
||||
if maxValue == nil or maxValue < tonumber(v.value) then
|
||||
maxValue = tonumber(v.value)
|
||||
end
|
||||
end
|
||||
local len = #(tostring(NumEx.getIntPart(maxValue)))
|
||||
local offsetNum = 10 ^ (len - 1)
|
||||
maxValue = maxValue + offsetNum
|
||||
maxValue = NumEx.getIntPart(maxValue / offsetNum) * offsetNum
|
||||
local offset = math.ceil(maxValue / 7)
|
||||
offset = math.ceil(offset / 10) * 10
|
||||
maxValue = offset * 7
|
||||
|
||||
local listY = {}
|
||||
for i = 0, 7 do
|
||||
table.insert(listY, {name = NumEx.getIntPart(i * offset)})
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.gridX, uiobjs.PrefabX, list, _cell.initCellX)
|
||||
CLUIUtl.resetList4Lua(uiobjs.gridY, uiobjs.PrefabY, listY, _cell.initCellY)
|
||||
end
|
||||
|
||||
function _cell.initCellX(cell, data)
|
||||
local lb = cell:GetComponent("UILabel")
|
||||
local lbValue = getCC(cell.transform, "Label", "UILabel")
|
||||
---@type UISprite
|
||||
local spVal = getCC(cell.transform, "SpriteVal", "UISprite")
|
||||
lb.text = data.xlabel
|
||||
if tonumber(data.value) <= 0 then
|
||||
lbValue.text = ""
|
||||
SetActive(spVal.gameObject, false)
|
||||
else
|
||||
SetActive(spVal.gameObject, true)
|
||||
spVal.height = NumEx.getIntPart((tonumber(data.value) / maxValue) * maxHeigth)
|
||||
lbValue.text = joinStr("¥", data.value)
|
||||
end
|
||||
end
|
||||
|
||||
function _cell.initCellY(cell, data)
|
||||
local lb = cell:GetComponent("UILabel")
|
||||
lb.text = data.name
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1dd566172f844843b75aad2a840b2e9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
-- 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 UISprite
|
||||
uiobjs.SpritePersent = getCC(transform, "SpritePersent", "UISprite")
|
||||
uiobjs.LabelPersent = getCC(transform, "LabelPersent", "UILabel")
|
||||
uiobjs.gapLb = getCC(transform, "grid/00002", "UILabel")
|
||||
---@type CLUIElement
|
||||
uiobjs.gapLbEl = uiobjs.gapLb:GetComponent("CLUIElement")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = {}
|
||||
DBStatistics.target_report(
|
||||
function(content)
|
||||
if content.success then
|
||||
local mData = {}
|
||||
for i, v in ipairs(content.result) do
|
||||
if v.name == "目标" then
|
||||
mData.target = tonumber(v.value)
|
||||
elseif v.name == "已完成" then
|
||||
mData.finished = tonumber(v.value)
|
||||
end
|
||||
end
|
||||
mData.finishPersent = mData.target == 0 and 0 or (mData.finished / mData.target) * 100
|
||||
mData.gap = mData.target - mData.finished
|
||||
if mData.gap < 0 then
|
||||
uiobjs.gapLb.color = ColorEx.getColor(0xff1D9100)
|
||||
uiobjs.gapLbEl.formatValue = "超额:{0}"
|
||||
else
|
||||
uiobjs.gapLb.color = ColorEx.getColor(0xffFF0000)
|
||||
uiobjs.gapLbEl.formatValue = "缺口:{0}"
|
||||
end
|
||||
mData.gap = math.abs(mData.gap)
|
||||
|
||||
uiobjs.SpritePersent.fillAmount = mData.finishPersent / 100
|
||||
|
||||
uiobjs.formRoot:setValue(mData)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 050a485398a51430cbf9e0ecc47b691f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
-- xx单元
|
||||
local _cell = {}
|
||||
---@type Coolape.CLCellLua
|
||||
local csSelf = nil
|
||||
local transform
|
||||
---@type _DBMessage
|
||||
local mData = nil
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只调用一次
|
||||
function _cell.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csSelf.transform
|
||||
uiobjs.LabelStatus = getCC(transform, "LabelStatus", "UILabel")
|
||||
uiobjs.LabelTitle = getCC(transform, "LabelTitle", "UILabel")
|
||||
uiobjs.LabelTime = getCC(transform, "LabelTime", "UILabel")
|
||||
uiobjs.LabelContent = getCC(transform, "LabelContent", "UILabel")
|
||||
uiobjs.SpriteReddot = getCC(transform, "SpriteReddot", "UISprite")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.LabelStatus.text = mData.READFLAG == DBMessage.ReadFlag.unread and "未读" or "已读"
|
||||
SetActive(uiobjs.SpriteReddot.gameObject, mData.READFLAG == DBMessage.ReadFlag.unread)
|
||||
uiobjs.LabelTitle.text = mData.TITLE
|
||||
local time = mData.CREATETIME
|
||||
if time then
|
||||
uiobjs.LabelTime.text = DateEx.formatByMs(time * 1000)
|
||||
else
|
||||
uiobjs.LabelTime.text = ""
|
||||
end
|
||||
uiobjs.LabelContent.text = mData.CONTENT
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 515b437e8e7514a3cb26ed27ba028384
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel.meta
Normal file
9
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5048ab22937c940eca51fa6d09303534
|
||||
folderAsset: yes
|
||||
timeCreated: 1498220621
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
-- 页面档板
|
||||
do
|
||||
local csSelf = nil;
|
||||
local transform = nil;
|
||||
local gameObject = nil;
|
||||
local lastClickTime = 0; -- 上一次点击时间
|
||||
|
||||
local CLLPBackplate = {}
|
||||
|
||||
function CLLPBackplate.init(go)
|
||||
csSelf = go;
|
||||
transform = csSelf.transform;
|
||||
gameObject = csSelf.gameObject;
|
||||
end
|
||||
|
||||
function CLLPBackplate.setData(pars)
|
||||
end
|
||||
|
||||
function CLLPBackplate.show()
|
||||
end
|
||||
|
||||
function CLLPBackplate.hide()
|
||||
end
|
||||
|
||||
function CLLPBackplate.refresh()
|
||||
end
|
||||
|
||||
function CLLPBackplate.procNetwork(cmd, succ, msg, pars)
|
||||
end
|
||||
|
||||
function CLLPBackplate.OnClickBackplate(button)
|
||||
--[[
|
||||
local currTime = DateEx.nowMS;
|
||||
if ((currTime - lastClickTime) / 1000 < 0.3) then -- 保证在短时间内只能点击一次
|
||||
return;
|
||||
end
|
||||
lastClickTime = currTime;
|
||||
CLPanelManager.hideTopPanel();
|
||||
--]]
|
||||
end
|
||||
|
||||
return CLLPBackplate;
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d16585295247e4b1aa0765ae4cce6804
|
||||
timeCreated: 1498220629
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,243 @@
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local gameObject = nil
|
||||
local grid = nil
|
||||
|
||||
local LabelYY = nil
|
||||
local LabelMM = nil
|
||||
local curYear = nil
|
||||
local curMonth = nil
|
||||
local TimeRoot
|
||||
local ButtonRoot
|
||||
local InputHH
|
||||
local InputMM
|
||||
local InputSS
|
||||
|
||||
local LabelSelectDate
|
||||
|
||||
local callback = nil
|
||||
|
||||
local selectedYear
|
||||
local selectedMonth
|
||||
local selectedDay
|
||||
|
||||
local oldSelectedCell
|
||||
local isNeedTime = false
|
||||
local curIndex = 0
|
||||
|
||||
PanelCalender = {}
|
||||
function PanelCalender.init(_cs)
|
||||
csSelf = _cs
|
||||
transform = csSelf.transform
|
||||
gameObject = csSelf.gameObject
|
||||
|
||||
local content = getChild(transform, "content")
|
||||
LabelYY = getChild(content, "Title", "LabelYY"):GetComponent("UILabel")
|
||||
LabelMM = getChild(content, "Title", "LabelMM"):GetComponent("UILabel")
|
||||
grid = getChild(content, "PanelDay/GridPage"):GetComponent("UIGridPage")
|
||||
LabelSelectDate = getChild(content, "LabelSelectDate"):GetComponent("UILabel")
|
||||
|
||||
ButtonRoot = getChild(content, "ButtonRoot")
|
||||
TimeRoot = getChild(content, "TimeRoot")
|
||||
InputHH = getChild(TimeRoot, "InputHH"):GetComponent("UIPopupList")
|
||||
InputMM = getChild(TimeRoot, "InputMM"):GetComponent("UIPopupList")
|
||||
InputSS = getChild(TimeRoot, "InputSS"):GetComponent("UIPopupList")
|
||||
end
|
||||
|
||||
function PanelCalender.setData(pars)
|
||||
curYear = pars[0]
|
||||
curMonth = pars[1]
|
||||
callback = pars[2]
|
||||
if (pars.Count > 3) then
|
||||
isNeedTime = pars[3]
|
||||
else
|
||||
isNeedTime = false
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.getData()
|
||||
return curYear, curMonth
|
||||
end
|
||||
|
||||
function PanelCalender.show()
|
||||
csSelf.panel.depth = CLPanelManager.self.depth + 80
|
||||
|
||||
oldSelectedCell = nil
|
||||
selectedYear = nil
|
||||
selectedMonth = nil
|
||||
selectedDay = nil
|
||||
if (isNeedTime) then
|
||||
NGUITools.SetActive(TimeRoot.gameObject, true)
|
||||
InputHH.value = NumEx.nStrForLen(DateTime.Now.Hour, 2)
|
||||
InputMM.value = NumEx.nStrForLen(DateTime.Now.Minute, 2)
|
||||
InputSS.value = NumEx.nStrForLen(DateTime.Now.Second, 2)
|
||||
ButtonRoot.localPosition = Vector3(0, -627, 0)
|
||||
else
|
||||
NGUITools.SetActive(TimeRoot.gameObject, false)
|
||||
ButtonRoot.localPosition = TimeRoot.localPosition
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.refresh()
|
||||
PanelCalender.showCalender(curYear, curMonth)
|
||||
if (selectedYear ~= nil) then
|
||||
local dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
LabelSelectDate.text = dataStr
|
||||
else
|
||||
LabelSelectDate.text = ""
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.getYYHH_ByaddMonth(_year, _month, addMonth)
|
||||
local date = DateTime(_year, _month, 1)
|
||||
|
||||
date = date:AddMonths(addMonth)
|
||||
|
||||
return date.Year, date.Month
|
||||
end
|
||||
|
||||
function PanelCalender.showCalender(year, month)
|
||||
LabelYY.text = year .. "年"
|
||||
LabelMM.text = month .. "月"
|
||||
|
||||
local months = ArrayList()
|
||||
local d
|
||||
local yy, mm
|
||||
for i = 1, 6 do
|
||||
yy, mm = PanelCalender.getYYHH_ByaddMonth(year, month, -(7 - i))
|
||||
d = {}
|
||||
d.year = yy
|
||||
d.month = mm
|
||||
months:Add(d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.year = year
|
||||
d.month = month
|
||||
months:Add(d)
|
||||
|
||||
for i = 1, 6 do
|
||||
yy, mm = PanelCalender.getYYHH_ByaddMonth(year, month, i)
|
||||
d = {}
|
||||
d.year = yy
|
||||
d.month = mm
|
||||
months:Add(d)
|
||||
end
|
||||
|
||||
grid:init(months, PanelCalender.onRefreshCurrent, 6)
|
||||
end
|
||||
|
||||
function PanelCalender.onRefreshCurrent(index, data, cell)
|
||||
curIndex = index
|
||||
local cellLua = cell:GetComponent("CLCellLua")
|
||||
local d = cellLua.luaTable.getData()
|
||||
if (d ~= nil) then
|
||||
LabelYY.text = d.year .. "年"
|
||||
LabelMM.text = d.month .. "月"
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.getSelectDate()
|
||||
return selectedYear, selectedMonth, selectedDay
|
||||
end
|
||||
|
||||
function PanelCalender.setDefalutSelectDate(cell, year, month, day)
|
||||
if (oldSelectedCell == nil) then
|
||||
oldSelectedCell = cell
|
||||
end
|
||||
if (selectedDay == nil) then
|
||||
selectedDay = day
|
||||
selectedYear = year
|
||||
selectedMonth = month
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.setSelectDate(cell, year, month, day)
|
||||
selectedDay = day
|
||||
selectedYear = year
|
||||
selectedMonth = month
|
||||
local dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
LabelSelectDate.text = dataStr
|
||||
|
||||
if (oldSelectedCell ~= nil) then
|
||||
oldSelectedCell.luaTable.refreshState(false)
|
||||
end
|
||||
oldSelectedCell = cell
|
||||
oldSelectedCell.luaTable.refreshState(true)
|
||||
end
|
||||
|
||||
-- function PanelCalender.addMonth(m)
|
||||
-- oldSelectedCell = nil;
|
||||
--
|
||||
-- local yearOffset = (curMonth + m) / 13;
|
||||
-- curMonth = (curMonth + m) % 13;
|
||||
-- if (curMonth == 0) then
|
||||
-- if (m < 0) then
|
||||
-- curMonth = 12;
|
||||
-- yearOffset = -1;
|
||||
-- else
|
||||
-- curMonth = 1;
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- curYear = curYear + math.floor(yearOffset);
|
||||
-- PanelCalender.showCalender(curYear, curMonth);
|
||||
-- return curYear, curMonth;
|
||||
-- end
|
||||
|
||||
function PanelCalender.hide()
|
||||
end
|
||||
|
||||
function PanelCalender.procNetwork(cmd, succ, msg, paras)
|
||||
end
|
||||
|
||||
function PanelCalender.uiEventDelegate(go)
|
||||
PanelCalender.onClickBtn(go.name)
|
||||
end
|
||||
|
||||
function PanelCalender.onClickBtn(btnName)
|
||||
if (btnName == "ButtonPrevMM") then
|
||||
-- PanelCalender.addMonth(-1);
|
||||
grid:moveTo(curIndex - 1)
|
||||
elseif (btnName == "ButtonNextMM") then
|
||||
-- PanelCalender.addMonth(1);
|
||||
grid:moveTo(curIndex + 1)
|
||||
elseif (btnName == "ButtonPrevYY") then
|
||||
-- PanelCalender.addMonth(-13);
|
||||
grid:moveTo(curIndex - 12)
|
||||
elseif (btnName == "ButtonNextYY") then
|
||||
-- PanelCalender.addMonth(13);
|
||||
grid:moveTo(curIndex + 12)
|
||||
elseif (btnName == "SpriteClose" or btnName == "ButtonClose") then
|
||||
CLPanelManager.hidePanel(csSelf)
|
||||
elseif btnName == "ButtonToday" then
|
||||
oldSelectedCell = nil
|
||||
curYear = DateTime.Now.Year
|
||||
curMonth = DateTime.Now.Month
|
||||
csSelf:show()
|
||||
elseif btnName == "ButtonOkay" then
|
||||
CLPanelManager.hidePanel(csSelf)
|
||||
local dataStr = ""
|
||||
if (selectedYear ~= nil) then
|
||||
dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
if (isNeedTime) then
|
||||
dataStr =
|
||||
PStr.b():a(dataStr):a(" "):a(NumEx.nStrForLen(InputHH.value, 2)):a(":"):a(
|
||||
NumEx.nStrForLen(InputMM.value, 2)
|
||||
):a(":"):a(NumEx.nStrForLen(InputSS.value, 2)):e()
|
||||
end
|
||||
end
|
||||
Utl.doCallback(callback, dataStr)
|
||||
end
|
||||
end
|
||||
|
||||
return PanelCalender
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33044b201642f4ee0bce65c554ecb7de
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,155 @@
|
||||
-- 确认提示框
|
||||
do
|
||||
local pName = nil
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local gameObject = nil
|
||||
local panelContent = nil
|
||||
local table = nil
|
||||
local LabelContent = nil
|
||||
local ButtonCancel = nil
|
||||
local ButtonOK = nil
|
||||
local lbButtonCancel = nil
|
||||
local lbButtonOK = nil
|
||||
local root
|
||||
local onClickButtonCallback1 = nil
|
||||
local onClickButtonCallback2 = nil
|
||||
local datas = Stack() -- 需要确认的消息椎
|
||||
local currData = nil
|
||||
local panelContentDepth = 1
|
||||
local buttonOkOrgPositon
|
||||
local buttonCancelOrgPositon, Spriteline2
|
||||
|
||||
local PanelConfirm = {}
|
||||
function PanelConfirm.init(go)
|
||||
pName = go.name
|
||||
csSelf = go
|
||||
transform = csSelf.transform
|
||||
gameObject = csSelf.gameObject
|
||||
root = getChild(transform, "content")
|
||||
panelContent = getChild(root, "PanelContent")
|
||||
table = getChild(panelContent, "Table")
|
||||
LabelContent = getChild(table, "LabelContent")
|
||||
LabelContent = LabelContent:GetComponent("UILabel")
|
||||
table = table:GetComponent("UITable")
|
||||
ButtonCancel = getChild(root, "ButtonCancel")
|
||||
lbButtonCancel = getChild(ButtonCancel, "Label"):GetComponent("UILabel")
|
||||
ButtonOK = getChild(root, "ButtonOK")
|
||||
lbButtonOK = getChild(ButtonOK, "Label"):GetComponent("UILabel")
|
||||
panelContent = panelContent:GetComponent("UIPanel")
|
||||
panelContentDepth = panelContent.depth
|
||||
Spriteline2 = getChild(root, "Spriteline2")
|
||||
|
||||
buttonOkOrgPositon = ButtonOK.transform.localPosition
|
||||
buttonCancelOrgPositon = ButtonCancel.transform.localPosition
|
||||
end
|
||||
|
||||
function PanelConfirm.setData(pars)
|
||||
if (pars == nil) then
|
||||
return
|
||||
end
|
||||
if (currData ~= nil and currData[0] == pars[0]) then
|
||||
return
|
||||
end -- 相同消息只弹出一次
|
||||
datas:Push(pars)
|
||||
end
|
||||
|
||||
function PanelConfirm.show()
|
||||
csSelf.panel.depth = CLUIInit.self.PanelConfirmDepth
|
||||
panelContent.depth = csSelf.panel.depth + panelContentDepth
|
||||
if datas.Count > 0 then
|
||||
currData = datas:Peek()
|
||||
else
|
||||
currData = nil
|
||||
end
|
||||
if (currData == nil or currData.Count < 6) then
|
||||
PanelConfirm.checkLeftData()
|
||||
return
|
||||
end
|
||||
local msg = currData[0]
|
||||
local isShowOneButton = currData[1]
|
||||
local lbbutton1 = currData[2]
|
||||
onClickButtonCallback1 = currData[3]
|
||||
local lbbutton2 = currData[4]
|
||||
onClickButtonCallback2 = currData[5]
|
||||
|
||||
LabelContent.text = msg
|
||||
-- 重新计算collider
|
||||
NGUITools.AddWidgetCollider(LabelContent.gameObject)
|
||||
table.repositionNow = true
|
||||
-- table:Reposition()
|
||||
lbButtonOK.text = lbbutton1
|
||||
if (isShowOneButton) then
|
||||
NGUITools.SetActive(ButtonCancel.gameObject, false)
|
||||
local pos = ButtonOK.localPosition
|
||||
pos.x = 0
|
||||
ButtonOK.localPosition = pos
|
||||
SetActive(Spriteline2.gameObject, false)
|
||||
else
|
||||
ButtonCancel.localPosition = buttonOkOrgPositon
|
||||
ButtonOK.localPosition = buttonCancelOrgPositon
|
||||
NGUITools.SetActive(ButtonCancel.gameObject, true)
|
||||
lbButtonCancel.text = lbbutton2
|
||||
SetActive(Spriteline2.gameObject, true)
|
||||
end
|
||||
|
||||
SoundEx.playSound2("Alert", 1)
|
||||
end
|
||||
|
||||
-- 当加载好通用框的回调
|
||||
function PanelConfirm.onShowFrame(cs)
|
||||
csSelf.frameObj.transform.parent = root
|
||||
csSelf.frameObj.transform.localScale = Vector3.one
|
||||
csSelf.frameObj:init({title = LGet("Tip"), panel = csSelf, hideClose = true, hideTitle = false})
|
||||
end
|
||||
|
||||
function PanelConfirm.hide()
|
||||
end
|
||||
|
||||
function PanelConfirm.refresh()
|
||||
end
|
||||
|
||||
function PanelConfirm.procNetwork(cmd, succ, msg, pars)
|
||||
end
|
||||
|
||||
function PanelConfirm.OnClickOK(button)
|
||||
if (onClickButtonCallback1 ~= nil) then
|
||||
Utl.doCallback(onClickButtonCallback1, nil)
|
||||
end
|
||||
PanelConfirm.checkLeftData()
|
||||
end
|
||||
|
||||
function PanelConfirm.OnClickCancel(button)
|
||||
if (onClickButtonCallback2 ~= nil) then
|
||||
Utl.doCallback(onClickButtonCallback2, nil)
|
||||
end
|
||||
PanelConfirm.checkLeftData()
|
||||
end
|
||||
|
||||
function PanelConfirm.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonCancel" then
|
||||
PanelConfirm.OnClickCancel(go)
|
||||
elseif goName == "ButtonOK" then
|
||||
PanelConfirm.OnClickOK(go)
|
||||
end
|
||||
end
|
||||
|
||||
function PanelConfirm.checkLeftData(...)
|
||||
if (datas.Count > 0) then
|
||||
currData = datas:Pop()
|
||||
if (currData ~= nil) then
|
||||
currData:Clear()
|
||||
currData = nil
|
||||
end
|
||||
end
|
||||
|
||||
if (datas.Count > 0) then
|
||||
csSelf:show()
|
||||
else
|
||||
csSelf:hide()
|
||||
end
|
||||
end
|
||||
|
||||
return PanelConfirm
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8465a74f030c047ecbaafd046ebbcca0
|
||||
timeCreated: 1498220629
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
-- 风火轮
|
||||
do
|
||||
local pName = nil;
|
||||
local csSelf = nil;
|
||||
local transform = nil;
|
||||
local gameObject = nil;
|
||||
local LabelMsg = nil;
|
||||
local MaxShowTime = 10; --秒
|
||||
local msg = nil;
|
||||
|
||||
local times = 0;
|
||||
local PanelHotWheel = {}
|
||||
|
||||
function PanelHotWheel.init(go)
|
||||
pName = go.name;
|
||||
csSelf = go;
|
||||
transform = csSelf.transform;
|
||||
gameObject = csSelf.gameObject;
|
||||
LabelMsg = getChild(transform, "LabelMsg"):GetComponent("UILabel");
|
||||
end
|
||||
|
||||
function PanelHotWheel.setData(pars)
|
||||
msg = pars;
|
||||
if (msg == nil or msg == "") then
|
||||
msg = Localization.Get("Loading");
|
||||
end
|
||||
end
|
||||
|
||||
function PanelHotWheel.show()
|
||||
csSelf.panel.depth = CLUIInit.self.PanelHotWheelDepth;
|
||||
times = times + 1;
|
||||
csSelf:invoke4Lua(PanelHotWheel.hideSelf, MaxShowTime);
|
||||
end
|
||||
|
||||
function PanelHotWheel.refresh()
|
||||
LabelMsg.text = msg;
|
||||
end
|
||||
|
||||
function PanelHotWheel.hideSelf(...)
|
||||
if (times <= 0) then
|
||||
times = 0;
|
||||
return;
|
||||
end
|
||||
times = times - 1;
|
||||
if (times <= 0) then
|
||||
times = 0;
|
||||
--CLAlert.add("hide PanelHotWheel==", Color.red, 2);
|
||||
csSelf:cancelInvoke4Lua();
|
||||
CLPanelManager.hidePanel(csSelf);
|
||||
else
|
||||
csSelf:invoke4Lua(PanelHotWheel.hideSelf, MaxShowTime);
|
||||
end
|
||||
end
|
||||
|
||||
function PanelHotWheel.hide()
|
||||
csSelf:cancelInvoke4Lua();
|
||||
end
|
||||
|
||||
return PanelHotWheel;
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0298629c3e86246f3b3362fa18f8785b
|
||||
timeCreated: 1498220629
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
-- xx界面
|
||||
do
|
||||
CLLPSceneManager = {}
|
||||
|
||||
local csSelf = nil;
|
||||
local transform = nil;
|
||||
local mData;
|
||||
local progressBar
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CLLPSceneManager.init(csObj)
|
||||
csSelf = csObj;
|
||||
transform = csObj.transform;
|
||||
progressBar = getCC(transform, "Progress Bar", "UIProgressBar")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CLLPSceneManager.setData(paras)
|
||||
mData = paras;
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CLLPSceneManager.show()
|
||||
progressBar.value = 0;
|
||||
if mData.mode == GameMode.city then
|
||||
CLLPSceneManager.gotoCity()
|
||||
end
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CLLPSceneManager.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLLPSceneManager.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CLLPSceneManager.procNetwork (cmd, succ, msg, paras)
|
||||
--[[
|
||||
if(succ == 1) then
|
||||
if(cmd == "xxx") then
|
||||
-- TODO:
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CLLPSceneManager.uiEventDelegate( go )
|
||||
local goName = go.name;
|
||||
--[[
|
||||
if(goName == "xxx") then
|
||||
--TODO:
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CLLPSceneManager.hideSelfOnKeyBack( )
|
||||
return false;
|
||||
end
|
||||
|
||||
|
||||
function CLLPSceneManager.gotoCity()
|
||||
CLLCity.init();
|
||||
end
|
||||
--------------------------------------------
|
||||
return CLLPSceneManager;
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b47be337d50b740c8b007bd0ec7a8b6c
|
||||
timeCreated: 1500177050
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
379
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CLLPSplash.lua
Normal file
379
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CLLPSplash.lua
Normal file
@@ -0,0 +1,379 @@
|
||||
--开始loading页面,处理资源更新、及相关初始化
|
||||
do
|
||||
---@type json
|
||||
local json = require("json.json")
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local gameObject = nil
|
||||
local progressBar = nil
|
||||
local progressBarTotal = nil
|
||||
local lbprogressBarTotal = nil
|
||||
local LabelTip = nil
|
||||
local LabelVer = nil
|
||||
local lbCustServer
|
||||
local loadedPanelCount = 0
|
||||
local server
|
||||
local user
|
||||
local bottom
|
||||
|
||||
local www4UpgradeCell = nil -- 更新时单个单元的www
|
||||
|
||||
-- 预先加载的页面(在热更新完成后,先把必要的公共页面先加载了,后面的处理可能会用到)
|
||||
local beforeLoadPanels = {
|
||||
"PanelHotWheel", -- 菊花
|
||||
"PanelBackplate", -- 背板遮罩
|
||||
"PanelConfirm", -- 确认提示页面
|
||||
"PanelMask4Panel", -- 遮挡
|
||||
"PanelWWWProgress", -- 显示网络请求资源的进度
|
||||
}
|
||||
|
||||
local CLLPSplash = {}
|
||||
|
||||
function CLLPSplash.init(go)
|
||||
csSelf = go
|
||||
transform = csSelf.transform
|
||||
gameObject = csSelf.gameObject
|
||||
bottom = getChild(transform, "Bottom")
|
||||
progressBar = getCC(bottom, "Progress Bar", "UISlider")
|
||||
NGUITools.SetActive(progressBar.gameObject, false)
|
||||
|
||||
progressBarTotal = getChild(transform, "Bottom", "Progress BarTotal")
|
||||
lbprogressBarTotal = getChild(progressBarTotal, "Thumb", "Label"):GetComponent("UILabel")
|
||||
progressBarTotal = progressBarTotal:GetComponent("UISlider")
|
||||
NGUITools.SetActive(progressBarTotal.gameObject, false)
|
||||
|
||||
LabelTip = getChild(bottom, "LabelTip")
|
||||
LabelTip = LabelTip:GetComponent("UILabel")
|
||||
NGUITools.SetActive(LabelTip.gameObject, false)
|
||||
LabelVer = getChild(transform, "TopLeft", "LabelVer")
|
||||
LabelVer = LabelVer:GetComponent("UILabel")
|
||||
|
||||
lbCustServer = getCC(transform, "TopLeft/LabelCustomerServer", "UILabel")
|
||||
end
|
||||
|
||||
function CLLPSplash.show()
|
||||
csSelf.panel.depth = 200
|
||||
loadedPanelCount = 0
|
||||
SetActive(progressBar.gameObject, false)
|
||||
SetActive(progressBarTotal.gameObject, false)
|
||||
|
||||
-- load alert
|
||||
CLLPSplash.addAlertHud()
|
||||
|
||||
-- 初始化需要提前加载的页面
|
||||
loadedPanelCount = 0
|
||||
for i, v in ipairs(beforeLoadPanels) do
|
||||
CLPanelManager.getPanelAsy(v, CLLPSplash.onLoadPanelBefore)
|
||||
end
|
||||
|
||||
-- Hide company panel
|
||||
csSelf:invoke4Lua(CLLPSplash.hideFirstPanel, 1.5)
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLLPSplash.hide()
|
||||
csSelf:cancelInvoke4Lua()
|
||||
CLLPSplash.hideFirstPanel()
|
||||
end
|
||||
|
||||
-- 刷新页面
|
||||
function CLLPSplash.refresh()
|
||||
LabelVer.text = joinStr(Localization.Get("Version"), __version__)
|
||||
lbCustServer.text = ""
|
||||
LabelTip.text = ""
|
||||
end
|
||||
|
||||
-- 加载hud alert
|
||||
function CLLPSplash.addAlertHud()
|
||||
local onGetObj = function(name, AlertRoot, orgs)
|
||||
AlertRoot.transform.parent = CLUIInit.self.uiPublicRoot
|
||||
AlertRoot.transform.localPosition = Vector3.zero
|
||||
AlertRoot.transform.localScale = Vector3.one
|
||||
NGUITools.SetActive(AlertRoot, true)
|
||||
end
|
||||
CLUIOtherObjPool.borrowObjAsyn("AlertRoot", onGetObj)
|
||||
end
|
||||
|
||||
function CLLPSplash.hideFirstPanel()
|
||||
---@type Coolape.CLPanelLua
|
||||
local p = CLPanelManager.getPanel(MyMain.self.firstPanel)
|
||||
if (p ~= nil and p.gameObject.activeInHierarchy) then
|
||||
CLPanelManager.hidePanel(p)
|
||||
end
|
||||
end
|
||||
|
||||
function CLLPSplash.onLoadPanelBefore(p)
|
||||
p:init()
|
||||
loadedPanelCount = loadedPanelCount + 1
|
||||
if (p.name == "PanelConfirm" or
|
||||
p.name == "PanelHotWheel" or
|
||||
p.name == "PanelMask4Panel" or
|
||||
p.name == "PanelWWWProgress") then
|
||||
p.transform.parent = CLUIInit.self.uiPublicRoot
|
||||
p.transform.localScale = Vector3.one
|
||||
end
|
||||
|
||||
if (p.name == "PanelWWWProgress") then
|
||||
CLPanelManager.showPanel(p)
|
||||
end
|
||||
CLLPSplash.onProgress(#(beforeLoadPanels), loadedPanelCount)
|
||||
if (loadedPanelCount >= #(beforeLoadPanels)) then
|
||||
-- 页面已经加载完成,处理热更新
|
||||
if (not Application.isEditor) then
|
||||
CLLPSplash.checkNewVersion()
|
||||
else
|
||||
csSelf:invoke4Lua(CLLPSplash.updateRes, 0.2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
-- 更新版本
|
||||
--{"ver":"1.0","force":true,"url":"http://"}
|
||||
--]]
|
||||
function CLLPSplash.checkNewVersion()
|
||||
local oldVer = __version__
|
||||
local onGetVer = function(content, orgs)
|
||||
local map = JSON.DecodeMap(content)
|
||||
local newVer = MapEx.getString(map, "ver")
|
||||
if (tonumber(newVer) > tonumber(oldVer)) then
|
||||
local doUpgradeApp = function()
|
||||
CLLPSplash.upgradeGame(MapEx.getString(map, "url"))
|
||||
end
|
||||
if MapEx.getBool(map, "force") then
|
||||
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), true, LGet("Update"), doUpgradeApp, "", nil)
|
||||
else
|
||||
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), false, LGet("Update"), doUpgradeApp, LGet("UpdateLater"), CLLPSplash.updateRes)
|
||||
end
|
||||
else
|
||||
CLLPSplash.updateRes()
|
||||
end
|
||||
end
|
||||
|
||||
local onGetVerError = function(msg, orgs)
|
||||
CLAlert.add(LGet("MsgCheckAppUpgradeFail"), Color.white, 1)
|
||||
CLLPSplash.updateRes()
|
||||
end
|
||||
|
||||
local chlCode = getChlCode()
|
||||
local url = Utl.urlAddTimes(joinStr(CLVerManager.self.baseUrl, "/appVer.", chlCode, ".json"))
|
||||
WWWEx.get(url, CLAssetType.text, onGetVer, onGetVerError, nil, true)
|
||||
end
|
||||
|
||||
-- 更新安装游戏
|
||||
function CLLPSplash.upgradeGame(url)
|
||||
if not isNilOrEmpty(url ) then
|
||||
Application.OpenURL(url)
|
||||
end
|
||||
end
|
||||
|
||||
-- 处理热更新
|
||||
function CLLPSplash.updateRes()
|
||||
if CLCfgBase.self.isDirectEntry then
|
||||
-- 取得缓存的数据
|
||||
user = json.decode(Prefs.getUserInfor())
|
||||
server = json.decode(Prefs.getCurrServer())
|
||||
CLLPSplash.checkHotUpgrade()
|
||||
else
|
||||
if not CLCfgBase.self.hotUpgrade4EachServer then
|
||||
-- 更新资源
|
||||
CLLVerManager.init(CLLPSplash.onProgress, CLLPSplash.onFinishResUpgrade, true, "")
|
||||
else
|
||||
--
|
||||
CLLPSplash.accountLogin()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function CLLPSplash.accountLogin()
|
||||
-- getPanelAsy("PanelLogin", onLoadedPanelTT, {CLLPSplash.onAccountLogin, true})
|
||||
CLLPSplash.prepareStartGame()
|
||||
end
|
||||
|
||||
function CLLPSplash.onAccountLogin(_user, _server)
|
||||
Prefs.setUserInfor(json.encode(_user))
|
||||
Prefs.setCurrServer(json.encode(_server))
|
||||
user = _user
|
||||
server = _server
|
||||
CLLPSplash.checkHotUpgrade()
|
||||
end
|
||||
|
||||
function CLLPSplash.checkHotUpgrade()
|
||||
if CLCfgBase.self.hotUpgrade4EachServer then
|
||||
local resMd5 = ""
|
||||
if CLPathCfg.self.platform == "IOS" then
|
||||
resMd5 = server.iosVer
|
||||
else
|
||||
resMd5 = server.androidVer
|
||||
end
|
||||
-- 更新资源
|
||||
CLLVerManager.init(CLLPSplash.onProgress, CLLPSplash.onFinishResUpgrade, true, resMd5)
|
||||
else
|
||||
CLLPSplash.prepareStartGame()
|
||||
end
|
||||
end
|
||||
|
||||
--设置进度条
|
||||
function CLLPSplash.onProgress(...)
|
||||
local args = { ... }
|
||||
local all = args[1] -- 总量
|
||||
local v = args[2] -- 当前值
|
||||
if (#(args) >= 3) then
|
||||
www4UpgradeCell = args[3]
|
||||
else
|
||||
www4UpgradeCell = nil
|
||||
end
|
||||
|
||||
if (progressBarTotal ~= nil) then
|
||||
NGUITools.SetActive(progressBarTotal.gameObject, true)
|
||||
NGUITools.SetActive(LabelTip.gameObject, true)
|
||||
if (type(all) == "number") then
|
||||
if (all > 0) then
|
||||
local value = v / all
|
||||
progressBarTotal.value = value
|
||||
if (www4UpgradeCell ~= nil) then
|
||||
-- 说明有单个资源
|
||||
lbprogressBarTotal.text = joinStr(v, "/", all)
|
||||
end
|
||||
|
||||
-- 表明已经更新完成
|
||||
if (value == 1) then
|
||||
InvokeEx.cancelInvokeByUpdate(CLLPSplash.onProgressCell)
|
||||
NGUITools.SetActive(progressBarTotal.gameObject, false)
|
||||
NGUITools.SetActive(LabelTip.gameObject, false)
|
||||
NGUITools.SetActive(progressBar.gameObject, false)
|
||||
else
|
||||
-- 单个资源的进度
|
||||
CLLPSplash.onProgressCell()
|
||||
end
|
||||
else
|
||||
InvokeEx.cancelInvokeByUpdate(CLLPSplash.onProgressCell)
|
||||
progressBarTotal.value = 0
|
||||
NGUITools.SetActive(progressBarTotal.gameObject, false)
|
||||
NGUITools.SetActive(LabelTip.gameObject, false)
|
||||
NGUITools.SetActive(progressBar.gameObject, false)
|
||||
end
|
||||
else
|
||||
print(joinStr("all====", all))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 单个文件更新进度
|
||||
function CLLPSplash.onProgressCell(...)
|
||||
if (www4UpgradeCell ~= nil) then
|
||||
NGUITools.SetActive(progressBar.gameObject, true)
|
||||
progressBar.value = www4UpgradeCell.downloadProgress or 0
|
||||
InvokeEx.invokeByUpdate(CLLPSplash.onProgressCell, 0.02)
|
||||
else
|
||||
NGUITools.SetActive(progressBar.gameObject, false)
|
||||
InvokeEx.cancelInvokeByUpdate(CLLPSplash.onProgressCell)
|
||||
end
|
||||
end
|
||||
|
||||
-- 资源更新完成
|
||||
function CLLPSplash.onFinishResUpgrade(upgradeProcSuccess)
|
||||
if (not upgradeProcSuccess) then
|
||||
print("UpgradeResFailed")
|
||||
else
|
||||
if (CLLVerManager.isHaveUpgrade()) then
|
||||
-- 说明有更新,重新启动
|
||||
if CLCfgBase.self.hotUpgrade4EachServer then
|
||||
CLCfgBase.self.isDirectEntry = true
|
||||
end
|
||||
csSelf:cancelInvoke4Lua()
|
||||
csSelf:invoke4Lua(CLLPSplash.reLoadGame, 0.1)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if CLCfgBase.self.hotUpgrade4EachServer then
|
||||
-- 准备开始游戏
|
||||
CLLPSplash.prepareStartGame()
|
||||
else
|
||||
--SetActive(ButtonEntry, true)
|
||||
CLLPSplash.accountLogin()
|
||||
end
|
||||
end
|
||||
|
||||
-- 重新启动lua
|
||||
function CLLPSplash.reLoadGame()
|
||||
--- 释放资源开始-------------------------------
|
||||
local cleanRes = function()
|
||||
if CLAlert ~= nil and CLAlert.csSelf ~= nil then
|
||||
GameObject.DestroyImmediate(CLAlert.csSelf.gameObject, true)
|
||||
end
|
||||
pcall(doSomethingBeforeRestart)
|
||||
pcall(releaseRes4GC, true)
|
||||
end
|
||||
--- 释放资源结束-------------------------------
|
||||
pcall(cleanRes)
|
||||
local panel = CLPanelManager.getPanel(CLMainBase.self.firstPanel)
|
||||
if panel then
|
||||
CLPanelManager.showPanel(panel)
|
||||
end
|
||||
CLMainBase.self:reStart()
|
||||
end
|
||||
|
||||
-- 准备开始游戏
|
||||
function CLLPSplash.prepareStartGame()
|
||||
CLLPSplash.checkSignCode()
|
||||
|
||||
if (progressBar ~= nil) then
|
||||
InvokeEx.cancelInvokeByUpdate(CLLPSplash.onProgressCell)
|
||||
NGUITools.SetActive(progressBar.gameObject, false)
|
||||
NGUITools.SetActive(progressBarTotal.gameObject, false)
|
||||
NGUITools.SetActive(LabelTip.gameObject, false)
|
||||
end
|
||||
|
||||
-- 播放背景音乐---------------
|
||||
-- SoundEx.playMainMusic()
|
||||
----------------------------
|
||||
end
|
||||
|
||||
function CLLPSplash.checkSignCode()
|
||||
-- 把热更新及加载ui完了后,再做验证签名
|
||||
if (not CLLPSplash.isSignCodeValid()) then
|
||||
CLUIUtl.showConfirm(Localization.Get("MsgTheVerIsNotCorrect"), nil)
|
||||
-- CLUIUtl.showConfirm("亲爱的玩家你所下载的版本可能是非官方版本,请到xxx去下载。非常感谢!", nil)
|
||||
return
|
||||
end
|
||||
|
||||
CLLPSplash.goNext()
|
||||
end
|
||||
|
||||
-- 签名是否有效(Only 4 android)
|
||||
function CLLPSplash.isSignCodeValid(...)
|
||||
if isNilOrEmpty(CLCfgBase.self.singinMd5Code) then
|
||||
return true
|
||||
end
|
||||
-- 取得签名串
|
||||
local md5Code = Utl.getSingInCodeAndroid()
|
||||
|
||||
if (isNilOrEmpty(md5Code)) then
|
||||
if (string.lower(md5Code) ~= string.lower(CLCfgBase.self.singinMd5Code)) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function CLLPSplash.uiEventDelegate(go)
|
||||
end
|
||||
|
||||
function CLLPSplash.goNext()
|
||||
if CLCfgBase.self.isDirectEntry then
|
||||
CLCfgBase.self.isDirectEntry = false
|
||||
end
|
||||
CLPanelManager.getPanelAsy("PanelStart", onLoadedPanel, { user, server })
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CLLPSplash.hideSelfOnKeyBack( )
|
||||
return false
|
||||
end
|
||||
----------------------------------------------
|
||||
return CLLPSplash
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 909ff1946bb8d4fabb4c1c7afd25f35a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
243
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CLLPStart.lua
Normal file
243
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CLLPStart.lua
Normal file
@@ -0,0 +1,243 @@
|
||||
--开始游戏
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local gameObject = nil
|
||||
local user
|
||||
local selectedServer
|
||||
local panelIndex = 0
|
||||
|
||||
-- 放在后面加载的页面
|
||||
local lateLoadPanels = {
|
||||
"PanelMsg",
|
||||
"PanelMine"
|
||||
}
|
||||
|
||||
local isLogined = false
|
||||
local CLLPStart = {}
|
||||
|
||||
function CLLPStart.init(go)
|
||||
csSelf = go
|
||||
transform = csSelf.transform
|
||||
gameObject = csSelf.gameObject
|
||||
-- 加载一些必要的lua
|
||||
local succee, msg = pcall(CLLPStart.setLuasAtBegainning)
|
||||
if not succee then
|
||||
printe(msg)
|
||||
end
|
||||
end
|
||||
|
||||
-- 加载一些必要的lua
|
||||
function CLLPStart.setLuasAtBegainning()
|
||||
require("public.CLLInclude")
|
||||
require "db.DBRoot"
|
||||
-- require "net.NetProto"
|
||||
-- 取得数据配置
|
||||
require("cfg.DBCfg")
|
||||
require "toolkit.MyUtl"
|
||||
|
||||
-- 资源释放时间
|
||||
if CLAssetsManager.self then
|
||||
CLAssetsManager.self.timeOutSec4Realse = 10
|
||||
end
|
||||
|
||||
-- 日志监听
|
||||
if ReporterMessageReceiver.self and ReporterMessageReceiver.self.gameObject then
|
||||
-- if KKWhiteList.isWhiteName() then
|
||||
ReporterMessageReceiver.self.gameObject:SetActive(true)
|
||||
-- else
|
||||
-- ReporterMessageReceiver.self.gameObject:SetActive(false)
|
||||
-- end
|
||||
end
|
||||
|
||||
MyUtl.init(csSelf)
|
||||
|
||||
CLPanelManager.self.mainPanelName = "PanelMain"
|
||||
|
||||
-- 初始化百度定位
|
||||
-- MyLocation.self:checkUserPermission()
|
||||
MyLocation.self:init(MyLocation.CoorType.BD09ll)
|
||||
|
||||
-- 设置键盘模式
|
||||
-- //SOFT_INPUT_ADJUST_NOTHING
|
||||
-- //SOFT_INPUT_ADJUST_PAN
|
||||
-- //SOFT_INPUT_ADJUST_RESIZE
|
||||
CLUIFormUtl.setSoftInputMode("SOFT_INPUT_ADJUST_PAN")
|
||||
Screen.sleepTimeout = CS.UnityEngine.SleepTimeout.SystemSetting
|
||||
|
||||
-- 添加屏蔽字
|
||||
--MyMain.self:invoke4Lua(CLLPStart.addShieldWords, 1)
|
||||
|
||||
--//TODO:other lua scripts
|
||||
-- require("public.IDLCameraMgr")
|
||||
-- IDLCameraMgr.init()
|
||||
|
||||
-- 释放ui资源的时间(秒)
|
||||
-- UIAtlas.releaseSpriteTime = 30
|
||||
|
||||
-- 设置是否可以成多点触控
|
||||
-- CLCfgBase.self.uiCamera:GetComponent("UICamera").allowMultiTouch = false
|
||||
|
||||
-- if (SystemInfo.systemMemorySize < 2048) then
|
||||
-- CLCfgBase.self.isFullEffect = false
|
||||
-- end
|
||||
end
|
||||
|
||||
function CLLPStart.setData(pars)
|
||||
user = pars[1]
|
||||
selectedServer = pars[2]
|
||||
end
|
||||
|
||||
function CLLPStart.show()
|
||||
--CLLPStart.createPanel()
|
||||
end
|
||||
|
||||
-- 刷新页面
|
||||
function CLLPStart.refresh()
|
||||
if not isLogined then
|
||||
CLLPStart.createPanel()
|
||||
end
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLLPStart.hide()
|
||||
csSelf:cancelInvoke4Lua()
|
||||
end
|
||||
|
||||
-- 创建ui
|
||||
function CLLPStart.createPanel()
|
||||
panelIndex = 0
|
||||
local count = #(lateLoadPanels)
|
||||
if (count > 0) then
|
||||
for i = 1, count do
|
||||
local name = lateLoadPanels[i]
|
||||
CLPanelManager.getPanelAsy(name, CLLPStart.onLoadPanelAfter)
|
||||
end
|
||||
else
|
||||
isLogined = true
|
||||
CLLPStart.connectServer()
|
||||
end
|
||||
end
|
||||
|
||||
function CLLPStart.onLoadPanelAfter(p)
|
||||
-- p:init()
|
||||
panelIndex = panelIndex + 1
|
||||
local count = #(lateLoadPanels)
|
||||
if (panelIndex >= count) then
|
||||
--已经加载完
|
||||
CLLPStart.connectServer()
|
||||
end
|
||||
end
|
||||
|
||||
-- 添加屏蔽字
|
||||
function CLLPStart.addShieldWords()
|
||||
local onGetShieldWords = function(path, content, originals)
|
||||
if (content ~= nil) then
|
||||
BlockWordsTrie.getInstanse():init(content)
|
||||
end
|
||||
end
|
||||
local path = joinStr(CLPathCfg.self.basePath, "/", CLPathCfg.upgradeRes, "/priority/txt/shieldWords")
|
||||
CLVerManager.self:getNewestRes(path, CLAssetType.text, onGetShieldWords, true, nil)
|
||||
end
|
||||
|
||||
-- 连接服务器相关处理
|
||||
function CLLPStart.connectServer()
|
||||
-- showHotWheel()
|
||||
-- Net.self:connect(selectedServer.host, bio2number(selectedServer.port))
|
||||
|
||||
NetProto.init(
|
||||
function(success)
|
||||
if success then
|
||||
CLLPStart.doEnterGame()
|
||||
else
|
||||
CLUIUtl.showConfirm(
|
||||
"与服务器失去联系",
|
||||
false,
|
||||
"重试",
|
||||
CLLPStart.connectServer,
|
||||
"退出",
|
||||
function()
|
||||
Application.Quit()
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
-- 处理网络接口
|
||||
function CLLPStart.procNetwork(cmd, succ, msg, pars)
|
||||
if (succ == NetSuccess) then
|
||||
-- 接口处理成功
|
||||
end
|
||||
end
|
||||
|
||||
-- 点击返回键关闭自己(页面)
|
||||
function CLLPStart.hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
function CLLPStart.doEnterGame()
|
||||
if isNilOrEmpty(Prefs.getUserName()) or isNilOrEmpty(Prefs.getUserPsd()) then
|
||||
-- 说明没有取得用户信息
|
||||
getPanelAsy("PanelLogin", onLoadedPanel)
|
||||
CLLPStart.hideSplash()
|
||||
else
|
||||
NetProto.login(
|
||||
{
|
||||
phone = Prefs.getUserName(),
|
||||
password = Prefs.getUserPsd()
|
||||
},
|
||||
function(content, orgs)
|
||||
if content.success then
|
||||
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
|
||||
if isNilOrEmpty(currGroup) then
|
||||
---@type _ParamTRPSelectGroup
|
||||
local d = {}
|
||||
d.isHideCloseBtn = true
|
||||
d.companyList = content.result
|
||||
getPanelAsy("PanelSelectCompany", onLoadedPanel, d)
|
||||
CLLPStart.hideSplash()
|
||||
else
|
||||
local useOldCurrGroup = false
|
||||
currGroup = json.decode(currGroup)
|
||||
for i, v in ipairs(content.result) do
|
||||
if v.company_id == currGroup.company_id then
|
||||
Prefs.setCurrGroup(Prefs.getUserName(), json.encode(v))
|
||||
currGroup = v
|
||||
useOldCurrGroup = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if useOldCurrGroup then
|
||||
getPanelAsy("PanelConnect", onLoadedPanel)
|
||||
else
|
||||
---@type _ParamTRPSelectGroup
|
||||
local d = {}
|
||||
d.isHideCloseBtn = true
|
||||
d.companyList = content.result
|
||||
getPanelAsy("PanelSelectCompany", onLoadedPanel, d)
|
||||
end
|
||||
CLLPStart.hideSplash()
|
||||
end
|
||||
else
|
||||
getPanelAsy("PanelLogin", onLoadedPanel)
|
||||
CLLPStart.hideSplash()
|
||||
end
|
||||
end,
|
||||
function()
|
||||
getPanelAsy("PanelLogin", onLoadedPanel)
|
||||
CLLPStart.hideSplash()
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
CLLPStart.hideSplash = function()
|
||||
local p2 = CLPanelManager.getPanel("PanelSplash")
|
||||
if (p2 ~= nil) then
|
||||
CLPanelManager.hidePanel(p2)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------------
|
||||
return CLLPStart
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8bc22355e23944afb9aec17138806bce
|
||||
timeCreated: 1498220629
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
do
|
||||
local pName;
|
||||
local csSelf;
|
||||
local transform;
|
||||
local table;
|
||||
local cellPrefab;
|
||||
|
||||
local wwwList = ArrayList();
|
||||
local wwwMap = {};
|
||||
|
||||
local PanelWWWProgress = {};
|
||||
function PanelWWWProgress.init(go)
|
||||
pName = go.name;
|
||||
csSelf = go;
|
||||
transform = csSelf.transform;
|
||||
table = getChild(transform, "AnchorBottomLeft", "Table");
|
||||
cellPrefab = getChild(table, "00000").gameObject;
|
||||
table = table:GetComponent("UITable");
|
||||
|
||||
CLVerManager.self:setWWWListner(PanelWWWProgress.onAddWWW, PanelWWWProgress.onRmWWW);
|
||||
end
|
||||
|
||||
function PanelWWWProgress.setData(pars)
|
||||
end
|
||||
|
||||
function PanelWWWProgress.show()
|
||||
csSelf.panel.depth = CLUIInit.self.PanelWWWProgressDepth;
|
||||
end
|
||||
|
||||
function PanelWWWProgress.initCell(go, data)
|
||||
local cell = go:GetComponent("CLCellLua");
|
||||
cell:init(data, nil);
|
||||
end
|
||||
|
||||
function PanelWWWProgress.hide()
|
||||
end
|
||||
|
||||
function PanelWWWProgress.refresh()
|
||||
CLUIUtl.resetList4Lua(table, cellPrefab, wwwList, PanelWWWProgress.initCell, true, false, 0);
|
||||
end
|
||||
|
||||
function PanelWWWProgress.procNetwork(cmd, succ, msg, pars)
|
||||
end
|
||||
|
||||
function PanelWWWProgress.onAddWWW(www, path, url)
|
||||
local d = {}
|
||||
d.www = www;
|
||||
d.path = path;
|
||||
d.url = url;
|
||||
wwwList:Add(d);
|
||||
wwwMap[url] = d;
|
||||
|
||||
PanelWWWProgress.refresh();
|
||||
end
|
||||
|
||||
function PanelWWWProgress.onRmWWW(url)
|
||||
local d = wwwMap[url];
|
||||
if (d ~= nil) then
|
||||
wwwList:Remove(d);
|
||||
end
|
||||
wwwMap[url] = nil;
|
||||
|
||||
PanelWWWProgress.refresh();
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return PanelWWWProgress;
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f597a4a6e6734ee7b28e5c2d0f191b4
|
||||
timeCreated: 1498220629
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,90 @@
|
||||
-- xx界面
|
||||
local CLLPWebView = {}
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
---@type UnityEngine.Transform
|
||||
local transform = nil
|
||||
local uiobjs = {}
|
||||
local url
|
||||
local webView
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CLLPWebView.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
webView = csSelf:GetComponent("UWebView")
|
||||
webView:init(
|
||||
CLLPWebView.onCallFromJS,
|
||||
CLLPWebView.onCallOnError,
|
||||
CLLPWebView.onCallOnStarted,
|
||||
CLLPWebView.onCallOnLoaded
|
||||
)
|
||||
webView:setMargins(0, NumEx.getIntPart(130 / MyUtl.getSizeAdjust()), 0, 0)
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CLLPWebView.setData(paras)
|
||||
url = paras and paras.url or ""
|
||||
end
|
||||
|
||||
--当有通用背板显示时的回调
|
||||
function CLLPWebView.onShowFrame()
|
||||
end
|
||||
|
||||
function CLLPWebView.onCallFromJS(msg)
|
||||
end
|
||||
function CLLPWebView.onCallOnError(msg)
|
||||
end
|
||||
function CLLPWebView.onCallOnStarted(msg)
|
||||
hideHotWheel()
|
||||
end
|
||||
function CLLPWebView.onCallOnLoaded(msg)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CLLPWebView.show()
|
||||
webView:setVisibility(true)
|
||||
showHotWheel()
|
||||
webView:loadUrl(url)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CLLPWebView.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLLPWebView.hide()
|
||||
webView:setVisibility(false)
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CLLPWebView.procNetwork(cmd, succ, msg, paras)
|
||||
--[[
|
||||
if(succ == NetSuccess) then
|
||||
if(cmd == "xxx") then
|
||||
-- TODO:
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CLLPWebView.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonQuit" then
|
||||
hideTopPanel()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function CLLPWebView.onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CLLPWebView.hideSelfOnKeyBack()
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CLLPWebView
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c27a1b7ccc7e3404a92e967be96155cd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
102
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPMain.lua
Normal file
102
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPMain.lua
Normal file
@@ -0,0 +1,102 @@
|
||||
-- xx界面
|
||||
CSPMain = {}
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
CSPMain.sizeAdjust = 1
|
||||
CSPMain.contentRect = Vector4.zero
|
||||
local objs = {}
|
||||
|
||||
local bottomBtns = {
|
||||
-- {id = 2, name = "培训", panel = "PanelTraining", Background = "icon_icon_73_peixun", Checkmark = "icon_icon_78_peixun2"},
|
||||
{id = 1, name = "消息", panel = "PanelMsg", Background = "main_icon_news", Checkmark = "main_icon_news2"},
|
||||
{id = 2, name = "工作", panel = "PanelTasks", Background = "main_icon_work", Checkmark = "main_icon_work2"},
|
||||
{id = 3, name = "我的", panel = "PanelMine", Background = "main_icon_me", Checkmark = "main_icon_me2"}
|
||||
}
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CSPMain.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
CSPMain.contentRect = MyUtl.getUIContent(csSelf)
|
||||
|
||||
--objs.Content = getCC(transform, "PanelContent", "UIPanel")
|
||||
--objs.Content.transform.localPosition = Vector3.zero;
|
||||
--objs.Content.clipOffset = Vector2.zero;
|
||||
--objs.Content.baseClipRegion = CSPMain.contentRect;
|
||||
-----@type UIScrollView
|
||||
--objs.scrollView = objs.Content:GetComponent("UIScrollView");
|
||||
objs.LabelTitle = getCC(transform, "AnchorTop/offset/LabelTitle", "UILabel")
|
||||
objs.bottomGrid = getCC(transform, "AnchorBottom/offset/Grid", "UIGrid")
|
||||
objs.bottomCellPrefab = getChild(objs.bottomGrid.transform, "00000").gameObject
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CSPMain.setData(paras)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CSPMain.show()
|
||||
--objs.scrollView:ResetPosition()
|
||||
CSPMain.setBottomBtns()
|
||||
end
|
||||
|
||||
function CSPMain.setBottomBtns()
|
||||
local width = NumEx.getIntPart(CSPMain.contentRect.z / #bottomBtns)
|
||||
objs.bottomGrid.cellWidth = width
|
||||
CLUIUtl.resetList4Lua(objs.bottomGrid, objs.bottomCellPrefab, bottomBtns, CSPMain.initBottomBtn)
|
||||
end
|
||||
|
||||
function CSPMain.initBottomBtn(cell, data)
|
||||
data.width = objs.bottomGrid.cellWidth
|
||||
cell:init(data, CSPMain.onClickBottonBtn)
|
||||
if data.id == 2 then
|
||||
CSPMain.onClickBottonBtn(cell, data)
|
||||
end
|
||||
end
|
||||
|
||||
function CSPMain.onClickBottonBtn(cell, data)
|
||||
cell.luaTable.setSelected(true)
|
||||
objs.LabelTitle.text = data.name
|
||||
if CLPanelManager.topPanel ~= nil and CLPanelManager.topPanel ~= csSelf then
|
||||
hideTopPanel()
|
||||
end
|
||||
if not isNilOrEmpty(data.panel) then
|
||||
getPanelAsy(data.panel, onLoadedPanelTT, data.params)
|
||||
end
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CSPMain.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CSPMain.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CSPMain.procNetwork(cmd, succ, msg, paras)
|
||||
--[[
|
||||
if(succ == 1) then
|
||||
if(cmd == "xxx") then
|
||||
-- TODO:
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CSPMain.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if (goName == "Button01") then
|
||||
end
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CSPMain.hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CSPMain
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 821ba5f59cd234d70873ae07cd8f31eb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
123
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPMine.lua
Normal file
123
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPMine.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
-- xx界面
|
||||
local CSPMine = {}
|
||||
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
CSPMine.sizeAdjust = 1
|
||||
CSPMine.contentRect = Vector4.zero
|
||||
local objs = {}
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CSPMine.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
CSPMine.contentRect = MyUtl.getUIContent(csSelf, nil, nil, true)
|
||||
|
||||
objs.Content = getCC(transform, "PanelContent", "UIPanel")
|
||||
objs.Content.transform.localPosition = Vector3.zero
|
||||
objs.Content.clipOffset = Vector2.zero
|
||||
objs.Content.baseClipRegion = CSPMine.contentRect
|
||||
|
||||
---@type UIScrollView
|
||||
objs.scrollView = objs.Content:GetComponent("UIScrollView")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CSPMine.setData(paras)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CSPMine.show()
|
||||
objs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function CSPMine.onClickBottonBtn(cell)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CSPMine.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CSPMine.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CSPMine.procNetwork(cmd, succ, msg, paras)
|
||||
--[[
|
||||
if(succ == 1) then
|
||||
if(cmd == "xxx") then
|
||||
-- TODO:
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CSPMine.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if (goName == "Button01") then
|
||||
--[[
|
||||
if isNilOrEmpty(__uid__) then
|
||||
getPanelAsy("PanelLogin", onLoadedPanelTT, {function (uid)
|
||||
if uid then
|
||||
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
|
||||
end
|
||||
end}
|
||||
)
|
||||
else
|
||||
-- 密码保护
|
||||
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
|
||||
end
|
||||
--]]
|
||||
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
|
||||
elseif goName == "ButtonQR" then
|
||||
showHotWheel()
|
||||
-- CSPMine.onGetLocation(json.encode({code = 0, latitude = "116.404", longitude = "39.915"}))
|
||||
MyLocation.self:getMyLocation(CSPMine.onGetLocation)
|
||||
end
|
||||
end
|
||||
|
||||
function CSPMine.onGetLocation(locInfor)
|
||||
printe(locInfor)
|
||||
local location = json.decode(locInfor)
|
||||
|
||||
local code = location.code
|
||||
if code == 0 then
|
||||
-- 116.404, 39.915
|
||||
local latitude = location.latitude
|
||||
local longitude = location.longitude
|
||||
local AddrStr = location.AddrStr
|
||||
local upgradeRes = "/upgradeRes"
|
||||
if (CLCfgBase.self.isEditMode) then
|
||||
upgradeRes = "/upgradeRes4Dev"
|
||||
end
|
||||
local url =
|
||||
joinStr(
|
||||
"trCrm",
|
||||
upgradeRes,
|
||||
"/priority/www/baidumap.html?latitude=",
|
||||
latitude,
|
||||
"&longitude=",
|
||||
longitude,
|
||||
"@AddrStr=",
|
||||
AddrStr
|
||||
)
|
||||
getPanelAsy("PanelWebView", onLoadedPanelTT, {url = url})
|
||||
else
|
||||
CLAlert.add(location.msg, Color.yellow, 1)
|
||||
if code == 8 or code == 9 or code == 5 then
|
||||
-- 打开gps
|
||||
MyLocation.self:guidSwitchGps()
|
||||
end
|
||||
end
|
||||
hideHotWheel()
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CSPMine.hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CSPMine
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 884ad32d2f27f4076ab19903ae8a9f83
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
98
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPMsg.lua
Normal file
98
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPMsg.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
-- xx界面
|
||||
local CSPMsg = {}
|
||||
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
CSPMsg.sizeAdjust = 1
|
||||
CSPMsg.contentRect = Vector4.zero
|
||||
local objs = {}
|
||||
local defaulList = {
|
||||
{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="待办任务"},
|
||||
}
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CSPMsg.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
CSPMsg.contentRect = MyUtl.getUIContent(csSelf, nil, nil, true)
|
||||
|
||||
objs.Content = getCC(transform, "PanelContent", "UIPanel")
|
||||
objs.Content.transform.localPosition = Vector3.zero
|
||||
objs.Content.clipOffset = Vector2.zero
|
||||
objs.Content.baseClipRegion = CSPMsg.contentRect
|
||||
|
||||
---@type UIScrollView
|
||||
objs.scrollView = objs.Content:GetComponent("UIScrollView")
|
||||
---@type UITable
|
||||
objs.Table = getCC(objs.scrollView.transform, "Table", "UITable")
|
||||
objs.LoopGrid = getCC(objs.Table.transform, "msgList/Grid", "CLUILoopGrid")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CSPMsg.setData(paras)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CSPMsg.show()
|
||||
objs.LoopGrid:setList(defaulList, CSPMsg.initCell)
|
||||
objs.Table:Reposition()
|
||||
objs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function CSPMsg.initCell(cell, data)
|
||||
cell:init(data, CSPMsg.onClickCell)
|
||||
end
|
||||
|
||||
function CSPMsg.onClickCell(cell, data)
|
||||
getPanelAsy("PanelSysMsgList", onLoadedPanelTT, data)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CSPMsg.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CSPMsg.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CSPMsg.procNetwork(cmd, succ, msg, paras)
|
||||
--[[
|
||||
if(succ == 1) then
|
||||
if(cmd == "xxx") then
|
||||
-- TODO:
|
||||
end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CSPMsg.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if (goName == "Button01") then
|
||||
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
|
||||
--[[
|
||||
if isNilOrEmpty(__uid__) then
|
||||
getPanelAsy("PanelLogin", onLoadedPanelTT, {function (uid)
|
||||
if uid then
|
||||
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
|
||||
end
|
||||
end}
|
||||
)
|
||||
else
|
||||
-- 密码保护
|
||||
getPanelAsy("PanelPasswordSave", onLoadedPanelTT)
|
||||
end
|
||||
--]]
|
||||
end
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CSPMsg.hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CSPMsg
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24e46091cd0b94fa9a176d3d002c50c9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
185
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPTasks.lua
Normal file
185
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/CSPTasks.lua
Normal file
@@ -0,0 +1,185 @@
|
||||
-- xx界面
|
||||
local CSPTasks = {}
|
||||
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
CSPTasks.sizeAdjust = 1
|
||||
CSPTasks.contentRect = Vector4.zero
|
||||
local uiobjs = {}
|
||||
local headData = {}
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CSPTasks.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
CSPTasks.setEventDelegate()
|
||||
CSPTasks.contentRect = MyUtl.getUIContent(csSelf, 772)
|
||||
|
||||
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")
|
||||
uiobjs.Statistics = getChild(uiobjs.TableContent.transform, "Statistics")
|
||||
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollView = uiobjs.Content:GetComponent("UIScrollView")
|
||||
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.Top = getCC(transform, "Top", "CLUIFormRoot")
|
||||
---@type UITexture
|
||||
uiobjs.HeadIcon = getCC(uiobjs.Top.transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CSPTasks.setData(paras)
|
||||
-- 初始化顶部数据
|
||||
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
|
||||
local companyInfro = json.decode(currGroup)
|
||||
local user = DBUser.getUserById(companyInfro.login_no)
|
||||
headData.company_id = companyInfro.company_id
|
||||
headData.company_name = companyInfro.company_name
|
||||
if user then
|
||||
headData.loginName = user.loginName
|
||||
headData.imageUrl = user.imageUrl
|
||||
else
|
||||
printe("账号信息未取得!")
|
||||
end
|
||||
|
||||
-- 取得头像
|
||||
NetProto.send.person_view_query()
|
||||
NetProto.send.sales_view_query()
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CSPTasks.show()
|
||||
local list = {}
|
||||
for i = 1, 100 do
|
||||
list[i] = i
|
||||
end
|
||||
-- uiobjs.TableTask:setList(list, nil)
|
||||
|
||||
CSPTasks.showReportform("reportform1")
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function CSPTasks.onClickBottonBtn(cell)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CSPTasks.refresh()
|
||||
CSPTasks.setHeadInfor()
|
||||
end
|
||||
|
||||
function CSPTasks.setHeadInfor()
|
||||
uiobjs.Top:setValue(headData)
|
||||
if not isNilOrEmpty(headData.imageurl) then
|
||||
if uiobjs.HeadIcon.mainTexture == nil or uiobjs.HeadIcon.mainTexture.name ~= headData.imageurl then
|
||||
WWWEx.get(
|
||||
headData.imageurl,
|
||||
nil,
|
||||
CLAssetType.texture,
|
||||
function(content, orgs)
|
||||
content.name = headData.imageurl
|
||||
uiobjs.HeadIcon.mainTexture = content
|
||||
end,
|
||||
function()
|
||||
printe("取得头像失败")
|
||||
end,
|
||||
nil,
|
||||
true,
|
||||
2
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CSPTasks.hide()
|
||||
if CSPTasks.reportform then
|
||||
CLUIOtherObjPool.returnObj(CSPTasks.reportform.gameObject)
|
||||
SetActive(CSPTasks.reportform.gameObject, false)
|
||||
CSPTasks.reportform = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CSPTasks.procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if cmd == NetProto.cmds.person_view_query then
|
||||
for k, v in pairs(paras.result) do
|
||||
headData[k] = v
|
||||
end
|
||||
CSPTasks.setHeadInfor()
|
||||
elseif cmd == NetProto.cmds.sales_view_query then
|
||||
for k, v in pairs(paras.result) do
|
||||
headData[k] = v
|
||||
end
|
||||
CSPTasks.setHeadInfor()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function CSPTasks.returnReportform()
|
||||
end
|
||||
|
||||
function CSPTasks.showReportform(prefabName)
|
||||
if CSPTasks.reportform and CSPTasks.reportform.name ~= prefabName then
|
||||
CLUIOtherObjPool.returnObj(CSPTasks.reportform.gameObject)
|
||||
SetActive(CSPTasks.reportform.gameObject, false)
|
||||
CSPTasks.reportform = nil
|
||||
end
|
||||
if CSPTasks.reportform then
|
||||
CSPTasks.reportform:init({}, nil)
|
||||
else
|
||||
CLUIOtherObjPool.borrowObjAsyn(
|
||||
prefabName,
|
||||
function(name, go, orgs)
|
||||
CSPTasks.reportform = go:GetComponent("CLCellLua")
|
||||
go.transform.parent = uiobjs.Statistics
|
||||
go.transform.localPosition = Vector3(0, -465, 0)
|
||||
go.transform.localScale = Vector3.one
|
||||
go.transform.localEulerAngles = Vector3.zero
|
||||
SetActive(go, true)
|
||||
CSPTasks.reportform:init({}, nil)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function CSPTasks.setEventDelegate()
|
||||
CSPTasks.EventDelegate = {
|
||||
ToggleCust = function()
|
||||
CSPTasks.showReportform("reportform1")
|
||||
end,
|
||||
ToggleOrder = function()
|
||||
CSPTasks.showReportform("reportform2")
|
||||
end,
|
||||
ToggleTarget = function()
|
||||
CSPTasks.showReportform("reportform3")
|
||||
end,
|
||||
ButtonCusts = function()
|
||||
getPanelAsy("PanelCustList", onLoadedPanelTT)
|
||||
end,
|
||||
ButtonRecord = function()
|
||||
end,
|
||||
ButtonCustOcean = function()
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CSPTasks.uiEventDelegate(go)
|
||||
local func = CSPTasks.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CSPTasks.hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CSPTasks
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf89f5ba04eec4f1ab01c56406cfb9eb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
require("public.class")
|
||||
---@class TRBasePanel:ClassBase
|
||||
local TRBasePanel = class("TRBasePanel")
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
---@param csObj Coolape.CLPanelLua
|
||||
function TRBasePanel:init(csObj)
|
||||
self.uiobjs = {}
|
||||
---@type Coolape.CLPanelLua
|
||||
self.csSelf = csObj
|
||||
---@type UnityEngine.Transform
|
||||
self.transform = csObj.transform
|
||||
end
|
||||
|
||||
---public 当有通用背板显示时的回调
|
||||
---@param cs Coolape.CLPanelLua
|
||||
function TRBasePanel:onShowFrame(cs)
|
||||
if cs.frameObj then
|
||||
---@type _BGFrame1Param
|
||||
local d = {}
|
||||
-- d.title = LGet(cs.titleKeyName)
|
||||
d.title = cs.titleKeyName
|
||||
d.panel = cs
|
||||
cs.frameObj:init(d)
|
||||
end
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function TRBasePanel:hideSelfOnKeyBack()
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRBasePanel
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64497d95f0deb45deae91d938b26112b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
110
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPConnect.lua
Normal file
110
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPConnect.lua
Normal file
@@ -0,0 +1,110 @@
|
||||
-- xx界面
|
||||
local TRPConnect = {}
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
---@type UnityEngine.Transform
|
||||
local transform = nil
|
||||
local companyInfro
|
||||
local uiobjs = {}
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function TRPConnect.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
--[[
|
||||
上的组件:getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function TRPConnect.setData(paras)
|
||||
end
|
||||
|
||||
--当有通用背板显示时的回调
|
||||
function TRPConnect.onShowFrame()
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPConnect.show()
|
||||
local phone = Prefs.getUserName()
|
||||
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
|
||||
companyInfro = json.decode(currGroup)
|
||||
DBUser.onGetUsers(companyInfro.loginNoList) -- 缓存工号相关信息
|
||||
NetProto.socketInit(companyInfro.company_id, companyInfro.login_no, companyInfro.group_id)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPConnect.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPConnect.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPConnect.procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if (cmd == "connect") then
|
||||
-- socket正常
|
||||
require "db.DBRoot"
|
||||
DBRoot.init()
|
||||
TRPConnect.getDataFromServer()
|
||||
end
|
||||
else
|
||||
CLUIUtl.showConfirm(
|
||||
"服务器连接失败,确认网络连接正常。",
|
||||
function()
|
||||
NetProto.socketInit(companyInfro.company_id, companyInfro.login_no)
|
||||
end,
|
||||
nil
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
---public 从服务器取得数据
|
||||
function TRPConnect.getDataFromServer()
|
||||
if DBRoot then
|
||||
DBRoot.clean()
|
||||
end
|
||||
NetProto.send.filter_customers(
|
||||
function(content)
|
||||
if content.success then
|
||||
getPanelAsy("PanelMain", onLoadedPanel)
|
||||
else
|
||||
CLUIUtl.showConfirm(
|
||||
"网络错误,请重试",
|
||||
function()
|
||||
TRPConnect.getDataFromServer()
|
||||
end
|
||||
)
|
||||
end
|
||||
end,
|
||||
5
|
||||
)
|
||||
-- NetProto.send.announcement_query()
|
||||
-- NetProto.send.booking_query()
|
||||
-- NetProto.send.replenish_query()
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPConnect.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
--[[
|
||||
if(goName == "xxx") then
|
||||
--TODO:
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPConnect.onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function TRPConnect.hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPConnect
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a310a8f37af54b9496d61d1cf3a0024
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,245 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPCustDetail:TRBasePanel 邮件列表
|
||||
local TRPCustDetail = class("TRPCustDetail", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPCustDetail:init(csObj)
|
||||
TRPCustDetail.super.init(self, csObj)
|
||||
|
||||
self:setEventDelegate()
|
||||
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 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
|
||||
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
---@type UITable
|
||||
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
|
||||
|
||||
uiobjs.Head = getCC(self.transform, "Top/SpriteHead", "CLUIFormRoot")
|
||||
---@type UIPopupList
|
||||
uiobjs.LabelStatus = getCC(uiobjs.Head.transform, "LabelStatus", "UIPopupList")
|
||||
uiobjs.LabelType = getCC(uiobjs.Head.transform, "LabelType", "UIPopupList")
|
||||
uiobjs.starGrid = getCC(uiobjs.Head.transform, "LabelStars/Grid", "UIGrid")
|
||||
uiobjs.starGridPrefab = getChild(uiobjs.starGrid.transform, "00000").gameObject
|
||||
|
||||
---@type UIToggle
|
||||
uiobjs.ToggleDetail = getCC(self.transform, "Top/SpriteToggle/ToggleDetail", "UIToggle")
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.DetailRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLUIFormRoot")
|
||||
uiobjs.InputTask = getCC(uiobjs.DetailRoot.transform, "InputTask", "UIPopupList")
|
||||
uiobjs.InputCustType = getCC(uiobjs.DetailRoot.transform, "InputCustType", "UIPopupList")
|
||||
uiobjs.InputStatus = getCC(uiobjs.DetailRoot.transform, "InputStatus", "UIPopupList")
|
||||
uiobjs.InputFrom = getCC(uiobjs.DetailRoot.transform, "InputFrom", "UIPopupList")
|
||||
uiobjs.starGrid2 = getCC(uiobjs.DetailRoot.transform, "InputStars/Grid", "UIGrid")
|
||||
uiobjs.starGridPrefab2 = getChild(uiobjs.starGrid2.transform, "00000").gameObject
|
||||
|
||||
---@type Coolape.CLUILoopGrid
|
||||
uiobjs.Records = getCC(uiobjs.Table.transform, "Records", "CLUILoopGrid")
|
||||
uiobjs.ButtonEndList = getChild(uiobjs.Records.transform, "ButtonEndList")
|
||||
|
||||
uiobjs.ExtendRoot = getCC(uiobjs.Table.transform, "ExtendRoot", "CLCellLua")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCustDetail
|
||||
function TRPCustDetail:setData(paras)
|
||||
self.mdata = paras
|
||||
if type(self.mdata.jsonstr) == "string" then
|
||||
self.mdata.jsonstr = json.decode(self.mdata.jsonstr)
|
||||
end
|
||||
end
|
||||
|
||||
---public 当有通用背板显示时的回调
|
||||
---@param cs Coolape.CLPanelLua
|
||||
function TRPCustDetail:onShowFrame(cs)
|
||||
if cs.frameObj then
|
||||
---@type _BGFrame1Param
|
||||
local d = {}
|
||||
-- d.title = LGet(cs.titleKeyName)
|
||||
d.title = self.mdata.companyName
|
||||
d.panel = cs
|
||||
cs.frameObj:init(d)
|
||||
end
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCustDetail:show()
|
||||
self.records = nil
|
||||
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
|
||||
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
|
||||
uiobjs.InputStatus:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.custTypeList)
|
||||
uiobjs.LabelType:refreshItems(optionInfor.options, optionInfor.values)
|
||||
uiobjs.InputCustType:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.custFromList)
|
||||
uiobjs.InputFrom:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.taskList)
|
||||
uiobjs.InputTask:refreshItems(optionInfor.options, optionInfor.values)
|
||||
-- 设置星级
|
||||
local stars = {}
|
||||
for i = 1, 5 do
|
||||
table.insert(stars, i <= (self.mdata.customerLabel or 0) and true or false)
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.starGrid, uiobjs.starGridPrefab, stars, self:wrapFunc(self.initStarCell))
|
||||
|
||||
uiobjs.Head:setValue(self.mdata)
|
||||
uiobjs.ToggleDetail:Set(true)
|
||||
self.currToggle = 1
|
||||
self:showDetail()
|
||||
end
|
||||
|
||||
function TRPCustDetail:initStarCell(cell, data)
|
||||
local sp = cell:GetComponent("UISprite")
|
||||
if data then
|
||||
sp.color = ColorEx.getColor(0xffFFC000)
|
||||
CLUIUtl.setSpriteFit(sp, "cust_full_star")
|
||||
else
|
||||
sp.color = ColorEx.getColor(0xffd9d9d9)
|
||||
CLUIUtl.setSpriteFit(sp, "cust_star")
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustDetail:showDetail()
|
||||
SetActive(uiobjs.DetailRoot.gameObject, true)
|
||||
SetActive(uiobjs.ExtendRoot.gameObject, true)
|
||||
SetActive(uiobjs.Records.gameObject, false)
|
||||
uiobjs.DetailRoot:setValue(self.mdata)
|
||||
uiobjs.ExtendRoot:init({data = self.mdata, isEditMode = false}, nil)
|
||||
|
||||
-- 设置星级
|
||||
local stars = {}
|
||||
for i = 1, 5 do
|
||||
table.insert(stars, i <= (self.mdata.customerLabel or 0) and true or false)
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.starGrid, uiobjs.starGridPrefab, stars, self:wrapFunc(self.initStarCell))
|
||||
CLUIUtl.resetList4Lua(uiobjs.starGrid2, uiobjs.starGridPrefab2, stars, self:wrapFunc(self.initStarCell))
|
||||
|
||||
uiobjs.Table:Reposition()
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function TRPCustDetail:showRecords()
|
||||
SetActive(uiobjs.DetailRoot.gameObject, false)
|
||||
SetActive(uiobjs.ExtendRoot.gameObject, false)
|
||||
SetActive(uiobjs.Records.gameObject, true)
|
||||
if self.records then
|
||||
uiobjs.Records:setList(
|
||||
self.records.data or {},
|
||||
self:wrapFunc(self.initRecordCell),
|
||||
self:wrapFunc(self.onHeadList),
|
||||
self:wrapFunc(self.onEndList)
|
||||
)
|
||||
else
|
||||
showHotWheel()
|
||||
NetProto.send.query_cust_calllog(self.mdata.phoneNo, nil, 1)
|
||||
uiobjs.Records:setList({}, self:wrapFunc(self.initRecordCell))
|
||||
end
|
||||
|
||||
uiobjs.Table:Reposition()
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function TRPCustDetail:initRecordCell(cell, data)
|
||||
cell:init(data, nil)
|
||||
end
|
||||
|
||||
function TRPCustDetail:onHeadList(head)
|
||||
printw("到最顶端了")
|
||||
end
|
||||
|
||||
function TRPCustDetail:onEndList(tail)
|
||||
printw("到最后了==" .. tail.name)
|
||||
if self.records and self.records.meta.current_page < self.records.meta.total_pages then
|
||||
showHotWheel()
|
||||
-- 取得下一页
|
||||
NetProto.send.query_cust_calllog(self.mdata.phoneNo, nil, self.records.meta.current_page + 1)
|
||||
else
|
||||
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -270
|
||||
SetActive(uiobjs.ButtonEndList.gameObject, true)
|
||||
end
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPCustDetail:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPCustDetail:hide()
|
||||
if uiobjs.ExtendRoot.luaTable then
|
||||
uiobjs.ExtendRoot.luaTable.release()
|
||||
end
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPCustDetail:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if cmd == NetProto.cmds.query_cust_calllog then
|
||||
local result = paras.result
|
||||
if self.records == nil then
|
||||
self.records = result
|
||||
else
|
||||
if self.records.meta.current_page < result.meta.current_page then
|
||||
self.records.meta = result.meta
|
||||
for i, v in ipairs(result.data) do
|
||||
table.insert(self.records.data, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hideHotWheel()
|
||||
if self.records and uiobjs.Records.gameObject.activeInHierarchy then
|
||||
if self.records.meta.current_page == 1 then
|
||||
self:showRecords()
|
||||
else
|
||||
uiobjs.Records:appendList(result.data)
|
||||
end
|
||||
end
|
||||
elseif cmd == NetProto.cmds.update_customer then
|
||||
if self.currToggle == 1 then
|
||||
self:showDetail()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustDetail:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ToggleDetail = function()
|
||||
self.currToggle = 1
|
||||
self:showDetail()
|
||||
end,
|
||||
ToggleRecords = function()
|
||||
self.currToggle = 2
|
||||
self:showRecords()
|
||||
end,
|
||||
ButtonNewFollow = function()
|
||||
end,
|
||||
ButtonNewTask = function()
|
||||
end,
|
||||
ButtonCall = function()
|
||||
MyUtl.callCust(self.mdata)
|
||||
end,
|
||||
ButtonMore = function()
|
||||
getPanelAsy("PanelMoreProc4Cust", onLoadedPanelTT, self.mdata)
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPCustDetail:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPCustDetail:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPCustDetail
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd312271a12414790b5ddf2b20f8d582
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,175 @@
|
||||
---@class _ParamPCustFilter
|
||||
---@field callback
|
||||
---@field defautFilter table
|
||||
---@field queryKey
|
||||
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPCustFilter:TRBasePanel 邮件列表
|
||||
local TRPCustFilter = class("TRPCustFilter", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPCustFilter:init(csObj)
|
||||
TRPCustFilter.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 50, 190)
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
uiobjs.Table = getCC(self.transform, "PanelContent/Grid", "UITable")
|
||||
uiobjs.prefab = getChild(uiobjs.Table.transform, "00000").gameObject
|
||||
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
|
||||
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
|
||||
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCustFilter
|
||||
function TRPCustFilter:setData(paras)
|
||||
---@type _ParamPCustFilter
|
||||
self.mdata = paras
|
||||
|
||||
if self.mdata.defautFilter then
|
||||
self.list = self.mdata.defautFilter
|
||||
else
|
||||
self.list = {}
|
||||
local d = {}
|
||||
d.title = "归属工号"
|
||||
d.key = DBCust.FilterGroup.loginNoList
|
||||
d.key2 = "loginNos"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.loginNoList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "任务名称"
|
||||
d.key = DBCust.FilterGroup.taskList
|
||||
d.key2 = "taskId"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.taskList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户来源"
|
||||
d.key = DBCust.FilterGroup.custFromList
|
||||
d.key2 = "custFrom"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.custFromList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户状态"
|
||||
d.key = DBCust.FilterGroup.dealFlagList
|
||||
d.key2 = "dealFlag"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.dealFlagList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "任务类型"
|
||||
d.key = DBCust.FilterGroup.custTypeList
|
||||
d.key2 = "custType"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.custTypeList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCustFilter:show()
|
||||
uiobjs.InputSeachKey.value = self.mdata.queryKey
|
||||
self:refreshFilterBtnStatus()
|
||||
CLUIUtl.resetList4Lua(uiobjs.Table, uiobjs.prefab, self.list, self:wrapFunc(self.initCell))
|
||||
end
|
||||
|
||||
function TRPCustFilter:initCell(cell, data)
|
||||
data.panel = self
|
||||
cell:init(data, nil)
|
||||
end
|
||||
|
||||
function TRPCustFilter:refreshFilterBtnStatus()
|
||||
if self:hadFilterVal() then
|
||||
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff2990dc)
|
||||
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff2990dc)
|
||||
else
|
||||
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff999999)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustFilter:hadFilterVal()
|
||||
for i,v in ipairs(self.list) do
|
||||
for j, f in ipairs(v.list) do
|
||||
if f.selected then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPCustFilter:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPCustFilter:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPCustFilter:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustFilter:reset()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
for i,v in ipairs(self.list) do
|
||||
for j, f in ipairs(v.list) do
|
||||
f.selected = false
|
||||
end
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.Table, uiobjs.prefab, self.list, self:wrapFunc(self.initCell))
|
||||
self:refreshFilterBtnStatus()
|
||||
end
|
||||
|
||||
function TRPCustFilter:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonReset = function()
|
||||
self:reset()
|
||||
end,
|
||||
ButtonOkay = function()
|
||||
Utl.doCallback(self.mdata.callback, self.list, uiobjs.InputSeachKey.value)
|
||||
hideTopPanel(self.csSelf)
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPCustFilter:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPCustFilter:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPCustFilter
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6596afb454f434fd794f22ee7bcc5873
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,193 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPCustList:TRBasePanel 邮件列表
|
||||
local TRPCustList = class("TRPCustList", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPCustList:init(csObj)
|
||||
TRPCustList.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 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")
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
---@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")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCustList
|
||||
function TRPCustList:setData(paras)
|
||||
self.mdata = paras
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCustList:show()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
self:refreshFilterBtnStatus()
|
||||
self:showList({})
|
||||
NetProto.send.list_customers(self.filterValue, "", 1)
|
||||
end
|
||||
|
||||
function TRPCustList:showList(list)
|
||||
SetActive(uiobjs.ButtonEndList.gameObject, false)
|
||||
uiobjs.Grid:setList(
|
||||
list or {},
|
||||
self:wrapFunc(self.initCell),
|
||||
self:wrapFunc(self.onHeadList),
|
||||
self:wrapFunc(self.onEndList)
|
||||
)
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function TRPCustList:appList(list)
|
||||
SetActive(uiobjs.ButtonEndList.gameObject, false)
|
||||
uiobjs.Grid:appendList(list)
|
||||
end
|
||||
|
||||
function TRPCustList:onHeadList(head)
|
||||
printw("到最顶端了")
|
||||
end
|
||||
|
||||
function TRPCustList:onEndList(tail)
|
||||
printw("到最后了==" .. tail.name)
|
||||
if self.pageInfo and self.pageInfo.current_page < self.pageInfo.total_pages then
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
showHotWheel()
|
||||
-- 取得下一页
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, self.pageInfo.current_page + 1)
|
||||
else
|
||||
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -270
|
||||
SetActive(uiobjs.ButtonEndList.gameObject, true)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustList:initCell(cell, data)
|
||||
cell:init(data, self:wrapFunc(self.onClickCell))
|
||||
end
|
||||
|
||||
function TRPCustList:onClickCell(cell, data)
|
||||
getPanelAsy("PanelCustDetail", onLoadedPanelTT, data)
|
||||
end
|
||||
|
||||
function TRPCustList:refreshFilterBtnStatus()
|
||||
if self:hadFilterVal() then
|
||||
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff2990dc)
|
||||
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff2990dc)
|
||||
else
|
||||
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff999999)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustList:hadFilterVal()
|
||||
for i, v in ipairs(self.filters or {}) do
|
||||
for j, f in ipairs(v.list) do
|
||||
if f.selected then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
-- 刷新
|
||||
function TRPCustList:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPCustList:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPCustList:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if cmd == NetProto.cmds.list_customers then
|
||||
local result = paras.result or {}
|
||||
self.pageInfo = result.meta
|
||||
if self.pageInfo and self.pageInfo.current_page > 1 then
|
||||
self:appList(result.data)
|
||||
else
|
||||
self:showList(result.data)
|
||||
end
|
||||
hideHotWheel()
|
||||
elseif cmd == NetProto.cmds.update_customer then
|
||||
uiobjs.Grid:refreshContentOnly()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustList:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonAddCust = function()
|
||||
getPanelAsy("PanelNewCust", onLoadedPanelTT)
|
||||
end,
|
||||
ButtonFilter = function()
|
||||
getPanelAsy(
|
||||
"PanelCustFilter",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
callback = self:wrapFunc(self.onSetFilter),
|
||||
queryKey = uiobjs.InputSeachKey.value,
|
||||
defautFilter = self.filters
|
||||
}
|
||||
)
|
||||
end,
|
||||
InputSeachKey = function()
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
function TRPCustList:getFilterStr()
|
||||
if not self.filters then
|
||||
return ""
|
||||
end
|
||||
local ret = {}
|
||||
for i, g in ipairs(self.filters) do
|
||||
local list = {}
|
||||
for j, f in ipairs(g.list) do
|
||||
if f.selected and f.value ~= -1 then
|
||||
table.insert(list, f.value)
|
||||
end
|
||||
end
|
||||
ret[g.key2] = table.concat(list, ",")
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
function TRPCustList:onSetFilter(filters, queryKey)
|
||||
local oldqueryKey = uiobjs.InputSeachKey.value
|
||||
uiobjs.InputSeachKey.value = queryKey
|
||||
self.filters = filters
|
||||
self:refreshFilterBtnStatus()
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
queryKey = trim(queryKey)
|
||||
showHotWheel()
|
||||
self.filterValue = self:getFilterStr()
|
||||
-- if oldqueryKey == queryKey then
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
-- else
|
||||
-- 会触发input的onChange事件
|
||||
-- end
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPCustList:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPCustList:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPCustList
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4296bf2ab1a8b47c2b35d56114b98397
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPCustListProc:TRBasePanel 邮件列表
|
||||
local TRPCustListProc = class("TRPCustListProc", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPCustListProc:init(csObj)
|
||||
TRPCustListProc.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 30, 0)
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
uiobjs.grid = getCC(self.transform, "PanelContent/Grid", "CLUILoopGrid")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCustListProc
|
||||
function TRPCustListProc:setData(paras)
|
||||
---@type _DBMessage
|
||||
self.mdata = paras
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCustListProc:show()
|
||||
local list = DBMessage.getMessages(self.mdata.NOTICETYPE)
|
||||
uiobjs.grid:setList(list, self:wrapFunc(self.initCell))
|
||||
uiobjs.scrollview:ResetPosition()
|
||||
end
|
||||
|
||||
function TRPCustListProc:initCell(cell, data)
|
||||
cell:init(data, self:wrapFunc(self.onClickCell))
|
||||
end
|
||||
|
||||
function TRPCustListProc:onClickCell(cell, data)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPCustListProc:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPCustListProc:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPCustListProc:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustListProc:setEventDelegate()
|
||||
self.EventDelegate = {}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPCustListProc:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPCustListProc:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPCustListProc
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d01f09104f204371a301ac84a34d4ba
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
150
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPLogin.lua
Normal file
150
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPLogin.lua
Normal file
@@ -0,0 +1,150 @@
|
||||
---@type IDBasePanel
|
||||
local IDBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPLogin:IDBasePanel 邮件列表
|
||||
local TRPLogin = class("TRPLogin", IDBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPLogin:init(csObj)
|
||||
TRPLogin.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.formRoot = self.csSelf:GetComponent("CLUIFormRoot")
|
||||
uiobjs.InputPhoneNum = getCC(self.transform, "InputPhoneNum", "UIInput")
|
||||
uiobjs.InputPassword = getCC(self.transform, "InputPassword", "UIInput")
|
||||
---@type UIButton
|
||||
uiobjs.ButtonLogin = getCC(self.transform, "ButtonLogin", "UIButton")
|
||||
---@type UISprite
|
||||
uiobjs.ButtonLoginBg = uiobjs.ButtonLogin:GetComponent("UISprite")
|
||||
uiobjs.ButtonDelPhoneNum = getChild(uiobjs.InputPhoneNum.transform, "ButtonDelPhoneNum")
|
||||
uiobjs.ButtonDelPassword = getChild(uiobjs.InputPassword.transform, "ButtonDelPassword")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPLogin
|
||||
function TRPLogin:setData(paras)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPLogin:show()
|
||||
uiobjs.formRoot:setValue({})
|
||||
uiobjs.InputPassword.value = Prefs.getUserPsd()
|
||||
uiobjs.InputPhoneNum.value = Prefs.getUserName()
|
||||
SetActive(uiobjs.ButtonDelPassword.gameObject, false)
|
||||
SetActive(uiobjs.ButtonDelPhoneNum.gameObject, false)
|
||||
self:getsetButtonloginState()
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPLogin:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPLogin:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPLogin:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPLogin:onInputPhoneNumChg()
|
||||
self:getsetButtonloginState()
|
||||
-- if isNilOrEmpty(uiobjs.InputPhoneNum.value) then
|
||||
-- SetActive(uiobjs.ButtonDelPhoneNum.gameObject, false)
|
||||
-- else
|
||||
-- SetActive(uiobjs.ButtonDelPhoneNum.gameObject, true)
|
||||
-- end
|
||||
end
|
||||
|
||||
function TRPLogin:onInputPasswordChg()
|
||||
self:getsetButtonloginState()
|
||||
-- if isNilOrEmpty(uiobjs.InputPassword.value) then
|
||||
-- SetActive(uiobjs.ButtonDelPassword.gameObject, false)
|
||||
-- else
|
||||
-- SetActive(uiobjs.ButtonDelPassword.gameObject, true)
|
||||
-- end
|
||||
end
|
||||
|
||||
function TRPLogin:getsetButtonloginState()
|
||||
if (isNilOrEmpty(uiobjs.InputPhoneNum.value) or isNilOrEmpty(uiobjs.InputPassword.value)) then
|
||||
-- uiobjs.ButtonLogin.isEnabled = false
|
||||
uiobjs.ButtonLoginBg.alpha = 0.65
|
||||
return false
|
||||
end
|
||||
-- uiobjs.ButtonLogin.isEnabled = true
|
||||
uiobjs.ButtonLoginBg.alpha = 1
|
||||
return true
|
||||
end
|
||||
|
||||
function TRPLogin:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonLogin = function()
|
||||
local err = uiobjs.formRoot:checkValid()
|
||||
if not isNilOrEmpty(err) then
|
||||
return
|
||||
end
|
||||
if not self:getsetButtonloginState() then
|
||||
return
|
||||
end
|
||||
local formData = uiobjs.formRoot:getValue(true)
|
||||
NetProto.login(
|
||||
formData,
|
||||
function(content, orgs)
|
||||
if content.success then
|
||||
Prefs.setUserName(formData.phone)
|
||||
Prefs.setUserPsd(formData.password)
|
||||
|
||||
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
|
||||
if isNilOrEmpty(currGroup) then
|
||||
---@type _ParamTRPSelectGroup
|
||||
local d = {}
|
||||
d.isHideCloseBtn = true
|
||||
d.companyList = content.result
|
||||
getPanelAsy("PanelSelectCompany", onLoadedPanel, d)
|
||||
else
|
||||
getPanelAsy("PanelConnect", onLoadedPanel)
|
||||
end
|
||||
end
|
||||
end,
|
||||
function()
|
||||
CLAlert.add("登录失败,请确保网络通畅!", Color.yellow, 1)
|
||||
end
|
||||
)
|
||||
end,
|
||||
ButtonDelPhoneNum = function()
|
||||
uiobjs.InputPhoneNum.value = ""
|
||||
SetActive(uiobjs.ButtonDelPhoneNum.gameObject, false)
|
||||
end,
|
||||
ButtonDelPassword = function()
|
||||
uiobjs.InputPassword.value = ""
|
||||
SetActive(uiobjs.ButtonDelPassword.gameObject, false)
|
||||
end,
|
||||
ButtonForgetPassword = function()
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, uiobjs.formRoot:getValue(true))
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPLogin:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
function TRPLogin:hideSelfOnKeyBack()
|
||||
return false
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPLogin:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPLogin
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77daad2379ee44d498485141c7430fd3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
---@class _ParamModifyField
|
||||
---@field label string 字段名
|
||||
---@field key string 字段key
|
||||
---@field value any 字段value
|
||||
---@field canNull boolean
|
||||
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPModifyFiled:TRBasePanel
|
||||
local TRPModifyFiled = class("TRPModifyFiled", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPModifyFiled:init(csObj)
|
||||
TRPModifyFiled.super.init(self, csObj)
|
||||
|
||||
self:setEventDelegate()
|
||||
---@type CLUIElement
|
||||
uiobjs.element = getCC(self.transform, "Top/Input", "CLUIElement")
|
||||
uiobjs.Input = getCC(self.transform, "Top/Input", "UIInput")
|
||||
uiobjs.Label = getCC(uiobjs.Input.transform, "Label2", "UILabel")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPModifyFiled
|
||||
function TRPModifyFiled:setData(paras)
|
||||
---@type _ParamModifyField
|
||||
self.mdata = paras
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPModifyFiled:show()
|
||||
uiobjs.element.jsonKey = self.mdata.jsonKey
|
||||
uiobjs.element.canNull = self.mdata.canNull
|
||||
uiobjs.Label.text = self.mdata.label
|
||||
uiobjs.Input.value = self.mdata.value
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPModifyFiled:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPModifyFiled:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPModifyFiled:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPModifyFiled:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonOkay = function()
|
||||
local err = uiobjs.element:checkValid()
|
||||
if not isNilOrEmpty(err) then
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
return
|
||||
end
|
||||
Utl.doCallback(self.mdata.callback, self.mdata.key, uiobjs.Input.value)
|
||||
hideTopPanel(self.csSelf)
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPModifyFiled:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPModifyFiled:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPModifyFiled
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8f79ee5166b241b292ca7d5c2ff13dd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPMoreProc4Cust:TRBasePanel 邮件列表
|
||||
local TRPMoreProc4Cust = class("TRPMoreProc4Cust", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPMoreProc4Cust:init(csObj)
|
||||
TRPMoreProc4Cust.super.init(self, csObj)
|
||||
|
||||
self:setEventDelegate()
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPMoreProc4Cust
|
||||
function TRPMoreProc4Cust:setData(paras)
|
||||
self.mdata = paras
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPMoreProc4Cust:show()
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPMoreProc4Cust:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPMoreProc4Cust:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPMoreProc4Cust:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPMoreProc4Cust:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonClose = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
SpriteBg = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonSendSM = function()
|
||||
end,
|
||||
ButtonMovetoOcean = function()
|
||||
end,
|
||||
ButtonGetCust = function()
|
||||
end,
|
||||
ButtonEdit = function()
|
||||
getPanelAsy("PanelNewCust", onLoadedPanel, self.mdata)
|
||||
end,
|
||||
ButtonPos = function()
|
||||
end,
|
||||
ButtonCheckIn = function()
|
||||
end,
|
||||
ButtonDelCust = function()
|
||||
end,
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPMoreProc4Cust:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPMoreProc4Cust:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPMoreProc4Cust
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ad37b06bd987442bb22192d3951a107
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
379
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPNewCust.lua
Normal file
379
Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPNewCust.lua
Normal file
@@ -0,0 +1,379 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPNewCust:TRBasePanel 邮件列表
|
||||
local TRPNewCust = class("TRPNewCust", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
|
||||
local stars = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPNewCust:init(csObj)
|
||||
TRPNewCust.super.init(self, csObj)
|
||||
|
||||
self:setEventDelegate()
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
---@type UITable
|
||||
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.DetailRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLUIFormRoot")
|
||||
---@type UITable
|
||||
uiobjs.DetailRootTabel = uiobjs.DetailRoot:GetComponent("UITable")
|
||||
uiobjs.InputTask = getCC(uiobjs.DetailRoot.transform, "InputTask", "UIPopupList")
|
||||
uiobjs.InputCustType = getCC(uiobjs.DetailRoot.transform, "InputCustType", "UIPopupList")
|
||||
uiobjs.InputStatus = getCC(uiobjs.DetailRoot.transform, "InputStatus", "UIPopupList")
|
||||
uiobjs.InputFrom = getCC(uiobjs.DetailRoot.transform, "InputFrom", "UIPopupList")
|
||||
uiobjs.InputLogin = getCC(uiobjs.DetailRoot.transform, "InputLogin", "UIPopupList")
|
||||
uiobjs.starGrid2 = getCC(uiobjs.DetailRoot.transform, "InputStars/Grid", "UIGrid")
|
||||
uiobjs.starGridPrefab2 = getChild(uiobjs.starGrid2.transform, "00000").gameObject
|
||||
|
||||
uiobjs.ExtendRoot = getCC(uiobjs.Table.transform, "ExtendRoot", "CLCellLua")
|
||||
uiobjs.elements = uiobjs.DetailRoot.gameObject:GetComponentsInChildren(typeof(CLUIElement), true)
|
||||
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPNewCust
|
||||
function TRPNewCust:setData(paras)
|
||||
if paras and paras.custId > 0 then
|
||||
self.isNewCust = false
|
||||
self.mdata = paras
|
||||
else
|
||||
self.isNewCust = true
|
||||
self.mdata = {}
|
||||
self.mdata.dealflag = "0"
|
||||
self.mdata.custType = "0"
|
||||
self.mdata.custFrom = "0"
|
||||
self.mdata.serviceNo = NetProto.loginNo
|
||||
self.mdata.customerLabel = 1
|
||||
end
|
||||
if type(self.mdata.jsonstr) == "string" then
|
||||
self.mdata.jsonstr = json.decode(self.mdata.jsonstr)
|
||||
end
|
||||
end
|
||||
|
||||
---public 当有通用背板显示时的回调
|
||||
---@param cs Coolape.CLPanelLua
|
||||
function TRPNewCust:onShowFrame(cs)
|
||||
if cs.frameObj then
|
||||
---@type _BGFrame1Param
|
||||
local d = {}
|
||||
if self.isNewCust then
|
||||
d.title = "新建客户"
|
||||
else
|
||||
d.title = "修改客户"
|
||||
end
|
||||
d.panel = cs
|
||||
cs.frameObj:init(d)
|
||||
end
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPNewCust:show()
|
||||
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
|
||||
uiobjs.InputStatus:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.custTypeList)
|
||||
uiobjs.InputCustType:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.custFromList)
|
||||
uiobjs.InputFrom:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.taskList)
|
||||
uiobjs.InputTask:refreshItems(optionInfor.options, optionInfor.values)
|
||||
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.loginNoList)
|
||||
uiobjs.InputLogin:refreshItems(optionInfor.options, optionInfor.values)
|
||||
|
||||
self:refreshContent()
|
||||
|
||||
self:setMode()
|
||||
SetActive(uiobjs.ButtonSave.gameObject, self.isNewCust)
|
||||
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function TRPNewCust:refreshContent()
|
||||
uiobjs.DetailRoot:setValue(self.mdata)
|
||||
if self.isNewCust then
|
||||
uiobjs.ExtendRoot:init(
|
||||
{
|
||||
data = self.mdata,
|
||||
onFinish = self:wrapFunc(self.setExtendFieldsMode),
|
||||
isEditMode = true
|
||||
},
|
||||
nil
|
||||
)
|
||||
else
|
||||
uiobjs.ExtendRoot:init(
|
||||
{
|
||||
data = self.mdata,
|
||||
isEditMode = true,
|
||||
onFinish = self:wrapFunc(self.setExtendFieldsMode),
|
||||
onClick = self:wrapFunc(self.onClickInputField4Extend),
|
||||
onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
|
||||
},
|
||||
nil
|
||||
)
|
||||
end
|
||||
|
||||
-- 设置星级
|
||||
stars = {}
|
||||
for i = 1, 5 do
|
||||
table.insert(stars, {index = i, value = i <= (self.mdata.customerLabel or 0) and true or false})
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.starGrid2, uiobjs.starGridPrefab2, stars, self:wrapFunc(self.initStarCell))
|
||||
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
|
||||
end
|
||||
|
||||
function TRPNewCust:reposition()
|
||||
uiobjs.DetailRootTabel.repositionNow = true
|
||||
uiobjs.Table.repositionNow = true
|
||||
end
|
||||
|
||||
function TRPNewCust:initStarCell(cell, data)
|
||||
cell:init(data, self:wrapFunc(self.onClickStar))
|
||||
end
|
||||
|
||||
function TRPNewCust:onClickStar(cell, data)
|
||||
for i, v in ipairs(stars) do
|
||||
if v.index <= data.index then
|
||||
v.value = true
|
||||
else
|
||||
v.value = false
|
||||
end
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.starGrid2, uiobjs.starGridPrefab2, stars, self:wrapFunc(self.initStarCell))
|
||||
if (not self.isNewCust) and data.index ~= self.mdata.customerLabel then
|
||||
-- 说明更改了星级
|
||||
self:sendModifymsg("customerLabel", data.index, false)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:setMode()
|
||||
local count = uiobjs.elements.Length
|
||||
for i = 0, count - 1 do
|
||||
self:setElementMode(uiobjs.elements[i])
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:setExtendFieldsMode()
|
||||
local elements = uiobjs.ExtendRoot.gameObject:GetComponentsInChildren(typeof(CLUIElement), true)
|
||||
for i = 0, elements.Length - 1 do
|
||||
self:setElementMode(elements[i])
|
||||
end
|
||||
self:reposition()
|
||||
end
|
||||
|
||||
function TRPNewCust:setElementMode(el)
|
||||
local isPopList = el:GetComponent("UIPopupList")
|
||||
local isPopCheckbox = el:GetComponent("CLUICheckbox")
|
||||
---@type UIInput
|
||||
local input = el:GetComponent("UIInput")
|
||||
local inputOnGUI = el:GetComponent("UIInputOnGUI")
|
||||
local boxcollider = el:GetComponent("BoxCollider")
|
||||
|
||||
if (not self.isNewCust) and (el.jsonKey == "taskId" or el.jsonKey == "phoneNo") then
|
||||
boxcollider.enabled = false
|
||||
else
|
||||
boxcollider.enabled = true
|
||||
end
|
||||
if input then
|
||||
if isPopList or isPopCheckbox then
|
||||
input.enabled = false
|
||||
if inputOnGUI then
|
||||
inputOnGUI.enabled = false
|
||||
end
|
||||
else
|
||||
if self.isNewCust then
|
||||
input.enabled = true
|
||||
if inputOnGUI then
|
||||
inputOnGUI.enabled = true
|
||||
end
|
||||
else
|
||||
input.enabled = false
|
||||
if inputOnGUI then
|
||||
inputOnGUI.enabled = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPNewCust:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPNewCust:hide()
|
||||
if uiobjs.ExtendRoot.luaTable then
|
||||
uiobjs.ExtendRoot.luaTable.release()
|
||||
end
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPNewCust:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if cmd == NetProto.cmds.update_customer then
|
||||
self:refreshContent()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:onPopupFieldValChg(go)
|
||||
if self.isNewCust then
|
||||
return
|
||||
end
|
||||
---@type CLUIElement
|
||||
local el = go:GetComponent("CLUIElement")
|
||||
if el then
|
||||
local err = el:checkValid()
|
||||
if tostring(el.value) ~= tostring(self.mdata[el.jsonKey]) then
|
||||
if isNilOrEmpty(err) then
|
||||
self:sendModifymsg(el.jsonKey, el.value, false)
|
||||
else
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:onClickInputField(go)
|
||||
if self.isNewCust then
|
||||
return
|
||||
end
|
||||
|
||||
---@type CLUIElement
|
||||
local el = go:GetComponent("CLUIElement")
|
||||
if el then
|
||||
getPanelAsy(
|
||||
"PanelModifyFiled",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
label = el.labeName.text,
|
||||
key = el.jsonKey,
|
||||
value = el.value,
|
||||
canNull = el.canNull,
|
||||
callback = self:wrapFunc(self.onFinishSetField)
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
function TRPNewCust:onFinishSetField(key, val)
|
||||
if tostring(val) ~= tostring(self.mdata[key]) then
|
||||
self:sendModifymsg(key, val, false)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:sendModifymsg(key, val, isExtend)
|
||||
local content = {}
|
||||
content.id = self.mdata.custId
|
||||
if isExtend then
|
||||
content.jsonstr = {[key] = val}
|
||||
else
|
||||
content[key] = val
|
||||
end
|
||||
showHotWheel()
|
||||
NetProto.send.update_customer(
|
||||
content,
|
||||
function(result, orgs)
|
||||
hideHotWheel()
|
||||
if result.success then
|
||||
-- 更新本地数据
|
||||
if isExtend then
|
||||
self.mdata.jsonstr[key] = val
|
||||
else
|
||||
self.mdata[key] = val
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function TRPNewCust:onPopupFieldValChg4Extend(go)
|
||||
if self.isNewCust then
|
||||
return
|
||||
end
|
||||
---@type CLUIElement
|
||||
local el = go:GetComponent("CLUIElement")
|
||||
if el then
|
||||
local err = el:checkValid()
|
||||
if (not isNilOrEmpty(el.value)) and tostring(el.value) ~= tostring(self.mdata.jsonstr[el.jsonKey]) then
|
||||
if isNilOrEmpty(err) then
|
||||
-- 有修改,发送数据
|
||||
self:sendModifymsg(el.jsonKey, el.value, true)
|
||||
else
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:onClickInputField4Extend(go)
|
||||
if self.isNewCust then
|
||||
return
|
||||
end
|
||||
|
||||
---@type CLUIElement
|
||||
local el = go:GetComponent("CLUIElement")
|
||||
if el then
|
||||
getPanelAsy(
|
||||
"PanelModifyFiled",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
label = el.labeName.text,
|
||||
key = el.jsonKey,
|
||||
value = el.value,
|
||||
canNull = el.canNull,
|
||||
callback = self:wrapFunc(self.onFinishSetField4Extend)
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:onFinishSetField4Extend(key, val)
|
||||
if tostring(val) ~= tostring(self.mdata.jsonstr[key]) then
|
||||
self:sendModifymsg(key, val, true)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPNewCust:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonSave = function()
|
||||
end,
|
||||
InputTask = function()
|
||||
if self.isNewCust then
|
||||
uiobjs.ExtendRoot:init(
|
||||
{
|
||||
data = {taskId = uiobjs.InputTask.value},
|
||||
onFinish = self:wrapFunc(self.setExtendFieldsMode),
|
||||
isEditMode = true
|
||||
},
|
||||
nil
|
||||
)
|
||||
else
|
||||
uiobjs.ExtendRoot:init(
|
||||
{
|
||||
data = self.mdata,
|
||||
isEditMode = true,
|
||||
onFinish = self:wrapFunc(self.setExtendFieldsMode),
|
||||
onClick = self:wrapFunc(self.onClickInputField4Extend),
|
||||
onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
|
||||
},
|
||||
nil
|
||||
)
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPNewCust:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPNewCust:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPNewCust
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39206792c178d401cbf4e534289addc7
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPPlaySoundRecord:TRBasePanel 邮件列表
|
||||
local TRPPlaySoundRecord = class("TRPPlaySoundRecord", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPPlaySoundRecord:init(csObj)
|
||||
TRPPlaySoundRecord.super.init(self, csObj)
|
||||
|
||||
self:setEventDelegate()
|
||||
---@type Mp3PlayerByUrl
|
||||
uiobjs.mp3Player = self.csSelf:GetComponent("Mp3PlayerByUrl")
|
||||
uiobjs.mp3Player.audioSource = SoundEx.self.singletonAudio
|
||||
uiobjs.content = getCC(self.transform, "Bottom/content", "CLUIFormRoot")
|
||||
uiobjs.slider = getCC(uiobjs.content.transform, "Slider", "UISlider")
|
||||
uiobjs.LabelCurrent = getCC(uiobjs.slider.transform, "Thumb/LabelCurrent", "UILabel")
|
||||
uiobjs.ButtonStatus = getCC(uiobjs.content.transform, "ButtonStatus", "UISprite")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPPlaySoundRecord
|
||||
function TRPPlaySoundRecord:setData(paras)
|
||||
self.mdata = paras
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPPlaySoundRecord:show()
|
||||
uiobjs.content:setValue(self.mdata)
|
||||
uiobjs.LabelCurrent.text = ""
|
||||
uiobjs.slider.value = 0
|
||||
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_pause")
|
||||
showHotWheel()
|
||||
uiobjs.mp3Player:getAudioClip(
|
||||
self.mdata.recordfile,
|
||||
function(clip)
|
||||
hideHotWheel()
|
||||
if (self.csSelf.isActive) then
|
||||
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_pause")
|
||||
uiobjs.mp3Player:play(clip, self:wrapFunc(self.refreshProgress), self:wrapFunc(self.onFinishPlay))
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function TRPPlaySoundRecord:onFinishPlay(clip)
|
||||
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_play")
|
||||
end
|
||||
|
||||
function TRPPlaySoundRecord:refreshProgress(progress, sec)
|
||||
uiobjs.slider.value = progress
|
||||
uiobjs.LabelCurrent.text = DateEx.toStrCn(NumEx.getIntPart(sec * 1000))
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPPlaySoundRecord:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPPlaySoundRecord:hide()
|
||||
uiobjs.mp3Player:stop()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPPlaySoundRecord:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPPlaySoundRecord:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonClose = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
SpriteBg = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
Slider = function()
|
||||
uiobjs.mp3Player:seek(uiobjs.slider.value)
|
||||
end,
|
||||
ButtonStatus = function()
|
||||
if uiobjs.mp3Player.isPlaying then
|
||||
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_play")
|
||||
uiobjs.mp3Player:pause()
|
||||
else
|
||||
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_pause")
|
||||
uiobjs.mp3Player:rePlay()
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPPlaySoundRecord:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPPlaySoundRecord:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPPlaySoundRecord
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e2c08c66d7df442da24841f83d4db53
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,113 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPCheckBoxs:TRBasePanel 邮件列表
|
||||
local TRPCheckBoxs = class("TRPCheckBoxs", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
local toggles = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPCheckBoxs:init(csObj)
|
||||
TRPCheckBoxs.super.init(self, csObj)
|
||||
|
||||
self:setEventDelegate()
|
||||
local offset = getChild(self.transform, "Bottom/offset")
|
||||
uiobjs.Grid = getCC(offset, "Content/Grid", "CLUILoopGrid")
|
||||
uiobjs.LabelSelected = getCC(offset, "LabelSelected", "UILabel")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCheckBoxs
|
||||
function TRPCheckBoxs:setData(paras)
|
||||
self.mdata = paras[0]
|
||||
self.defaultValue = paras[1]
|
||||
self.selecteds = {}
|
||||
local strs = strSplit(self.defaultValue, "|")
|
||||
for i, v in ipairs(strs) do
|
||||
self.selecteds[v] = true
|
||||
end
|
||||
self.isMultMode = paras[2]
|
||||
self.callback = paras[3]
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCheckBoxs:show()
|
||||
uiobjs.LabelSelected.text = "请选择"
|
||||
local strs = strSplit(self.mdata.attrValue, "|")
|
||||
toggles = {}
|
||||
for i, v in ipairs(strs) do
|
||||
local d = {label = v, isMultMode = self.isMultMode, checked = self.selecteds[v], panel = self}
|
||||
table.insert(toggles, d)
|
||||
end
|
||||
uiobjs.Grid:setList(toggles, self:wrapFunc(self.initCell))
|
||||
self:onClickToggle()
|
||||
end
|
||||
|
||||
function TRPCheckBoxs:initCell(cell, data)
|
||||
cell:init(data, nil)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPCheckBoxs:refresh()
|
||||
end
|
||||
|
||||
function TRPCheckBoxs:onClickToggle()
|
||||
local val = self:getValue()
|
||||
if isNilOrEmpty(val) then
|
||||
uiobjs.LabelSelected.text = "请选择"
|
||||
else
|
||||
uiobjs.LabelSelected.text = joinStr("已选择:", val)
|
||||
end
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPCheckBoxs:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPCheckBoxs:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCheckBoxs:getValue()
|
||||
local values = {}
|
||||
for i, v in ipairs(toggles) do
|
||||
if v.checked then
|
||||
table.insert(values, v.label)
|
||||
end
|
||||
end
|
||||
return table.concat(values, "|")
|
||||
end
|
||||
|
||||
function TRPCheckBoxs:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
SpriteBg = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonClose = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonOkay = function()
|
||||
Utl.doCallback(self.callback, self:getValue())
|
||||
hideTopPanel(self.csSelf)
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPCheckBoxs:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPCheckBoxs:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPCheckBoxs
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c4a8ae14a12e4037b16da8deb46f62d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,93 @@
|
||||
---@type TRBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPResetPasswordStep1:TRBasePanel 邮件列表
|
||||
local TRPResetPasswordStep1 = class("TRPResetPasswordStep1", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPResetPasswordStep1:init(csObj)
|
||||
TRPResetPasswordStep1.super.init(self, csObj)
|
||||
---@type CLUIFormRoot
|
||||
uiobjs.formRoot = self.csSelf:GetComponent("CLUIFormRoot")
|
||||
uiobjs.InputPhoneNum = getCC(self.transform, "InputPhoneNum", "UIInput")
|
||||
self:setEventDelegate()
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPResetPasswordStep1
|
||||
function TRPResetPasswordStep1:setData(paras)
|
||||
self.mData = paras
|
||||
end
|
||||
|
||||
---public 当有通用背板显示时的回调
|
||||
---@param cs Coolape.CLPanelLua
|
||||
function TRPResetPasswordStep1:onShowFrame(cs)
|
||||
if cs.frameObj then
|
||||
---@type _BGFrame1Param
|
||||
local d = {}
|
||||
d.title = cs.titleKeyName
|
||||
d.panel = cs
|
||||
d.isHideCloseBtn = true
|
||||
cs.frameObj:init(d)
|
||||
end
|
||||
end
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPResetPasswordStep1:show()
|
||||
uiobjs.formRoot:setValue(self.mData)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPResetPasswordStep1:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPResetPasswordStep1:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPResetPasswordStep1:procNetwork(cmd, succ, msg, paras)
|
||||
-- if (succ == NetSuccess) then
|
||||
-- if cmd == NetProto.cmds.sendVerMsg then
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
|
||||
function TRPResetPasswordStep1:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonLeft = function()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonRight = function()
|
||||
if not isNilOrEmpty(uiobjs.formRoot:checkValid()) then
|
||||
return
|
||||
end
|
||||
|
||||
local d = uiobjs.formRoot:getValue(true)
|
||||
NetProto.sendVerMsg(
|
||||
d,
|
||||
function(data, orgs)
|
||||
if data.code == NetSuccess then
|
||||
getPanelAsy("PanelResetPasswordStep2", onLoadedPanelTT, d)
|
||||
end
|
||||
end
|
||||
)
|
||||
end,
|
||||
ButtonDelPhoneNum = function()
|
||||
uiobjs.InputPhoneNum.value = ""
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPResetPasswordStep1:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPResetPasswordStep1:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPResetPasswordStep1
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06de05ddff7ae46fe969cf2043d6f09d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user