Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPCustDetail.lua

608 lines
21 KiB
Lua
Raw Normal View History

2020-08-07 22:40:04 +08:00
---@class _ParamTRPCustDetail
---@field cust
---@field bookingData
---@field needShowMore
---@type IDBasePanel
2020-07-04 14:41:25 +08:00
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)
2020-07-20 22:20:21 +08:00
self:prepareMoreData()
2020-07-04 14:41:25 +08:00
self:setEventDelegate()
2020-08-04 21:58:27 +08:00
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + 400 + 160 + 60, 200)
2020-07-04 14:41:25 +08:00
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")
2020-08-01 17:55:18 +08:00
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
2020-07-04 14:41:25 +08:00
---@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")
2020-07-21 22:50:03 +08:00
uiobjs.LabelLoginNo = getCC(uiobjs.Head.transform, "LabelLoginNo", "UIPopupList")
2020-07-04 14:41:25 +08:00
uiobjs.starGrid = getCC(uiobjs.Head.transform, "LabelStars/Grid", "UIGrid")
uiobjs.starGridPrefab = getChild(uiobjs.starGrid.transform, "00000").gameObject
2020-07-20 22:20:21 +08:00
---@type UIGrid
uiobjs.SpriteToggle = getCC(self.transform, "Top/SpriteToggle", "UIGrid")
local width = NumEx.getIntPart(CSPMain.contentRect.z / 4)
uiobjs.SpriteToggle.cellWidth = width
2020-07-04 14:41:25 +08:00
---@type UIToggle
2020-07-20 22:20:21 +08:00
uiobjs.ToggleDetail = getCC(uiobjs.SpriteToggle.transform, "ToggleDetail", "UIToggle")
2020-08-07 22:40:04 +08:00
---@type UIToggle
uiobjs.ToggleMore = getCC(uiobjs.SpriteToggle.transform, "ToggleMore", "UIToggle")
2020-07-04 14:41:25 +08:00
---@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")
2020-07-10 13:22:24 +08:00
uiobjs.InputLogin = getCC(uiobjs.DetailRoot.transform, "InputLogin", "UIPopupList")
2020-07-04 14:41:25 +08:00
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")
2020-07-20 22:20:21 +08:00
---@type Coolape.CLUILoopGrid
uiobjs.OrderRoot = getCC(uiobjs.Table.transform, "OrderRoot", "CLUILoopGrid")
uiobjs.ButtonEndListOrder = getChild(uiobjs.OrderRoot.transform, "ButtonEndList")
uiobjs.MoreRoot = getCC(uiobjs.Table.transform, "MoreRoot", "CLCellLua")
2020-07-24 22:12:55 +08:00
uiobjs.SysRoot = getCC(uiobjs.Table.transform, "SysRoot", "CLCellLua")
2020-07-20 22:20:21 +08:00
end
function TRPCustDetail:prepareMoreData()
self.moreProcList = {}
---@type _ParamFieldAttr
local attr = {}
attr.id = "follows"
attr.attrName = "跟进记录"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.moreProcList, attr)
attr = {}
attr.id = "followTasks"
attr.attrName = "预约记录"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.moreProcList, attr)
2020-08-01 17:55:18 +08:00
--[[
2020-07-20 22:20:21 +08:00
attr = {}
attr.id = "smsList"
attr.attrName = "短信记录"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.moreProcList, attr)
attr = {}
attr.id = "opList"
attr.attrName = "操作记录"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.moreProcList, attr)
2020-08-01 17:55:18 +08:00
]]
2020-07-24 22:12:55 +08:00
--------------------------------------------
2020-07-28 21:02:59 +08:00
2020-07-24 22:12:55 +08:00
self.sysFields = {}
---@type _ParamFieldAttr
local attr = {}
attr.id = "loginNo"
attr.attrName = "创建人员"
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
local popInfor = DBUser.getPopList(DBUser.FilterGroup.user)
attr.popOptions = popInfor.options
attr.popValues = popInfor.values
table.insert(self.sysFields, attr)
---@type _ParamFieldAttr
attr = {}
attr.id = "groupId"
attr.attrName = "所属部门"
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
local popInfor = DBUser.getPopList(DBUser.FilterGroup.group)
attr.popOptions = popInfor.options
attr.popValues = popInfor.values
table.insert(self.sysFields, attr)
---@type _ParamFieldAttr
attr = {}
attr.id = "createTime"
attr.attrName = "创建时间"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.sysFields, attr)
---@type _ParamFieldAttr
attr = {}
attr.id = "updateTime"
attr.attrName = "更新时间"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.sysFields, attr)
---@type _ParamFieldAttr
attr = {}
attr.id = "lastFollowUpTime"
attr.attrName = "最后跟进"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.height = 180
attr.donotJoinKey = true
table.insert(self.sysFields, attr)
---@type _ParamFieldAttr
2020-08-07 22:40:04 +08:00
-- attr = {}
-- attr.id = "followupTime"
-- attr.attrName = "下次跟进"
-- attr.attrType = DBCust.FieldType.text
-- attr.ifMust = 0
-- attr.height = 180
-- attr.donotJoinKey = true
-- table.insert(self.sysFields, attr)
2020-07-04 14:41:25 +08:00
end
-- 设置数据
---@param paras _ParamTRPCustDetail
function TRPCustDetail:setData(paras)
2020-08-01 17:55:18 +08:00
---@type _DBCust
2020-08-07 22:40:04 +08:00
self.mdata = paras.cust
2020-07-15 20:53:37 +08:00
self.mdata._phoneNo = MyUtl.hidePhone(self.mdata.phoneNo)
2020-07-08 08:01:34 +08:00
if type(self.mdata.jsonStr) == "string" then
self.mdata.jsonStr = json.decode(self.mdata.jsonStr)
2020-07-04 14:41:25 +08:00
end
2020-08-07 22:40:04 +08:00
self.bookingData = paras.bookingData
self.needShowMore = paras.needShowMore
2020-07-04 14:41:25 +08:00
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为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPCustDetail:show()
2020-08-07 22:40:04 +08:00
-- SetActive(uiobjs.ToggleMore.gameObject, self.needShowMore)
2020-07-04 14:41:25 +08:00
self.records = nil
2020-07-20 22:20:21 +08:00
self.orders = nil
2020-07-04 14:41:25 +08:00
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)
2020-07-24 22:12:55 +08:00
local poplist = DBUser.getPopList(DBUser.FilterGroup.user)
2020-07-10 13:22:24 +08:00
uiobjs.InputLogin:refreshItems(poplist.options, poplist.values)
2020-07-21 22:50:03 +08:00
uiobjs.LabelLoginNo:refreshItems(poplist.options, poplist.values)
2020-07-04 14:41:25 +08:00
-- 设置星级
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()
2020-07-20 22:20:21 +08:00
self:release()
2020-07-04 14:41:25 +08:00
SetActive(uiobjs.DetailRoot.gameObject, true)
SetActive(uiobjs.ExtendRoot.gameObject, true)
2020-07-24 22:12:55 +08:00
SetActive(uiobjs.SysRoot.gameObject, true)
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.OrderRoot.gameObject, false)
2020-07-04 14:41:25 +08:00
SetActive(uiobjs.Records.gameObject, false)
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.MoreRoot.gameObject, false)
2020-07-04 14:41:25 +08:00
uiobjs.DetailRoot:setValue(self.mdata)
2020-07-10 13:22:24 +08:00
-- uiobjs.ExtendRoot:init({data = self.mdata, isEditMode = false}, nil)
self:showExtentFiles(self.mdata.taskId)
2020-07-24 22:12:55 +08:00
self:showSysFiles()
2020-07-04 14:41:25 +08:00
-- 设置星级
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()
2020-08-01 17:55:18 +08:00
uiobjs.scrollView.restrictWithinPanel = true
2020-07-20 22:20:21 +08:00
uiobjs.scrollView.disableDragIfFits = true
2020-07-04 14:41:25 +08:00
uiobjs.scrollView:ResetPosition()
end
2020-07-24 22:12:55 +08:00
function TRPCustDetail:reposition()
uiobjs.Table:Reposition()
uiobjs.scrollView.disableDragIfFits = true
uiobjs.scrollView:ResetPosition()
2020-08-04 21:58:27 +08:00
self.csSelf:invoke4Lua(
function()
uiobjs.scrollView:ResetPosition()
end,
0.1
)
2020-07-24 22:12:55 +08:00
end
2020-07-10 13:22:24 +08:00
---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
2020-07-24 22:12:55 +08:00
filedInfor.showMode = _FieldMode.showOnly
2020-07-10 13:22:24 +08:00
table.insert(param.fields, filedInfor)
end
uiobjs.ExtendRoot:init(param, nil)
end
2020-07-24 22:12:55 +08:00
---public 显示扩展字段
function TRPCustDetail:showSysFiles()
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata
param.onFinish = self:wrapFunc(self.reposition)
param.fields = {}
local fields = self.sysFields
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.showMode = _FieldMode.showOnly
table.insert(param.fields, filedInfor)
end
uiobjs.SysRoot:init(param, nil)
end
2020-07-04 14:41:25 +08:00
function TRPCustDetail:showRecords()
2020-07-20 22:20:21 +08:00
self:release()
2020-07-04 14:41:25 +08:00
SetActive(uiobjs.DetailRoot.gameObject, false)
SetActive(uiobjs.ExtendRoot.gameObject, false)
2020-07-24 22:12:55 +08:00
SetActive(uiobjs.SysRoot.gameObject, false)
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.OrderRoot.gameObject, false)
2020-07-04 14:41:25 +08:00
SetActive(uiobjs.Records.gameObject, true)
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.MoreRoot.gameObject, false)
2020-08-01 17:55:18 +08:00
if self.records == nil or #(self.records.data) then
SetActive(uiobjs.ButtonEndList.gameObject, true)
else
SetActive(uiobjs.ButtonEndList.gameObject, false)
end
2020-07-04 14:41:25 +08:00
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
2020-08-01 17:55:18 +08:00
self:reposition()
2020-07-04 14:41:25 +08:00
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
2020-07-20 22:20:21 +08:00
function TRPCustDetail:showOrders()
self:release()
SetActive(uiobjs.DetailRoot.gameObject, false)
SetActive(uiobjs.ExtendRoot.gameObject, false)
2020-07-24 22:12:55 +08:00
SetActive(uiobjs.SysRoot.gameObject, false)
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.Records.gameObject, false)
SetActive(uiobjs.OrderRoot.gameObject, true)
SetActive(uiobjs.MoreRoot.gameObject, false)
2020-08-04 21:58:27 +08:00
2020-08-01 17:55:18 +08:00
if self.orders == nil or #(self.orders.data) then
SetActive(uiobjs.ButtonEndListOrder.gameObject, true)
else
SetActive(uiobjs.ButtonEndListOrder.gameObject, false)
end
2020-07-20 22:20:21 +08:00
if self.orders then
uiobjs.OrderRoot:setList(
self.orders.data or {},
self:wrapFunc(self.initOrderCell),
self:wrapFunc(self.onOrderHeadList),
self:wrapFunc(self.onOrderEndList)
)
else
showHotWheel()
2020-07-28 21:02:59 +08:00
NetProto.send.workFlowQuery({custId = self.mdata.custId}, "", 1)
2020-07-20 22:20:21 +08:00
uiobjs.OrderRoot:setList({}, self:wrapFunc(self.initOrderCell))
end
2020-07-28 21:02:59 +08:00
self:reposition()
2020-07-20 22:20:21 +08:00
end
function TRPCustDetail:initOrderCell(cell, data)
2020-07-28 21:02:59 +08:00
cell:init(data, self:wrapFunc(self.onClickOrderCell))
2020-07-20 22:20:21 +08:00
end
2020-07-28 21:02:59 +08:00
function TRPCustDetail:onClickOrderCell(cell, data)
getPanelAsy("PanelOrderDetail", onLoadedPanelTT, data)
end
2020-07-20 22:20:21 +08:00
function TRPCustDetail:onOrderHeadList(head)
printw("到最顶端了")
end
function TRPCustDetail:onOrderEndList(tail)
printw("到最后了==" .. tail.name)
if self.orders and self.orders.meta.current_page < self.orders.meta.total_pages then
showHotWheel()
2020-08-04 21:58:27 +08:00
-- 取得下一页
2020-07-28 21:02:59 +08:00
NetProto.send.workFlowQuery({custId = self.mdata.custId}, "", self.orders.meta.current_page + 1)
2020-07-20 22:20:21 +08:00
else
2020-08-04 21:58:27 +08:00
uiobjs.ButtonEndListOrder.localPosition = tail.transform.localPosition + Vector3.up * -240
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.ButtonEndListOrder.gameObject, true)
end
end
function TRPCustDetail:showMore()
self:release()
SetActive(uiobjs.DetailRoot.gameObject, false)
SetActive(uiobjs.ExtendRoot.gameObject, false)
2020-07-24 22:12:55 +08:00
SetActive(uiobjs.SysRoot.gameObject, false)
2020-07-20 22:20:21 +08:00
SetActive(uiobjs.Records.gameObject, false)
SetActive(uiobjs.OrderRoot.gameObject, false)
SetActive(uiobjs.MoreRoot.gameObject, true)
if not self.hasSetMoreProc then
self.hasSetMoreProc = true
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = nil
param.onFinish = function()
uiobjs.scrollView:ResetPosition()
end
param.fields = {}
---@type _ParamCellExtendFiled
local filedInfor
for i, v in ipairs(self.moreProcList) do
filedInfor = {}
filedInfor.attr = v
filedInfor.showMode = _FieldMode.button
filedInfor.onClick = self:wrapFunc(self.onClickMoreProc)
table.insert(param.fields, filedInfor)
end
uiobjs.MoreRoot:init(param, nil)
end
uiobjs.Table:Reposition()
2020-08-01 17:55:18 +08:00
uiobjs.scrollView.restrictWithinPanel = true
2020-07-20 22:20:21 +08:00
uiobjs.scrollView.disableDragIfFits = true
uiobjs.scrollView:ResetPosition()
end
---@param el CLUIElement
function TRPCustDetail:onClickMoreProc(el)
if el.jsonKey == "follows" then
-- 跟进记录
2020-08-07 22:40:04 +08:00
getPanelAsy("PanelFollowList4Cust", onLoadedPanelTT, {custId = self.mdata.custId})
2020-07-20 22:20:21 +08:00
elseif el.jsonKey == "followTasks" then
-- 预约记录
2020-08-07 22:40:04 +08:00
getPanelAsy("PanelTaskList4Cust", onLoadedPanelTT, {custId = self.mdata.custId})
2020-07-20 22:20:21 +08:00
elseif el.jsonKey == "smsList" then
-- 短信记录
elseif el.jsonKey == "opList" then
2020-07-28 21:02:59 +08:00
-- 操作记录
2020-07-20 22:20:21 +08:00
end
end
2020-07-04 14:41:25 +08:00
-- 刷新
function TRPCustDetail:refresh()
end
2020-07-20 22:20:21 +08:00
function TRPCustDetail:release()
2020-07-04 14:41:25 +08:00
if uiobjs.ExtendRoot.luaTable then
uiobjs.ExtendRoot.luaTable.release()
end
2020-07-20 22:20:21 +08:00
if uiobjs.MoreRoot.luaTable then
uiobjs.MoreRoot.luaTable.release()
end
2020-07-28 21:02:59 +08:00
if uiobjs.SysRoot.luaTable then
uiobjs.SysRoot.luaTable.release()
end
2020-07-20 22:20:21 +08:00
self.hasSetMoreProc = false
end
-- 关闭页面
function TRPCustDetail:hide()
self:release()
2020-07-04 14:41:25 +08:00
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
2020-07-28 21:02:59 +08:00
elseif cmd == NetProto.cmds.workFlowQuery then
local result = paras.result
if self.orders == nil then
self.orders = result
else
if self.orders.meta.current_page < result.meta.current_page then
self.orders.meta = result.meta
for i, v in ipairs(result.data) do
table.insert(self.orders.data, v)
end
end
end
hideHotWheel()
if self.orders and uiobjs.OrderRoot.gameObject.activeInHierarchy then
if self.orders.meta.current_page == 1 then
self:showOrders()
else
uiobjs.OrderRoot:appendList(result.data)
end
end
2020-07-04 14:41:25 +08:00
elseif cmd == NetProto.cmds.update_customer then
if self.currToggle == 1 then
self:showDetail()
2020-07-14 22:04:03 +08:00
uiobjs.Head:setValue(self.mdata)
2020-07-04 14:41:25 +08:00
end
2020-07-28 21:02:59 +08:00
elseif cmd == NetProto.cmds.delCustomerInfo or cmd == NetProto.cmds.backToGH then
hideTopPanel(self.csSelf)
elseif cmd == NetProto.cmds.createWfInfo then
self.orders = nil
if self.currToggle == 3 then
self:showOrders()
end
2020-07-04 14:41:25 +08:00
end
end
end
function TRPCustDetail:setEventDelegate()
self.EventDelegate = {
ToggleDetail = function()
self.currToggle = 1
self:showDetail()
end,
ToggleRecords = function()
self.currToggle = 2
self:showRecords()
end,
2020-07-20 22:20:21 +08:00
ToggleOrders = function()
self.currToggle = 3
self:showOrders()
end,
ToggleMore = function()
self.currToggle = 4
self:showMore()
end,
2020-07-04 14:41:25 +08:00
ButtonNewFollow = function()
2020-08-07 22:40:04 +08:00
---@type _ParamTRPNewFollow
local param = {}
param.cust = self.mdata
param.bookingData = self.bookingData
getPanelAsy("PanelNewFollow", onLoadedPanelTT, param)
2020-07-04 14:41:25 +08:00
end,
ButtonNewTask = function()
2020-07-18 21:12:14 +08:00
getPanelAsy("PanelNewFollowTask", onLoadedPanelTT, self.mdata)
2020-07-04 14:41:25 +08:00
end,
ButtonCall = function()
MyUtl.callCust(self.mdata)
end,
2020-07-10 13:22:24 +08:00
ButtonNewOrder = function()
getPanelAsy("PanelNewOrder", onLoadedPanelTT, self.mdata)
end,
2020-07-04 14:41:25 +08:00
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