This commit is contained in:
2020-08-17 11:13:33 +08:00
parent 19e730574b
commit 21eb68aeab
93 changed files with 6713 additions and 143 deletions

View File

@@ -0,0 +1,103 @@
-- xx界面
local CLLPSendSms = {}
---@type Coolape.CLPanelLua
local csSelf = nil
---@type UnityEngine.Transform
local transform = nil
local uiobjs = {}
---@type _DBCust
local mdata
-- 初始化,只会调用一次
function CLLPSendSms.init(csObj)
csSelf = csObj
transform = csObj.transform
---@type CLUIFormRoot
uiobjs.offset = getCC(transform, "Bottom/offset", "CLUIFormRoot")
uiobjs.InputContentCell = getCC(uiobjs.offset.transform, "InputContent", "CLCellLua")
local attr = {}
attr.attrName = "短信内容"
attr.id = "body"
attr.attrType = DBCust.FieldType.multext
attr.ifMust = 1
attr.donotJoinKey = true
---@type _ParamCellExtendFiled
local param = {}
param.attr = attr
uiobjs.InputContentCell:init(param, nil)
end
-- 设置数据
function CLLPSendSms.setData(paras)
mdata = paras
end
--当有通用背板显示时的回调
function CLLPSendSms.onShowFrame()
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function CLLPSendSms.show()
uiobjs.offset:setValue({})
end
-- 刷新
function CLLPSendSms.refresh()
end
-- 关闭页面
function CLLPSendSms.hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function CLLPSendSms.procNetwork(cmd, succ, msg, paras)
--[[
if(succ == NetSuccess) then
if(cmd == "xxx") then
-- TODO:
end
end
--]]
end
-- 处理ui上的事件例如点击等
function CLLPSendSms.uiEventDelegate(go)
local goName = go.name
if goName == "ButtonClose" then
hideTopPanel(csSelf)
elseif goName == "ButtonYunSend" then
local err = uiobjs.offset:checkValid()
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
local data = uiobjs.offset:getValue(true)
MyUtl.toastW("//TODO:云发短信的接口")
elseif goName == "ButtonNativeSend" then
local err = uiobjs.offset:checkValid()
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
local data = uiobjs.offset:getValue(true)
Application.OpenURL(joinStr("sms:", mdata.phoneNo, "?body=", data.body))
end
end
-- 当顶层页面发生变化时回调
function CLLPSendSms.onTopPanelChange(topPanel)
end
-- 当按了返回键时关闭自己返值为true时关闭
function CLLPSendSms.hideSelfOnKeyBack()
if NetProto and csSelf then
NetProto.removePanelListener(csSelf)
end
return true
end
--------------------------------------------
return CLLPSendSms

View File

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

View File

@@ -168,8 +168,8 @@ end
-- 更新安装游戏
function CLLPSplash.upgradeGame(url)
if not isNilOrEmpty(url) then
-- Application.OpenURL(url)
MyUtl.installNewApk(url)
Application.OpenURL(url)
-- MyUtl.installNewApk(url)
end
end

View File

