This commit is contained in:
2020-07-10 13:22:24 +08:00
parent 8c154e38ba
commit 9549990b66
108 changed files with 5668 additions and 888 deletions

View File

@@ -220,7 +220,8 @@ function PanelCalender.onClickBtn(btnName)
oldSelectedCell = nil
curYear = DateTime.Now.Year
curMonth = DateTime.Now.Month
csSelf:show()
PanelCalender.show()
PanelCalender.refresh()
elseif btnName == "ButtonOkay" then
CLPanelManager.hidePanel(csSelf)
local dataStr = ""

View File

@@ -124,6 +124,7 @@ function CLLPStart.onLoadPanelAfter(p)
local count = #(lateLoadPanels)
if (panelIndex >= count) then
--已经加载完
isLogined = true
CLLPStart.connectServer()
end
end
@@ -144,10 +145,11 @@ function CLLPStart.connectServer()
-- showHotWheel()
-- Net.self:connect(selectedServer.host, bio2number(selectedServer.port))
isLogined = true
NetProto.init(
function(success)
if success then
CLLPStart.doEnterGame()
CLLPStart.showGuid()
else
CLUIUtl.showConfirm(
"与服务器失去联系",
@@ -232,6 +234,14 @@ function CLLPStart.doEnterGame()
end
end
CLLPStart.showGuid = function()
if Prefs.getShowGuid() then
getPanelAsy("PanelGuid", onLoadedPanelTT, CLLPStart.doEnterGame)
else
CLLPStart.doEnterGame()
end
end
CLLPStart.hideSplash = function()
local p2 = CLPanelManager.getPanel("PanelSplash")
if (p2 ~= nil) then

View File

@@ -35,6 +35,7 @@ function TRPCustDetail:init(csObj)
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
@@ -80,6 +81,8 @@ function TRPCustDetail:show()
uiobjs.InputFrom:refreshItems(optionInfor.options, optionInfor.values)
optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.taskList)
uiobjs.InputTask:refreshItems(optionInfor.options, optionInfor.values)
local poplist = DBUser.getPopList()
uiobjs.InputLogin:refreshItems(poplist.options, poplist.values)
-- 设置星级
local stars = {}
for i = 1, 5 do
@@ -109,7 +112,9 @@ function TRPCustDetail:showDetail()
SetActive(uiobjs.ExtendRoot.gameObject, true)
SetActive(uiobjs.Records.gameObject, false)
uiobjs.DetailRoot:setValue(self.mdata)
uiobjs.ExtendRoot:init({data = self.mdata, isEditMode = false}, nil)
-- uiobjs.ExtendRoot:init({data = self.mdata, isEditMode = false}, nil)
self:showExtentFiles(self.mdata.taskId)
-- 设置星级
local stars = {}
@@ -123,6 +128,25 @@ function TRPCustDetail:showDetail()
uiobjs.scrollView:ResetPosition()
end
---public 显示扩展字段
function TRPCustDetail:showExtentFiles(taskId)
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata and self.mdata.jsonStr or {}
-- param.onFinish = self:wrapFunc(self.setExtendFieldsMode)
param.fields = {}
local fields = DBCust.getFieldsByTask(taskId) or {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = false
table.insert(param.fields, filedInfor)
end
uiobjs.ExtendRoot:init(param, nil)
end
function TRPCustDetail:showRecords()
SetActive(uiobjs.DetailRoot.gameObject, false)
SetActive(uiobjs.ExtendRoot.gameObject, false)
@@ -224,6 +248,9 @@ function TRPCustDetail:setEventDelegate()
ButtonCall = function()
MyUtl.callCust(self.mdata)
end,
ButtonNewOrder = function()
getPanelAsy("PanelNewOrder", onLoadedPanelTT, self.mdata)
end,
ButtonMore = function()
getPanelAsy("PanelMoreProc4Cust", onLoadedPanelTT, self.mdata)
end

View File

@@ -102,9 +102,11 @@ function TRPCustFilter:refreshFilterBtnStatus()
if self:hadFilterVal() then
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff2990dc)
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff2990dc)
uiobjs.ButtonFilterSp.spriteName = "cust_funnel"
else
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff999999)
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff999999)
uiobjs.ButtonFilterSp.spriteName = "cust_screen"
end
end

