This commit is contained in:
2020-07-09 08:50:24 +08:00
parent 13d25f4707
commit c523462b82
1818 changed files with 174940 additions and 582 deletions

View File

@@ -51,13 +51,13 @@ CLLMainLua.init = function()
Time.fixedDeltaTime = 0.5
-- 设置是否测试环境
if (Prefs.getTestMode()) then
local url = Prefs.getTestModeUrl()
if (not isNilOrEmpty(url)) then
CLAlert.add("Test...", Color.red, -1, 1, false)
CLVerManager.self.baseUrl = url
end
end
-- if (Prefs.getTestMode()) then
-- local url = Prefs.getTestModeUrl()
-- if (not isNilOrEmpty(url)) then
-- CLAlert.add("Test...", Color.red, -1, 1, false)
-- CLVerManager.self.baseUrl = url
-- end
-- end
local fps = CLMainBase.self:GetComponent("CLFPS")
fps.displayRect = Rect(10, 200, 640, 40)

View File

@@ -125,7 +125,7 @@ function CLLNet.dispatch(map)
if (succ ~= NetSuccess) then
retInfor.msg = Localization.Get(joinStr("Error_", succ))
CLAlert.add(retInfor.msg, Color.red, 1)
MyUtl.toastE(retInfor.msg)
hideHotWheel()
else
-- success

View File

@@ -8,13 +8,19 @@ NetProto.send = {}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
local host = "47.111.20.34"
local port = 29004
-- local host = "192.168.1.126"
-- local port = 29000
-- local baseUrl = "http://app.ttf-cti.com:29000/open_api/"
local baseUrl = "http://47.111.20.34:29004/open_api/"
local baseUrl = joinStr("http://", host, ":", port, "/open_api/")
-- local baseUrl2 = "http://47.111.20.34:29004/open_api/"
-- local socketUrl = "ws://app.ttf-cti.com:29000/tr_socket/websocket/"
local socketUrl = "ws://47.111.20.34:29004/tr_socket/websocket/"
-- local socketUrl = "ws://47.111.20.34:29004/tr_socket/websocket/"
local socketUrl = joinStr("ws://", host, ":", port, "/tr_socket/websocket/")
---@type Dist.SpringWebsocket.Client
local socket = SocketClient.self
local socket = Client4Stomp.self
local appid = 2020158
local appsecret = "ea042bc86428ca968756a6e47b10742d"
local isDebug = true
@@ -62,7 +68,7 @@ local dispatch = function(content, params)
printe(joinStr("cmd:[", cmd, "]code:[", code, "]msg:", msg))
-- retInfor.msg = Localization.Get(joinStr("Error_", succ))
if not isNilOrEmpty(msg) then
CLAlert.add(msg, Color.yellow, 1)
MyUtl.toastE(msg)
end
hideHotWheel()
else
@@ -103,7 +109,7 @@ end
NetProto.sendGet = function(cmd, map, callback, failedCallback, orgs, _baseUrl)
if isNilOrEmpty(NetProto.sign) and (cmd ~= NetProto.cmds.getTokenForAPI) then
CLAlert.add("与服务器失去联络,请重试!", Color.yellow, 1)
CLAlert.add("与服务器失去联络,请重试!", Color.white, 1)
NetProto.init()
return
end
@@ -146,12 +152,12 @@ function NetProto.init(callback)
onGetToken(data.result)
Utl.doCallback(callback, true)
else
CLAlert.add(data.msg, Color.yellow, 1)
CLAlert.add(data.msg, Color.white, 1)
Utl.doCallback(callback, false)
end
end,
function()
CLAlert.add("取得会话ID失败", Color.yellow, 1)
CLAlert.add("取得会话ID失败", Color.white, 1)
Utl.doCallback(callback, false)
end
)
@@ -233,7 +239,7 @@ NetProto.cmds = {
order_report = "order_report", -- 客户类型分布
target_report = "target_report", -- 客户类型分布
update_customer = "update_customer", -- 更新客户信息
save_customer = "save_customer", -- 新建客户
save_customer = "save_customer" -- 新建客户
}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
@@ -386,7 +392,7 @@ NetProto.sendSocket = function(content, callback, timeOutSec)
content.companyId = NetProto.comanyId
content.callbackId = setCallback(callback, content, timeOutSec)
local contentStr = json.encode(content)
InvokeEx.invoke(NetProto.doSendMsg, contentStr, 0.1)
NetProto.doSendMsg(contentStr)
end
NetProto.doSendMsg = function(contentStr)

View File