@@ -48,6 +48,9 @@ function TRPConnect.procNetwork(cmd, succ, msg, paras)
if (cmd == "connect") then
-- socket正常
require "db.DBRoot"
if DBRoot then
DBRoot.clean()
end
DBRoot.init()
TRPConnect.getDataFromServer()
end
@@ -66,9 +69,6 @@ end
---public 从服务器取得数据
function TRPConnect.getDataFromServer()
if DBRoot then
DBRoot.clean()
end
NetProto.send.filter_customers(
function(content)
if content.success then

View File

@@ -536,7 +536,7 @@ function TRPCustDetail:procNetwork(cmd, succ, msg, paras)
uiobjs.OrderRoot:appendList(result.data)
end
end
elseif cmd == NetProto.cmds.update_customer then
elseif cmd == NetProto.cmds.update_customer or cmd == NetProto.cmds.create_followUp_record then
if self.currToggle == 1 then
self:showDetail()
uiobjs.Head:setValue(self.mdata)
@@ -548,6 +548,14 @@ function TRPCustDetail:procNetwork(cmd, succ, msg, paras)
if self.currToggle == 3 then
self:showOrders()
end
elseif cmd == NetProto.cmds.get_customerById then
if self.mdata.custId == paras.result.custId then
self.mdata = paras.result
if self.currToggle == 1 then
self:showDetail()
uiobjs.Head:setValue(self.mdata)
end
end
end
end
end

View File

@@ -221,7 +221,7 @@ function TRPCustList:procNetwork(cmd, succ, msg, paras)
hideHotWheel()
elseif cmd == NetProto.cmds.update_customer then
uiobjs.Grid:refreshContentOnly()
elseif cmd == NetProto.cmds.save_customer then
elseif cmd == NetProto.cmds.save_customer or cmd == NetProto.cmds.create_followUp_record then
self:refreshList()
elseif cmd == NetProto.cmds.delCustomerInfo or cmd == NetProto.cmds.backToGH then
self:refreshList()

View File

@@ -49,6 +49,7 @@ function TRPMoreProc4Cust:setEventDelegate()
hideTopPanel(self.csSelf)
end,
ButtonSendSM = function()
getPanelAsy("PanelSendSms", onLoadedPanelTT, self.mdata)
end,
ButtonMovetoOcean = function()
MyUtl.confirm(

View File

@@ -265,6 +265,7 @@ function TRPNewFollow:setEventDelegate()
-- 刷新预约的状态
self.bookingData.bookingDone = "1"
end
NetProto.send.get_customerById(self.cust.custId)
MyUtl.toastS("保存成功")
hideTopPanel(self.csSelf)
end

View File

@@ -294,7 +294,7 @@ function TRPOrderDetail:initAttachmentCell(cell, data)
end
function TRPOrderDetail:onClickAttachment(cell, data)
local had, path = DBTextures.hadDownloaded(data.name)
local had, path = DBAttachment.hadDownloaded(data.name)
if had then
CLUIUtl.showConfirm(
joinStr("附件已保存本地:", path),

View File

@@ -26,6 +26,8 @@ end
---@param paras _ParamTRPPlaySoundRecord
function TRPPlaySoundRecord:setData(paras)
self.mdata = paras
self.mdata._callerno = MyUtl.hidePhone(self.mdata.callerno)
self.mdata._destno = MyUtl.hidePhone(self.mdata.destno)
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh

View File

@@ -114,5 +114,10 @@ end
function TRPSelectCompany:onTopPanelChange(topPanel)
end
-- 当按了返回键时关闭自己返值为true时关闭
function TRPSelectCompany:hideSelfOnKeyBack()
return false
end
--------------------------------------------
return TRPSelectCompany

View File

@@ -0,0 +1,201 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPUserList:TRBasePanel 邮件列表
local TRPUserList = class("TRPUserList", TRBasePanel)
local _charList = {
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"#"
}
local uiobjs = {}
-- 初始化,只会调用一次
function TRPUserList:init(csObj)
TRPUserList.super.init(self, csObj)
self:setEventDelegate()
self:initFilters()
MyUtl.setContentView(
getChild(self.transform, "PanelContent"),
MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 160 + 40,
0
)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
---@type CLUIScrollViewWithEvent
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
---@type Coolape.CLUILoopTable
uiobjs.Grid = getCC(uiobjs.scrollView.transform, "Grid", "CLUILoopTable")
uiobjs.indexGrid = getChild(self.transform, "AnchorTopRight/PanelScrollBar/Grid"):GetComponent("UIGrid")
uiobjs.indexPrefab = getChild(uiobjs.indexGrid.transform, "00000").gameObject
end
-- 设置数据
---@param paras _ParamTRPUserList
function TRPUserList:setData(paras)
self.mdata = paras or {}
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPUserList:show()
uiobjs.InputSeachKey.value = ""
local bottomHeight = 0
if self.mdata.isSelectMode then
bottomHeight = 180
end
local v4 =
MyUtl.setContentView(
getChild(self.transform, "PanelContent"),
MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 160 + 40,
bottomHeight
)
uiobjs.indexGrid.cellHeight = NumEx.getIntPart(v4.w / 27)
self:showList({})
end
function TRPUserList:showList(list)
list = list or {}
SetActive(uiobjs.ButtonHeadList.gameObject, false)
if #list > 0 then
SetActive(uiobjs.ButtonEndList.gameObject, false)
else
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
uiobjs.Grid:setList(
list or {},
self:wrapFunc(self.initCell),
self:wrapFunc(self.onHeadList),
self:wrapFunc(self.onEndList)
)
self:reposition()
self.csSelf:invoke4Lua(self.reposition, 0.1)
end
function TRPUserList:reposition()
uiobjs.scrollView:ResetPosition()
end
function TRPUserList:appList(list)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:appendList(list)
end
function TRPUserList:initCell(cell, data)
cell:init(data, self:wrapFunc(self.onClickCell))
end
function TRPUserList:onClickCell(cell, data)
-- getPanelAsy("PanelOrderDetail", onLoadedPanelTT, data)
end
function TRPUserList:setIndexs()
local onClickCell = function(cell)
local d = cell.luaTable.getData()
local index = d.index
if (index >= 0) then
local userList = GLData.userList
local listPart1 = {}
for i = index, #userList do
table.insert(listPart1, userList[i])
end
CLLPUserList.setList(listPart1)
local listPart2 = {}
for i = 1, index - 1 do
table.insert(listPart2, userList[i])
end
uiobjs.Grid:insertList(listPart2, false, true)
end
end
local initCell = function(cell, data)
local label = getChild(cell.transform, "Label"):GetComponent("UILabel")
local boxCollider = cell:GetComponent("BoxCollider")
boxCollider.center = Vector3(0, -uiobjs.indexGrid.cellHeight / 2, 0)
boxCollider.size = Vector3(uiobjs.indexGrid.cellWidth, uiobjs.indexGrid.cellHeight, 0)
local d = GLData.userCharMap[data]
cell:init(d, onClickCell)
label.text = data
end
CLUIUtl.resetList4Lua(uiobjs.indexGrid, uiobjs.indexPrefab, _charList, initCell)
end
-- 刷新
function TRPUserList:refresh()
end
-- 关闭页面
function TRPUserList:hide()
self.filterValue = nil
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPUserList:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.workFlowQuery 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()
elseif cmd == NetProto.cmds.save_customer then
self:refreshList()
end
end
end
function TRPUserList:setEventDelegate()
self.EventDelegate = {
InputSeachKey = function()
local queryKey = uiobjs.InputSeachKey.value
NetProto.send.workFlowQuery(self.filterValue, queryKey, 1)
end
}
end
-- 处理ui上的事件例如点击等
function TRPUserList:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPUserList:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPUserList

View File

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