View File

@@ -104,9 +104,11 @@ function TRPCustList:refreshFilterBtnStatus()
if self:hadFilterVal() then
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff2990dc)
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff2990dc)
uiobjs.ButtonFilterSp.spriteName = "cust_funnel"
else
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff999999)
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff999999)
uiobjs.ButtonFilterSp.spriteName = "cust_screen"
end
end

View File

@@ -0,0 +1,111 @@
-- xx界面
local TRPGuid = {}
---@type Coolape.CLPanelLua
local csSelf = nil
---@type UnityEngine.Transform
local transform = nil
local uiobjs = {}
local callback
-- 初始化,只会调用一次
function TRPGuid.init(csObj)
csSelf = csObj
transform = csObj.transform
--[[
上的组件getChild(transform, "offset", "Progress BarHong"):GetComponent("UISlider");
--]]
---@type UIGridPage
uiobjs.GridPage = getCC(transform, "PanelContent/Grid", "UIGridPage")
---@type UIGrid
uiobjs.GridIndex = getCC(transform, "GridIndex", "UIGrid")
uiobjs.GridIndexPrefab = getChild(uiobjs.GridIndex.transform, "00000").gameObject
uiobjs.ButtonEnter = getChild(transform, "ButtonEnter").gameObject
end
-- 设置数据
function TRPGuid.setData(paras)
callback = paras
end
--当有通用背板显示时的回调
function TRPGuid.onShowFrame()
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPGuid.show()
SetActive(uiobjs.ButtonEnter, false)
uiobjs.GridPage.cellWidth = NumEx.getIntPart(MyUtl.getSizeAdjust() * Screen.width)
local pages = ArrayList()
pages:Add({index = 1, label = "业务轻松查看", label2 = "随时查看实时业绩情况"})
pages:Add({index = 2, label = "客户随时跟进", label2 = "第一时间跟进客户记录消息内容"})
pages:Add({index = 3, label = "订单高效处理", label2 = "随时随地及时处理各类客户订单"})
uiobjs.GridPage:init(pages, TRPGuid.onShowPage, 0)
end
function TRPGuid.onShowPage(index, data)
SetActive(uiobjs.ButtonEnter, index == 2)
local list = {}
for i = 0, 2 do
if i == index then
table.insert(list, true)
else
table.insert(list, false)
end
end
CLUIUtl.resetList4Lua(
uiobjs.GridIndex,
uiobjs.GridIndexPrefab,
list,
function(cell, data)
local sp = cell:GetComponent("UISprite")
if data then
sp.color = ColorEx.getColor(0xff363636)
else
sp.color = ColorEx.getColor(0xff999999)
end
end
)
end
-- 刷新
function TRPGuid.refresh()
end
-- 关闭页面
function TRPGuid.hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPGuid.procNetwork(cmd, succ, msg, paras)
--[[
if(succ == NetSuccess) then
if(cmd == "xxx") then
-- TODO:
end
end
--]]
end
-- 处理ui上的事件例如点击等
function TRPGuid.uiEventDelegate(go)
local goName = go.name
if(goName == "ButtonEnter") then
Prefs.setShowGuid(false)
hideTopPanel(csSelf)
Utl.doCallback(callback)
end
end
-- 当顶层页面发生变化时回调
function TRPGuid.onTopPanelChange(topPanel)
end
-- 当按了返回键时关闭自己返值为true时关闭
function TRPGuid.hideSelfOnKeyBack()
return true
end
--------------------------------------------
return TRPGuid

View File

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

View File