@@ -249,8 +249,8 @@ Uri = CS.System.Uri
NativeGalleryUtl = CS.NativeGalleryUtl
---@type MyLocation
MyLocation = CS.MyLocation
---@type Dist.SpringWebsocket.Client
SocketClient = CS.Dist.SpringWebsocket.Client
---@type Dist.SpringWebsocket.Client4Stomp
Client4Stomp = CS.Client4Stomp
---@type Dist.SpringWebsocket.StompFrame
StompFrame = CS.Dist.SpringWebsocket.StompFrame
---@type Dist.SpringWebsocket.StatusCodeEnum

View File

@@ -140,7 +140,7 @@ bio2Long = BioUtl.bio2long
long2Bio = BioUtl.long2bio
bio2number = BioUtl.bio2number
number2bio = BioUtl.number2bio
net = Net.self
-- net = Net.self
NetSuccess = 1000 -- Net.SuccessCode
LGet = Localization.Get

View File

@@ -3,7 +3,7 @@
--
require("public.class")
---@class CLLQueue
---@class CLLQueue :ClassBase
CLLQueue = class("CLLQueue")
local insert = table.insert;

View File

@@ -440,7 +440,7 @@ function procOffLine()
return
end
-- CLAlert.add(LGet("MsgOffline"), Color.yellow, 1)
-- CLAlert.add(LGet("MsgOffline"), Color.white, 1)
printe(LGet("MsgOffline"))
InvokeEx.cancelInvoke() -- 放在前面后面马上就要用到invoke
local ok, result = pcall(doReleaseAllRes)
@@ -476,9 +476,9 @@ function doReleaseAllRes()
CLLNet.stop()
end
if Net.self.netGameDataQueue then
Net.self.netGameDataQueue:Clear()
end
-- if Net.self and Net.self.netGameDataQueue then
-- Net.self.netGameDataQueue:Clear()
-- end
-- 页面处理
CLPanelManager.hideAllPanel()
@@ -512,7 +512,7 @@ function doSomethingBeforeRestart()
if not ok then
printe(result)
end
Net.self:clean()
-- Net.self:clean()
---@type Coolape.CLBaseLua
local worldmap = getCC(MyMain.self.transform, "worldmap", "CLBaseLua")
worldmap:destoryLua()

View File

@@ -41,6 +41,7 @@ MyUtl.callCust = function(cust)
end
cust.jsonStr = cust.jsonStr or {}
local phones = ArrayList()
local phonesVal = ArrayList()
local taskId = tostring(cust.taskId)
local fields = DBCust.getFieldsByTask(taskId)
@@ -48,15 +49,17 @@ MyUtl.callCust = function(cust)
if attr.attrType == DBCust.FieldType.phone then
local phNo = cust.jsonStr[joinStr(attr.id, "_", attr.attrName)]
if not isNilOrEmpty(phNo) then
phones:Add(joinStr(attr.attrName,": ", phNo))
phones:Add(joinStr(attr.attrName, ": ", phNo))
phonesVal:Add(phNo)
end
end
end
if phones.Count > 0 then
phones:Insert(0, joinStr("默认: ",cust.phoneNo))
phones:Insert(0, joinStr("默认: ", cust.phoneNo))
phonesVal:Insert(0, cust.phoneNo)
CLUIPopListPanel.show(
phones,
phones,
phonesVal,
function(val, selectedItem)
if val then
MyUtl.doCall(cust.custId, val)
@@ -83,4 +86,18 @@ MyUtl.doCall = function(custId, phoneNo)
)
end
MyUtl.toast = function(msg, staySec)
CLToastRoot.toast(msg, CLToastRoot.Type.normal, staySec)
end
MyUtl.toastS = function(msg, staySec)
CLToastRoot.toast(msg, CLToastRoot.Type.success, staySec)
end
MyUtl.toastW = function(msg, staySec)
CLToastRoot.toast(msg, CLToastRoot.Type.warning, staySec)
end
MyUtl.toastE = function(msg, staySec)
CLToastRoot.toast(msg, CLToastRoot.Type.error, staySec)
end
return MyUtl

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -209,7 +209,7 @@ function CLLPStart.doEnterGame()
end
end
if useOldCurrGroup then
getPanelAsy("PanelConnect", onLoadedPanel)
getPanelAsy("PanelConnect", onLoadedPanelTT)
else
---@type _ParamTRPSelectGroup
local d = {}

View File

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

View File

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

View File

@@ -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上的事件例如点击等

View File

@@ -113,7 +113,7 @@ function TRPLogin:setEventDelegate()
end
end,
function()
CLAlert.add("登录失败,请确保网络通畅!", Color.yellow, 1)
CLAlert.add("登录失败,请确保网络通畅!", Color.white, 1)
end
)
end,

View File

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

View File

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

View File

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

View File

@@ -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
-- 缓存一下,下次进来后就不用再先公司了