up
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
-- 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 TweenAlpha
|
||||
uiobjs.tweenAlpha = csSelf:GetComponent("TweenAlpha")
|
||||
uiobjs.Label = getCC(transform, "Label", "UILabel")
|
||||
uiobjs.SpriteIcon = getCC(transform, "SpriteIcon", "UISprite")
|
||||
end
|
||||
|
||||
-- 显示,
|
||||
-- 注意,c#侧不会在调用show时,调用refresh
|
||||
function _cell.show(go, data)
|
||||
mData = data
|
||||
uiobjs.Label.text = trim(data.msg)
|
||||
local spriteName = ""
|
||||
local colorIcon
|
||||
if mData.type == CLToastRoot.Type.success then
|
||||
spriteName = "cust_suc"
|
||||
colorIcon = Color.green
|
||||
elseif mData.type == CLToastRoot.Type.warning then
|
||||
spriteName = "cust_suc"
|
||||
colorIcon = Color.yellow
|
||||
elseif mData.type == CLToastRoot.Type.error then
|
||||
spriteName = "cust_suc"
|
||||
colorIcon = Color.red
|
||||
else
|
||||
spriteName = "cust_suc"
|
||||
colorIcon = Color.white
|
||||
end
|
||||
uiobjs.SpriteIcon.color = colorIcon
|
||||
uiobjs.SpriteIcon.spriteName = spriteName
|
||||
uiobjs.tweenAlpha.delay = mData.staySec or 1
|
||||
uiobjs.tweenAlpha:ResetToBeginning()
|
||||
uiobjs.tweenAlpha:Play(true)
|
||||
end
|
||||
|
||||
-- 取得数据
|
||||
function _cell.getData()
|
||||
return mData
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return _cell
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13a784d9c776d449d9fc58f903e96c2d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
-- xx界面
|
||||
CLToastRoot = {}
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
---@type UnityEngine.Transform
|
||||
local transform = nil
|
||||
local uiobjs = {}
|
||||
local queue = CLLQueue.new()
|
||||
local index = 0
|
||||
|
||||
CLToastRoot.Type = {
|
||||
normal = 0,
|
||||
success = 1,
|
||||
warning = 2,
|
||||
error = 3
|
||||
}
|
||||
-- 初始化,只会调用一次
|
||||
function CLToastRoot.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
---@type UITable
|
||||
uiobjs.Table = getCC(transform, "offset", "UITable")
|
||||
uiobjs.prefab = getCC(uiobjs.Table.transform, "00000", "CLCellLua")
|
||||
SetActive(uiobjs.prefab.gameObject, false)
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLToastRoot.show()
|
||||
end
|
||||
-- 关闭页面
|
||||
function CLToastRoot.hide()
|
||||
end
|
||||
|
||||
function CLToastRoot.borrow()
|
||||
local cell
|
||||
if queue:size() == 0 then
|
||||
local go = GameObject.Instantiate(uiobjs.prefab.gameObject, uiobjs.Table.transform)
|
||||
cell = go:GetComponent("CLCellLua")
|
||||
else
|
||||
cell = queue:deQueue()
|
||||
end
|
||||
cell.name = tostring(index)
|
||||
index = index + 1
|
||||
return cell
|
||||
end
|
||||
|
||||
function CLToastRoot.returnToast(cell)
|
||||
SetActive(cell.gameObject, false)
|
||||
queue:enQueue(cell)
|
||||
end
|
||||
|
||||
function CLToastRoot.toast(msg, type, staySec)
|
||||
local cell = CLToastRoot.borrow()
|
||||
SetActive(cell.gameObject, true)
|
||||
cell:init({msg = msg, type = type, staySec = staySec}, nil)
|
||||
uiobjs.Table:Reposition()
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CLToastRoot.uiEventDelegate(go)
|
||||
local cell = go:GetComponent("CLCellLua")
|
||||
if cell then
|
||||
SetActive(go, false)
|
||||
csSelf:invoke4Lua(CLToastRoot.returnToast, cell, 0.1)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CLToastRoot
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33067a79b0a6e4f0eac1d039bb110f55
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -31,7 +31,7 @@ function _cell.show(go, data)
|
||||
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
|
||||
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
|
||||
uiobjs.formRoot:setValue(mData)
|
||||
if tostring(mData.dealflag) == "0" then
|
||||
if tostring(mData.dealFlag) == "0" then
|
||||
SetActive(uiobjs.SpriteStatus.gameObject, true)
|
||||
else
|
||||
SetActive(uiobjs.SpriteStatus.gameObject, false)
|
||||
|
||||
@@ -87,16 +87,18 @@ do
|
||||
|
||||
-- 加载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)
|
||||
-- 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("ToastRoot", onGetObj)
|
||||
getPanelAsy("ToastRoot", doShowPanel)
|
||||
end
|
||||
|
||||
function CLLPSplash.hideFirstPanel()
|
||||
do return end
|
||||
---@type Coolape.CLPanelLua
|
||||
local p = CLPanelManager.getPanel(MyMain.self.firstPanel)
|
||||
if (p ~= nil and p.gameObject.activeInHierarchy) then
|
||||
|
||||
@@ -209,7 +209,7 @@ function CLLPStart.doEnterGame()
|
||||
end
|
||||
end
|
||||
if useOldCurrGroup then
|
||||
getPanelAsy("PanelConnect", onLoadedPanel)
|
||||
getPanelAsy("PanelConnect", onLoadedPanelTT)
|
||||
else
|
||||
---@type _ParamTRPSelectGroup
|
||||
local d = {}
|
||||
|
||||
@@ -105,7 +105,7 @@ function CSPMine.onGetLocation(locInfor)
|
||||
)
|
||||
getPanelAsy("PanelWebView", onLoadedPanelTT, {url = url})
|
||||
else
|
||||
CLAlert.add(location.msg, Color.yellow, 1)
|
||||
CLAlert.add(location.msg, Color.white, 1)
|
||||
if code == 8 or code == 9 or code == 5 then
|
||||
-- 打开gps
|
||||
MyLocation.self:guidSwitchGps()
|
||||
|
||||
@@ -82,7 +82,7 @@ function TRPConnect.getDataFromServer()
|
||||
end,
|
||||
5
|
||||
)
|
||||
-- NetProto.send.announcement_query()
|
||||
NetProto.send.announcement_query()
|
||||
-- NetProto.send.booking_query()
|
||||
-- NetProto.send.replenish_query()
|
||||
end
|
||||
|
||||
@@ -37,6 +37,7 @@ function TRPCustList:show()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
self:refreshFilterBtnStatus()
|
||||
self:showList({})
|
||||
showHotWheel()
|
||||
NetProto.send.list_customers(self.filterValue, "", 1)
|
||||
end
|
||||
|
||||
@@ -196,11 +197,11 @@ function TRPCustList:onSetFilter(filters, queryKey)
|
||||
queryKey = trim(queryKey)
|
||||
showHotWheel()
|
||||
self.filterValue = self:getFilterStr()
|
||||
-- if oldqueryKey == queryKey then
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
-- else
|
||||
-- 会触发input的onChange事件
|
||||
-- end
|
||||
if oldqueryKey == queryKey then
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
else
|
||||
-- 会触发input的onChange事件
|
||||
end
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
|
||||
@@ -113,7 +113,7 @@ function TRPLogin:setEventDelegate()
|
||||
end
|
||||
end,
|
||||
function()
|
||||
CLAlert.add("登录失败,请确保网络通畅!", Color.yellow, 1)
|
||||
CLAlert.add("登录失败,请确保网络通畅!", Color.white, 1)
|
||||
end
|
||||
)
|
||||
end,
|
||||
|
||||
@@ -59,7 +59,7 @@ function TRPModifyFiled:setEventDelegate()
|
||||
ButtonOkay = function()
|
||||
local err = uiobjs.element:checkValid()
|
||||
if not isNilOrEmpty(err) then
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
CLAlert.add(err, Color.white, 1)
|
||||
return
|
||||
end
|
||||
Utl.doCallback(self.mdata.callback, self.mdata.key, uiobjs.Input.value)
|
||||
|
||||
@@ -44,7 +44,7 @@ function TRPNewCust:setData(paras)
|
||||
else
|
||||
self.isNewCust = true
|
||||
self.mdata = {}
|
||||
self.mdata.dealflag = "0"
|
||||
self.mdata.dealFlag = "0"
|
||||
self.mdata.custType = "0"
|
||||
self.mdata.custFrom = "0"
|
||||
self.mdata.serviceNo = NetProto.loginNo
|
||||
@@ -240,7 +240,7 @@ function TRPNewCust:onPopupFieldValChg(go)
|
||||
if isNilOrEmpty(err) then
|
||||
self:sendModifymsg(el.jsonKey, el.value, false)
|
||||
else
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
MyUtl.toastW(err)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -293,7 +293,7 @@ function TRPNewCust:sendModifymsg(key, val, isExtend)
|
||||
else
|
||||
self.mdata[key] = val
|
||||
end
|
||||
CLAlert.add("修改成功", Color.white, 1)
|
||||
MyUtl.toastS("修改成功")
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -312,7 +312,7 @@ function TRPNewCust:onPopupFieldValChg4Extend(go)
|
||||
-- 有修改,发送数据
|
||||
self:sendModifymsg(el.jsonKey, el.value, true)
|
||||
else
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
MyUtl.toastE(err)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -352,7 +352,7 @@ function TRPNewCust:setEventDelegate()
|
||||
local err = uiobjs.DetailRoot:checkValid()
|
||||
err = joinStr(err, uiobjs.ExtendFormRoot:checkValid())
|
||||
if not isNilOrEmpty(err) then
|
||||
CLAlert.add(err, Color.yellow, 1)
|
||||
MyUtl.toastE(err)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ end
|
||||
function TRPResetPasswordStep3:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if cmd == NetProto.cmds.updateLoginNoPwd then
|
||||
CLAlert.add("密码修改成功", Color.green, 1)
|
||||
CLAlert.add("密码修改成功", Color.green, 0)
|
||||
hideTopPanel()
|
||||
hideTopPanel()
|
||||
hideTopPanel()
|
||||
|
||||
@@ -92,7 +92,7 @@ function TRPSelectCompany:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonRight = function()
|
||||
if selectedCompany == nil then
|
||||
CLAlert.add("请选择要进入的公司", Color.white, 1)
|
||||
CLAlert.add("请选择要进入的公司", Color.white, 0)
|
||||
return
|
||||
end
|
||||
-- 缓存一下,下次进来后就不用再先公司了
|
||||
|
||||
Reference in New Issue
Block a user