@@ -82,8 +82,10 @@ function TRPNewCust:show()
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)
-- optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.loginNoList)
local poplist = DBUser.getPopList()
uiobjs.InputLogin:refreshItems(poplist.options, poplist.values)
self:refreshContent()
@@ -95,27 +97,31 @@ 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
-- 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
local taskId = self.mdata and self.mdata.taskId or nil
self:showExtentFiles(taskId)
-- 设置星级
stars = {}
@@ -126,6 +132,30 @@ function TRPNewCust:refreshContent()
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
end
---public 显示扩展字段
function TRPNewCust:showExtentFiles(taskId)
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata and self.mdata.jsonStr or {}
-- param.isEditMode = true
param.onFinish = self:wrapFunc(self.setExtendFieldsMode)
param.fields = {}
local fields = DBCust.getFieldsByTask(taskId) or {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
if not self.isNewCust then
filedInfor.onClick = self:wrapFunc(self.onClickInputField4Extend)
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
end
table.insert(param.fields, filedInfor)
end
uiobjs.ExtendRoot:init(param, nil)
end
function TRPNewCust:reposition()
uiobjs.DetailRootTabel.repositionNow = true
uiobjs.Table.repositionNow = true
@@ -182,7 +212,7 @@ function TRPNewCust:setElementMode(el)
else
boxcollider.enabled = true
end
if ButtonReset then
ButtonReset.disabled = (not self.isNewCust)
end
@@ -372,27 +402,7 @@ function TRPNewCust:setEventDelegate()
)
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
self:showExtentFiles(uiobjs.InputTask.value)
end
}
end

View File

@@ -0,0 +1,448 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPNewOrder:TRBasePanel 邮件列表
local TRPNewOrder = class("TRPNewOrder", TRBasePanel)
local uiobjs = {}
local stars = {}
-- 初始化,只会调用一次
function TRPNewOrder:init(csObj)
TRPNewOrder.super.init(self, csObj)
self:initFiledsAttr()
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.DetailFromRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLUIFormRoot")
uiobjs.DetailRoot = getCC(uiobjs.Table.transform, "DetailRoot", "CLCellLua")
---@type UITable
uiobjs.DetailRootTabel = uiobjs.DetailRoot:GetComponent("UITable")
uiobjs.ExtendRoot = getCC(uiobjs.Table.transform, "ExtendRoot", "CLCellLua")
---@type CLUIFormRoot
uiobjs.ExtendFormRoot = uiobjs.ExtendRoot:GetComponent("CLUIFormRoot")
-- uiobjs.elements = uiobjs.DetailRoot.gameObject:GetComponentsInChildren(typeof(CLUIElement), true)
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
end
function TRPNewOrder:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
attr = {}
attr.attrName = "工单模板"
attr.id = ""
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "工单名称"
attr.id = ""
attr.attrType = DBCust.FieldType.text
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "紧急程序"
attr.id = ""
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "客户号码"
attr.id = "phoneNo"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "所属任务"
attr.id = "taskId"
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 0
attr.donotJoinKey = true
local popInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.taskList)
attr.popOptions = popInfor.options
attr.popValues = popInfor.values
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "客户名称"
attr.id = "custName"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "公司名称"
attr.id = "companyName"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "联系地址"
attr.id = "address"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "订单内容"
attr.id = ""
attr.attrType = DBCust.FieldType.multext
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
end
-- 设置数据
---@param paras _ParamTRPNewOrder
function TRPNewOrder:setData(paras)
if paras and paras.orderId and paras.orderId > 0 then
self.isNewOrder = false
self.mdata = paras
else
--//TODO:初始值
self.isNewOrder = true
self.mdata = paras
end
if type(self.mdata.jsonStr) == "string" then
self.mdata.jsonStr = json.decode(self.mdata.jsonStr)
end
self.mdata.jsonStr = self.mdata.jsonStr or {}
end
---public 当有通用背板显示时的回调
---@param cs Coolape.CLPanelLua
function TRPNewOrder:onShowFrame(cs)
if cs.frameObj then
---@type _BGFrame1Param
local d = {}
if self.isNewOrder then
d.title = "新建订单"
else
d.title = "修改订单"
end
d.panel = cs
cs.frameObj:init(d)
end
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPNewOrder:show()
self:refreshContent()
SetActive(uiobjs.ButtonSave.gameObject, self.isNewOrder)
uiobjs.scrollView:ResetPosition()
end
function TRPNewOrder:refreshContent()
self:showBaseFields()
local taskId = self.mdata and self.mdata.taskId or nil
self:showExtentFiles(taskId)
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
end
function TRPNewOrder:showBaseFields()
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata or {}
param.onFinish = self:wrapFunc(self.setExtendFieldsMode)
param.fields = {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(self.baseFiledsAttr) do
-- 工单模板
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
if filedInfor.attr.attrType == DBCust.FieldType.multext then
filedInfor.onMultTextInputChg = self:wrapFunc(self.reposition)
end
if not self.isNewOrder then
filedInfor.onClick = self:wrapFunc(self.onClickInputField4Extend)
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
end
table.insert(param.fields, filedInfor)
end
uiobjs.DetailRoot:init(param, nil)
end
---public 显示扩展字段
function TRPNewOrder:showExtentFiles(taskId)
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata and self.mdata.jsonStr or {}
-- param.isEditMode = true
param.onFinish = self:wrapFunc(self.setExtendFieldsMode)
param.fields = {}
local fields = DBCust.getFieldsByTask(taskId) or {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
if filedInfor.attr.attrType == DBCust.FieldType.multext then
filedInfor.onMultTextInputChg = self:wrapFunc(self.reposition)
end
if not self.isNewOrder then
filedInfor.onClick = self:wrapFunc(self.onClickInputField4Extend)
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)
end
table.insert(param.fields, filedInfor)
end
uiobjs.ExtendRoot:init(param, nil)
end
function TRPNewOrder:reposition()
uiobjs.DetailRootTabel.repositionNow = true
uiobjs.Table.repositionNow = true
end
function TRPNewOrder: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 TRPNewOrder: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")
local ButtonReset = getCC(el.transform, "ButtonReset", "MyInputReset")
if (not self.isNewOrder) and (el.jsonKey == "taskId" or el.jsonKey == "phoneNo") then
boxcollider.enabled = false
else
boxcollider.enabled = true
end
if ButtonReset then
ButtonReset.disabled = (not self.isNewOrder)
end
if input then
if isPopList or isPopCheckbox then
input.enabled = false
if inputOnGUI then
inputOnGUI.enabled = false
end
else
if self.isNewOrder 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 TRPNewOrder:refresh()
end
-- 关闭页面
function TRPNewOrder:hide()
if uiobjs.ExtendRoot.luaTable then
uiobjs.ExtendRoot.luaTable.release()
end
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPNewOrder:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.update_customer then
self:refreshContent()
end
end
end
function TRPNewOrder:onPopupFieldValChg(go)
if self.isNewOrder 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
MyUtl.toastW(err)
end
end
end
end
function TRPNewOrder:onClickInputField(go)
if self.isNewOrder 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 TRPNewOrder:onFinishSetField(key, val)
if tostring(val) ~= tostring(self.mdata[key]) then
self:sendModifymsg(key, val, false)
end
end
function TRPNewOrder: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
MyUtl.toastS("修改成功")
end
end
)
end
function TRPNewOrder:onPopupFieldValChg4Extend(go)
if self.isNewOrder 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
MyUtl.toastW(err)
end
end
end
end
function TRPNewOrder:onClickInputField4Extend(go)
if self.isNewOrder 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 TRPNewOrder:onFinishSetField4Extend(key, val)
if tostring(val) ~= tostring(self.mdata.jsonStr[key]) then
self:sendModifymsg(key, val, true)
end
end
function TRPNewOrder:setEventDelegate()
self.EventDelegate = {
ButtonSave = function()
local err = uiobjs.DetailRoot:checkValid()
err = joinStr(err, uiobjs.ExtendFormRoot:checkValid())
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
local cust = uiobjs.DetailRoot:getValue(true)
cust.customerLabel = self.mdata.customerLabel
local jsonStr = uiobjs.ExtendFormRoot:getValue(true)
cust.jsonStr = jsonStr
showHotWheel()
NetProto.send.save_customer(
cust,
function(content)
if content.success then
getPanelAsy("PanelCustDetail", onLoadedPanel, cust)
end
hideHotWheel()
end
)
end,
InputTask = function()
self:showExtentFiles(uiobjs.InputTask.value)
end
}
end
-- 处理ui上的事件例如点击等
function TRPNewOrder:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPNewOrder:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPNewOrder

View File

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