This commit is contained in:
2020-07-18 21:12:14 +08:00
parent 1361db18a9
commit 33dc6cea60
214 changed files with 16596 additions and 3104 deletions

View File

@@ -43,7 +43,7 @@ function CLLPStart.setLuasAtBegainning()
-- 日志监听
if ReporterMessageReceiver.self and ReporterMessageReceiver.self.gameObject then
-- if KKWhiteList.isWhiteName() then
ReporterMessageReceiver.self.gameObject:SetActive(false)
ReporterMessageReceiver.self.gameObject:SetActive(true)
-- else
-- ReporterMessageReceiver.self.gameObject:SetActive(false)
-- end

View File

@@ -80,6 +80,10 @@ function CSPMine.uiEventDelegate(go)
MyLocation.self:getMyLocation(CSPMine.onGetLocation)
elseif goName == "ButtonSetting" or goName == "ButtonMySetting" then
getPanelAsy("PanelSetting", onLoadedPanelTT)
elseif goName == "SpriteTopBg" then
getPanelAsy("PanelMyInfor", onLoadedPanelTT)
elseif goName == "ButtonAbout" then
getPanelAsy("PanelAbout", onLoadedPanelTT)
end
end

View File

@@ -154,9 +154,14 @@ function CSPTasks.setEventDelegate()
getPanelAsy("PanelCustList", onLoadedPanelTT)
end,
ButtonRecord = function()
getPanelAsy("PanelFollowList", onLoadedPanelTT)
end,
ButtonCustOcean = function()
end
end,
ButtonOrder = function()
getPanelAsy("PanelOrderList", onLoadedPanelTT)
end,
}
end
-- 处理ui上的事件例如点击等

View File

@@ -0,0 +1,136 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPAbout:TRBasePanel 邮件列表
local TRPAbout = class("TRPAbout", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPAbout:init(csObj)
TRPAbout.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 500, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
---@type UITable
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
---@type CLUIFormRoot
uiobjs.TableForm = uiobjs.Table:GetComponent("CLUIFormRoot")
---@type Coolape.CLCellLua
uiobjs.TableLua = uiobjs.Table:GetComponent("CLCellLua")
end
function TRPAbout:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
attr = {}
attr.attrName = "更新动态"
attr.id = "upgrade"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "服务协议"
attr.id = "serviceAgreement"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "发布评价"
attr.id = "assess"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
end
-- 设置数据
---@param paras _ParamTRPAbout
function TRPAbout:setData(paras)
self.mdata = {}
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPAbout:show()
---@type _ParamCellExtendFiledRoot
local fieldRootInfor = {}
fieldRootInfor.fields = {}
fieldRootInfor.data = self.mdata
fieldRootInfor.onFinish = self:wrapFunc(self.reposition)
for i, v in ipairs(self.baseFiledsAttr) do
---@type _ParamCellExtendFiled
local d = {}
d.attr = v
d.showMode = _FieldMode.button
d.onClick = self:wrapFunc(self.onClickField)
d.onSelect = self:wrapFunc(self.onSelectField)
table.insert(fieldRootInfor.fields, d)
end
uiobjs.TableLua:init(fieldRootInfor, nil)
end
---@param el CLUIElement
function TRPAbout:onClickField(el)
if el.jsonKey == "upgrade" then
-- 更新
elseif el.jsonKey == "serviceAgreement" then
-- 显示协议
elseif el.jsonKey == "assess" then
-- 评价(这个做起来麻烦)
end
end
function TRPAbout:onSelectField(go)
end
function TRPAbout:reposition()
uiobjs.Table:Reposition()
uiobjs.Table.repositionNow = true
uiobjs.scrollView:ResetPosition()
end
-- 刷新
function TRPAbout:refresh()
uiobjs.TableLua.luaTable.release()
end
-- 关闭页面
function TRPAbout:hide()
uiobjs.TableLua.luaTable.release()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPAbout:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPAbout:setEventDelegate()
self.EventDelegate = {}
end
-- 处理ui上的事件例如点击等
function TRPAbout:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func(go)
end
end
-- 当顶层页面发生变化时回调
function TRPAbout:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPAbout

View File

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

View File

@@ -246,6 +246,7 @@ function TRPCustDetail:setEventDelegate()
ButtonNewFollow = function()
end,
ButtonNewTask = function()
getPanelAsy("PanelNewFollowTask", onLoadedPanelTT, self.mdata)
end,
ButtonCall = function()
MyUtl.callCust(self.mdata)

View File

@@ -75,7 +75,7 @@ function TRPCustFilter:setData(paras)
end
d = {}
d.title = "任务类型"
d.title = "客户类型"
d.key = DBCust.FilterGroup.custTypeList
d.key2 = "custType"
d.list = DBCust.getFilter(DBCust.FilterGroup.custTypeList)

View File

@@ -0,0 +1,223 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPFollowList:TRBasePanel 邮件列表
local TRPFollowList = class("TRPFollowList", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPFollowList:init(csObj)
TRPFollowList.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
---@type CLUIScrollViewWithEvent
uiobjs.scrollView = getCC(self.transform, "PanelContent", "CLUIScrollViewWithEvent")
uiobjs.scrollView:init(
self:wrapFunc(self.onShowRefreshFlg),
self:wrapFunc(self.onhideRefreshFlg),
self:wrapFunc(self.refreshList)
)
---@type Coolape.CLUILoopGrid
uiobjs.Grid = getCC(uiobjs.scrollView.transform, "Grid", "CLUILoopGrid")
uiobjs.ButtonEndList = getChild(uiobjs.Grid.transform, "ButtonEndList")
uiobjs.ButtonEndListLb = getCC(uiobjs.ButtonEndList, "Label", "UILabel")
uiobjs.ButtonHeadList = getChild(uiobjs.Grid.transform, "ButtonHeadList")
end
-- 设置数据
---@param paras _ParamTRPFollowList
function TRPFollowList:setData(paras)
self.mdata = paras
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPFollowList:show()
uiobjs.InputSeachKey.value = ""
self:refreshFilterBtnStatus()
self:showList({})
showHotWheel()
NetProto.send.list_customers(self.filterValue, "", 1)
end
function TRPFollowList:showList(list)
SetActive(uiobjs.ButtonHeadList.gameObject, false)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:setList(
list or {},
self:wrapFunc(self.initCell),
self:wrapFunc(self.onHeadList),
self:wrapFunc(self.onEndList)
)
uiobjs.scrollView:ResetPosition()
end
function TRPFollowList:appList(list)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:appendList(list)
end
function TRPFollowList:onShowRefreshFlg()
-- printe("TRPFollowList:onShowRefreshFlg")
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 395, 0)
SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPFollowList:onhideRefreshFlg()
-- printe("TRPFollowList:onhideRefreshFlg")
SetActive(uiobjs.ButtonHeadList.gameObject, false)
end
function TRPFollowList:refreshList()
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
NetProto.send.list_customers(self.filterValue, queryKey, 1)
end
function TRPFollowList:onHeadList(head)
printw("到最顶端了")
-- uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 250, 0)
-- SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPFollowList:onEndList(tail)
printw("到最后了==" .. tail.name)
if self.pageInfo and self.pageInfo.current_page < self.pageInfo.total_pages then
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
-- 取得下一页
NetProto.send.list_customers(self.filterValue, queryKey, self.pageInfo.current_page + 1)
else
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -335
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
end
function TRPFollowList:initCell(cell, data)
cell:init(data, self:wrapFunc(self.onClickCell))
end
function TRPFollowList:onClickCell(cell, data)
getPanelAsy("PanelCustDetail", onLoadedPanelTT, data)
end
function TRPFollowList: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
function TRPFollowList:hadFilterVal()
for i, v in ipairs(self.filters or {}) do
for j, f in ipairs(v.list) do
if f.selected then
return true
end
end
end
return false
end
-- 刷新
function TRPFollowList:refresh()
end
-- 关闭页面
function TRPFollowList:hide()
self.filterValue = nil
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPFollowList:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.list_customers 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 TRPFollowList:setEventDelegate()
self.EventDelegate = {
ButtonAddCust = function()
getPanelAsy("PanelNewCust", onLoadedPanelTT)
end,
ButtonFilter = function()
getPanelAsy(
"PanelCustFilter",
onLoadedPanelTT,
{
callback = self:wrapFunc(self.onSetFilter),
queryKey = uiobjs.InputSeachKey.value,
defautFilter = self.filters
}
)
end,
InputSeachKey = function()
local queryKey = uiobjs.InputSeachKey.value
NetProto.send.list_customers(self.filterValue, queryKey, 1)
end
}
end
function TRPFollowList:getFilterStr()
if not self.filters then
return ""
end
local ret = {}
for i, g in ipairs(self.filters) do
local list = {}
for j, f in ipairs(g.list) do
if f.selected and f.value ~= -1 then
table.insert(list, f.value)
end
end
ret[g.key2] = table.concat(list, ",")
end
return ret
end
function TRPFollowList:onSetFilter(filters, queryKey)
local oldqueryKey = uiobjs.InputSeachKey.value
uiobjs.InputSeachKey.value = queryKey
self.filters = filters
self:refreshFilterBtnStatus()
local queryKey = uiobjs.InputSeachKey.value
queryKey = trim(queryKey)
showHotWheel()
self.filterValue = self:getFilterStr()
if oldqueryKey == queryKey then
NetProto.send.list_customers(self.filterValue, queryKey, 1)
else
-- 会触发input的onChange事件
end
end
-- 处理ui上的事件例如点击等
function TRPFollowList:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPFollowList:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPFollowList

View File

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

View File

@@ -0,0 +1,264 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPMyInfor:TRBasePanel 邮件列表
local TRPMyInfor = class("TRPMyInfor", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPMyInfor:init(csObj)
TRPMyInfor.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 40 + 300, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
---@type UITable
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
---@type CLUIFormRoot
uiobjs.TableForm = uiobjs.Table:GetComponent("CLUIFormRoot")
---@type Coolape.CLCellLua
uiobjs.TableLua = uiobjs.Table:GetComponent("CLCellLua")
---@type CLUIFormRoot
uiobjs.Top = getCC(self.transform, "Top", "CLUIFormRoot")
---@type UITexture
uiobjs.HeadIcon = getCC(uiobjs.Top.transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
end
function TRPMyInfor:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
attr = {}
attr.attrName = "姓名"
attr.id = "loginName"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "工号"
attr.id = "loginNo"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.cannotEdit = true
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "部门"
attr.id = ""
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.cannotEdit = true
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "角色"
attr.id = ""
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.cannotEdit = true
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrType = DBCust.FieldType.empty
attr.height = 40
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "邮箱"
attr.id = ""
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.cannotEdit = true
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "手机"
attr.id = ""
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.cannotEdit = true
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "分机号"
attr.id = ""
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.cannotEdit = true
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
end
-- 设置数据
---@param paras _ParamTRPMyInfor
function TRPMyInfor:setData(paras)
self.mdata = {}
-- 初始化顶部数据
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
local companyInfro = json.decode(currGroup)
local user = DBUser.getUserById(companyInfro.login_no)
self.mdata.company_id = companyInfro.company_id
self.mdata.company_name = companyInfro.company_name
if user then
self.mdata.loginNo = user.loginNo
self.mdata.loginName = user.loginName
self.mdata.imageUrl = user.imageUrl
else
printe("账号信息未取得!")
end
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPMyInfor:show()
---@type _ParamCellExtendFiledRoot
local fieldRootInfor = {}
fieldRootInfor.fields = {}
fieldRootInfor.data = self.mdata
fieldRootInfor.onFinish = self:wrapFunc(self.reposition)
for i, v in ipairs(self.baseFiledsAttr) do
---@type _ParamCellExtendFiled
local d = {}
d.attr = v
if d.attr.id == "loginNo" then
d.showMode = _FieldMode.showOnly
else
d.showMode = _FieldMode.showAndModify
end
d.onClick = self:wrapFunc(self.onClickField)
d.onSelect = self:wrapFunc(self.onSelectField)
table.insert(fieldRootInfor.fields, d)
end
uiobjs.TableLua:init(fieldRootInfor, nil)
self:setHeadInfor()
end
function TRPMyInfor:setHeadInfor()
DBUser.getIcon(
self.mdata.loginNo,
function(content)
uiobjs.HeadIcon.mainTexture = content
end
)
end
function TRPMyInfor:onClickField(go)
---@type CLUIElement
local el = go:GetComponent("CLUIElement")
getPanelAsy(
"PanelModifyFiled",
onLoadedPanelTT,
{
label = el.labeName.text,
key = el.jsonKey,
value = el.value,
canNull = el.canNull,
callback = self:wrapFunc(self.onFinishSetField)
}
)
end
function TRPMyInfor:onFinishSetField(key, val)
if tostring(val) ~= tostring(self.mdata[key]) then
-- self:sendModifymsg(key, val, true)
--//TODO:
end
end
function TRPMyInfor:onSelectField(go)
end
function TRPMyInfor:reposition()
uiobjs.Table:Reposition()
uiobjs.Table.repositionNow = true
uiobjs.scrollView:ResetPosition()
end
-- 刷新
function TRPMyInfor:refresh()
end
-- 关闭页面
function TRPMyInfor:hide()
uiobjs.TableLua.luaTable.release()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPMyInfor:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPMyInfor:setEventDelegate()
self.EventDelegate = {
SpriteTopbg = function(go)
-- 修改头像
---@type UIPopupList
local popList = go:GetComponent("UIPopupList")
if popList.value == "1" then
-- 相机
local permission = MyCamera.getImage(self:wrapFunc(self.onGetImage))
if permission ~= NativeCamera.Permission.Granted then
CLUIUtl.showConfirm(
"没有使用相机的权限,打开设置允许使用相机",
function()
if not MyCamera.openSetting() then
MyUtl.toastW("打开权限设置失败")
end
end,
nil
)
end
elseif popList.value == "2" then
local permission = MyGallery.getImage(self:wrapFunc(self.onGetImage))
if permission ~= NativeGallery.Permission.Granted then
CLUIUtl.showConfirm(
"没有使用相册的权限,打开设置允许使用相册",
function()
if not MyGallery.openSetting() then
MyUtl.toastW("打开权限设置失败")
end
end,
nil
)
end
end
end
}
end
function TRPMyInfor:onGetImage(path)
if isNilOrEmpty(path) then
return
end
--//TODO:
end
-- 处理ui上的事件例如点击等
function TRPMyInfor:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func(go)
end
end
-- 当顶层页面发生变化时回调
function TRPMyInfor:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPMyInfor

View File

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

View File

@@ -137,7 +137,6 @@ 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 {}
@@ -146,7 +145,7 @@ function TRPNewCust:showExtentFiles(taskId)
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
filedInfor.showMode = self.isNewCust and _FieldMode.inputOnly or _FieldMode.modifyOnly
if not self.isNewCust then
filedInfor.onClick = self:wrapFunc(self.onClickInputField4Extend)
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg4Extend)

View File

@@ -1,14 +1,14 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPNewFollow:TRBasePanel 邮件列表
local TRPNewFollow = class("TRPNewFollow", TRBasePanel)
---@class TRPNewFollowSimple:TRBasePanel 邮件列表
local TRPNewFollowSimple = class("TRPNewFollowSimple", TRBasePanel)
local uiobjs = {}
local stars = {}
-- 初始化,只会调用一次
function TRPNewFollow:init(csObj)
TRPNewFollow.super.init(self, csObj)
function TRPNewFollowSimple:init(csObj)
TRPNewFollowSimple.super.init(self, csObj)
self:initFiledsAttr()
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132, 0)
@@ -25,7 +25,7 @@ function TRPNewFollow:init(csObj)
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
end
function TRPNewFollow:initFiledsAttr()
function TRPNewFollowSimple:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
@@ -35,6 +35,9 @@ function TRPNewFollow:initFiledsAttr()
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 0
attr.donotJoinKey = true
local popInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.followUpTypeList)
attr.popOptions = popInfor.options
attr.popValues = popInfor.values
table.insert(self.baseFiledsAttr, attr)
attr = {}
@@ -58,8 +61,8 @@ function TRPNewFollow:initFiledsAttr()
end
-- 设置数据
---@param paras _ParamTRPNewFollow
function TRPNewFollow:setData(paras)
---@param paras _ParamTRPNewFollowSimple
function TRPNewFollowSimple:setData(paras)
self.mdata = {}
self.mdata.custId = paras.custId
self.mdata.taskId = paras.taskId
@@ -68,19 +71,19 @@ function TRPNewFollow:setData(paras)
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPNewFollow:show()
function TRPNewFollowSimple:show()
self:refreshContent()
SetActive(uiobjs.ButtonSave.gameObject, self.isNewFollow)
uiobjs.scrollView:ResetPosition()
end
function TRPNewFollow:refreshContent()
function TRPNewFollowSimple:refreshContent()
self:showBaseFields()
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
end
function TRPNewFollow:showBaseFields()
function TRPNewFollowSimple:showBaseFields()
---@type _ParamCellExtendFiledRoot
local param = {}
param.data = self.mdata or {}
@@ -104,10 +107,9 @@ function TRPNewFollow:showBaseFields()
uiobjs.DetailRoot:init(param, nil)
end
function TRPNewFollow:onPopupFieldValChg(go)
function TRPNewFollowSimple:onPopupFieldValChg(go)
---@type CLUIElement
local el = go:GetComponent("CLUIElement")
printe(el.jsonKey)
if el.jsonKey == "dealFlag" then
if uiobjs.followUpContent and isNilOrEmpty(uiobjs.followUpContent.value) then
local popList = go:GetComponent("UIPopupList")
@@ -116,12 +118,12 @@ function TRPNewFollow:onPopupFieldValChg(go)
end
end
function TRPNewFollow:reposition()
function TRPNewFollowSimple:reposition()
uiobjs.DetailRootTabel.repositionNow = true
uiobjs.Table.repositionNow = true
end
function TRPNewFollow:setExtendFieldsMode(root)
function TRPNewFollowSimple:setExtendFieldsMode(root)
local elements = root:GetComponentsInChildren(typeof(CLUIElement), true)
for i = 0, elements.Length - 1 do
self:setElementMode(elements[i])
@@ -133,7 +135,7 @@ function TRPNewFollow:setExtendFieldsMode(root)
self:reposition()
end
function TRPNewFollow:setElementMode(el)
function TRPNewFollowSimple:setElementMode(el)
local isPopList = el:GetComponent("UIPopupList")
local isPopCheckbox = el:GetComponent("CLUICheckbox")
---@type UIInput
@@ -174,18 +176,18 @@ function TRPNewFollow:setElementMode(el)
end
-- 刷新
function TRPNewFollow:refresh()
function TRPNewFollowSimple:refresh()
end
-- 关闭页面
function TRPNewFollow:hide()
function TRPNewFollowSimple:hide()
if uiobjs.DetailRoot.luaTable then
uiobjs.DetailRoot.luaTable.release()
end
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPNewFollow:procNetwork(cmd, succ, msg, paras)
function TRPNewFollowSimple:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.update_customer then
self:refreshContent()
@@ -193,7 +195,7 @@ function TRPNewFollow:procNetwork(cmd, succ, msg, paras)
end
end
function TRPNewFollow:setEventDelegate()
function TRPNewFollowSimple:setEventDelegate()
self.EventDelegate = {
ButtonSave = function()
local err = uiobjs.DetailFromRoot:checkValid()
@@ -217,7 +219,7 @@ function TRPNewFollow:setEventDelegate()
}
end
-- 处理ui上的事件例如点击等
function TRPNewFollow:uiEventDelegate(go)
function TRPNewFollowSimple:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
@@ -225,8 +227,8 @@ function TRPNewFollow:uiEventDelegate(go)
end
-- 当顶层页面发生变化时回调
function TRPNewFollow:onTopPanelChange(topPanel)
function TRPNewFollowSimple:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPNewFollow
return TRPNewFollowSimple

View File

@@ -0,0 +1,229 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPNewFollowTask:TRBasePanel
local TRPNewFollowTask = class("TRPNewFollowTask", TRBasePanel)
local uiobjs = {}
local stars = {}
-- 初始化,只会调用一次
function TRPNewFollowTask:init(csObj)
TRPNewFollowTask.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.ButtonSave = getChild(self.transform, "Top/ButtonSave")
end
function TRPNewFollowTask:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
attr = {}
attr.attrName = "跟进内容"
attr.id = "bookingNote"
attr.attrType = DBCust.FieldType.multext
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "跟进时间"
attr.id = "FollowUpTime"
attr.attrType = DBCust.FieldType.dateTime
attr.ifTime = 1
attr.ifMust = 1
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "跟进人员"
attr.id = "loginNo"
attr.attrType = DBCust.FieldType.popuplist
attr.ifMust = 1
attr.donotJoinKey = true
local popList = DBCust.getFilter4Popup(DBCust.FilterGroup.loginNoList)
attr.popOptions = popList.options
attr.popValues = popList.values
table.insert(self.baseFiledsAttr, attr)
end
-- 设置数据
---@param paras _ParamTRPNewFollowTask
function TRPNewFollowTask:setData(paras)
self.mdata = {}
self.mdata.custId = paras.custId
self.mdata.taskId = paras.taskId
self.isNewFollow = true
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPNewFollowTask:show()
self:refreshContent()
SetActive(uiobjs.ButtonSave.gameObject, self.isNewFollow)
uiobjs.scrollView:ResetPosition()
end
function TRPNewFollowTask:refreshContent()
self:showBaseFields()
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
end
function TRPNewFollowTask: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
filedInfor.onClick = nil
filedInfor.onSelect = self:wrapFunc(self.onPopupFieldValChg)
table.insert(param.fields, filedInfor)
end
uiobjs.DetailRoot:init(param, nil)
end
function TRPNewFollowTask:onPopupFieldValChg(go)
---@type CLUIElement
local el = go:GetComponent("CLUIElement")
if el.jsonKey == "dealFlag" then
if uiobjs.followUpContent and isNilOrEmpty(uiobjs.followUpContent.value) then
local popList = go:GetComponent("UIPopupList")
uiobjs.followUpContent.value = popList.selectedItem
end
end
end
function TRPNewFollowTask:reposition()
uiobjs.DetailRootTabel.repositionNow = true
uiobjs.Table.repositionNow = true
end
function TRPNewFollowTask:setExtendFieldsMode(root)
local elements = root:GetComponentsInChildren(typeof(CLUIElement), true)
for i = 0, elements.Length - 1 do
self:setElementMode(elements[i])
if elements[i].jsonKey == "followUpContent" then
---@type CLUIElement
uiobjs.followUpContent = elements[i]
end
end
self:reposition()
end
function TRPNewFollowTask: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.isNewFollow) and (el.jsonKey == "taskId" or el.jsonKey == "phoneNo") then
boxcollider.enabled = false
else
boxcollider.enabled = true
end
if ButtonReset then
ButtonReset.disabled = (not self.isNewFollow)
end
if input then
if isPopList or isPopCheckbox then
input.enabled = false
if inputOnGUI then
inputOnGUI.enabled = false
end
else
if self.isNewFollow 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 TRPNewFollowTask:refresh()
end
-- 关闭页面
function TRPNewFollowTask:hide()
if uiobjs.DetailRoot.luaTable then
uiobjs.DetailRoot.luaTable.release()
end
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPNewFollowTask:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.update_customer then
self:refreshContent()
end
end
end
function TRPNewFollowTask:setEventDelegate()
self.EventDelegate = {
ButtonSave = function()
local err = uiobjs.DetailFromRoot:checkValid()
if not isNilOrEmpty(err) then
MyUtl.toastW(err)
return
end
self.mdata = uiobjs.DetailFromRoot:getValue(self.mdata, true)
showHotWheel()
NetProto.send.create_followUp_task(self.mdata, function(content)
hideHotWheel()
if content.success then
MyUtl.toastS("创建成功")
hideTopPanel(self.csSelf)
end
end)
end
}
end
-- 处理ui上的事件例如点击等
function TRPNewFollowTask:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPNewFollowTask:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPNewFollowTask

View File

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

View File

@@ -33,6 +33,11 @@ function TRPNewOrder:init(csObj)
uiobjs.InputNextLogino = getCC(uiobjs.StepRoot.transform, "InputNextLogino", "UIPopupList")
uiobjs.gridProjects = getCC(uiobjs.Table.transform, "InputSelectProduct/Products", "UIGrid")
uiobjs.gridProjectsPrefab = getChild(uiobjs.gridProjects.transform, "00000").gameObject
uiobjs.InputAttachment = getCC(uiobjs.Table.transform, "InputAttachment", "UIPopupList")
uiobjs.gridImages = getCC(uiobjs.InputAttachment.transform, "Grid", "UIGrid")
uiobjs.gridImagesPrefab = getChild(uiobjs.gridImages.transform, "00000").gameObject
-- uiobjs.elements = uiobjs.DetailRoot.gameObject:GetComponentsInChildren(typeof(CLUIElement), true)
uiobjs.ButtonSave = getChild(self.transform, "Top/ButtonSave")
end
@@ -138,7 +143,7 @@ function TRPNewOrder:setData(paras)
---@type _DBCust
self.cust = nil
else
--//TODO:初始值
-- 初始值
self.isNewOrder = true
---@type _DBCust
self.cust = paras
@@ -150,6 +155,7 @@ function TRPNewOrder:setData(paras)
local templateInfor = DBOrder.getTemplateInfor(self.mdata.templetId)
self.mdata.content = templateInfor.content
self.selectedProducts = {}
self.images = {}
end
end
@@ -171,6 +177,10 @@ end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPNewOrder:show()
SetActive(uiobjs.gridProjects.transform.parent.gameObject, false)
SetActive(uiobjs.StepFormRoot.gameObject, false)
SetActive(uiobjs.ExtendRoot.gameObject, false)
self:refreshContent()
SetActive(uiobjs.ButtonSave.gameObject, self.isNewOrder)
@@ -180,8 +190,6 @@ end
function TRPNewOrder:refreshContent()
self:showBaseFields()
self:showProducts()
local templetId = self.mdata and self.mdata.templetId or nil
self:showExtentFiles(templetId)
self.csSelf:invoke4Lua(self:wrapFunc(self.reposition), 0.1)
end
@@ -217,6 +225,8 @@ function TRPNewOrder:showBaseFields()
local param = {}
param.data = self.mdata or {}
param.onFinish = function(go)
local templetId = self.mdata and self.mdata.templetId or nil
self:showExtentFiles(templetId)
if self.cust then
uiobjs.DetailFromRoot:setValue(self.cust, true)
end
@@ -230,7 +240,7 @@ function TRPNewOrder:showBaseFields()
-- 工单模板
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
filedInfor.showMode = self.isNewOrder and _FieldMode.inputOnly or _FieldMode.modifyOnly
if filedInfor.attr.attrType == DBCust.FieldType.multext then
filedInfor.onMultTextInputChg = self:wrapFunc(self.reposition)
end
@@ -260,7 +270,7 @@ function TRPNewOrder:showExtentFiles(templetId)
for i, v in ipairs(fields) do
filedInfor = {}
filedInfor.attr = v
filedInfor.isEditMode = true
filedInfor.showMode = self.isNewOrder and _FieldMode.inputOnly or _FieldMode.modifyOnly
if filedInfor.attr.attrType == DBCust.FieldType.multext then
filedInfor.onMultTextInputChg = self:wrapFunc(self.reposition)
end
@@ -299,11 +309,16 @@ function TRPNewOrder:showExtentFiles(templetId)
local d = uiobjs.DetailFromRoot:getValue(true)
d.content = cfgInfor.content
uiobjs.DetailFromRoot:setValue(d)
-------
-- 附件
self:showImages()
-----------------------------------
uiobjs.StepRoot:Reposition()
end
function TRPNewOrder:reposition()
uiobjs.DetailRootTabel:Reposition()
uiobjs.Table:Reposition()
uiobjs.DetailRootTabel.repositionNow = true
uiobjs.Table.repositionNow = true
end
@@ -566,12 +581,75 @@ function TRPNewOrder:setEventDelegate()
{selectedProducts = self.selectedProducts, callback = self:wrapFunc(self.onGetSelectedProducts)}
)
end,
InputAttachment = function()
InputAttachment = function(go)
-- 添加附件
---@type UIPopupList
local popList = go:GetComponent("UIPopupList")
if popList.value == "1" then
-- 相机
local permission = MyCamera.getImage(self:wrapFunc(self.onGetImage))
if permission ~= NativeCamera.Permission.Granted then
CLUIUtl.showConfirm(
"没有使用相机的权限,打开设置允许使用相机",
function()
if not MyCamera.openSetting() then
MyUtl.toastW("打开权限设置失败")
end
end,
nil
)
end
elseif popList.value == "2" then
local permission = MyGallery.getImage(self:wrapFunc(self.onGetImage))
if permission ~= NativeGallery.Permission.Granted then
CLUIUtl.showConfirm(
"没有使用相册的权限,打开设置允许使用相册",
function()
if not MyGallery.openSetting() then
MyUtl.toastW("打开权限设置失败")
end
end,
nil
)
end
end
end
}
end
function TRPNewOrder:onGetImage(path)
if isNilOrEmpty(path) then
return
end
for i, v in ipairs(self.images) do
if v.path == path then
MyUtl.toast("已在列表中")
return
end
end
table.insert(self.images, {path = path, onDelete = self:wrapFunc(self.onDelImage)})
self:showImages()
end
function TRPNewOrder:showImages()
CLUIUtl.resetList4Lua(uiobjs.gridImages, uiobjs.gridImagesPrefab, self.images, self:wrapFunc(self.initImageCell))
end
function TRPNewOrder:initImageCell(cell, data)
cell:init(data, nil)
end
---@type _ParamCellImage
function TRPNewOrder:onDelImage(data)
for i, v in ipairs(self.images) do
if v.path == data.path then
table.remove(self.images, i)
break
end
end
self:showImages()
end
function TRPNewOrder:onGetSelectedProducts(list)
self.selectedProducts = list
self:showProducts()
@@ -581,7 +659,7 @@ end
function TRPNewOrder:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
func(go)
end
end

View File

@@ -0,0 +1,223 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPOrderList:TRBasePanel 邮件列表
local TRPOrderList = class("TRPOrderList", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPOrderList:init(csObj)
TRPOrderList.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 40, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
---@type CLUIScrollViewWithEvent
uiobjs.scrollView = getCC(self.transform, "PanelContent", "CLUIScrollViewWithEvent")
uiobjs.scrollView:init(
self:wrapFunc(self.onShowRefreshFlg),
self:wrapFunc(self.onhideRefreshFlg),
self:wrapFunc(self.refreshList)
)
---@type Coolape.CLUILoopGrid
uiobjs.Grid = getCC(uiobjs.scrollView.transform, "Grid", "CLUILoopGrid")
uiobjs.ButtonEndList = getChild(uiobjs.Grid.transform, "ButtonEndList")
uiobjs.ButtonEndListLb = getCC(uiobjs.ButtonEndList, "Label", "UILabel")
uiobjs.ButtonHeadList = getChild(uiobjs.Grid.transform, "ButtonHeadList")
end
-- 设置数据
---@param paras _ParamTRPOrderList
function TRPOrderList:setData(paras)
self.mdata = paras
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPOrderList:show()
uiobjs.InputSeachKey.value = ""
self:refreshFilterBtnStatus()
self:showList({})
showHotWheel()
NetProto.send.list_customers(self.filterValue, "", 1)
end
function TRPOrderList:showList(list)
SetActive(uiobjs.ButtonHeadList.gameObject, false)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:setList(
list or {},
self:wrapFunc(self.initCell),
self:wrapFunc(self.onHeadList),
self:wrapFunc(self.onEndList)
)
uiobjs.scrollView:ResetPosition()
end
function TRPOrderList:appList(list)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:appendList(list)
end
function TRPOrderList:onShowRefreshFlg()
-- printe("TRPOrderList:onShowRefreshFlg")
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 222, 0)
SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPOrderList:onhideRefreshFlg()
-- printe("TRPOrderList:onhideRefreshFlg")
SetActive(uiobjs.ButtonHeadList.gameObject, false)
end
function TRPOrderList:refreshList()
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
NetProto.send.list_customers(self.filterValue, queryKey, 1)
end
function TRPOrderList:onHeadList(head)
printw("到最顶端了")
-- uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 250, 0)
-- SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPOrderList:onEndList(tail)
printw("到最后了==" .. tail.name)
if self.pageInfo and self.pageInfo.current_page < self.pageInfo.total_pages then
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
-- 取得下一页
NetProto.send.list_customers(self.filterValue, queryKey, self.pageInfo.current_page + 1)
else
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -235
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
end
function TRPOrderList:initCell(cell, data)
cell:init(data, self:wrapFunc(self.onClickCell))
end
function TRPOrderList:onClickCell(cell, data)
getPanelAsy("PanelCustDetail", onLoadedPanelTT, data)
end
function TRPOrderList: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
function TRPOrderList:hadFilterVal()
for i, v in ipairs(self.filters or {}) do
for j, f in ipairs(v.list) do
if f.selected then
return true
end
end
end
return false
end
-- 刷新
function TRPOrderList:refresh()
end
-- 关闭页面
function TRPOrderList:hide()
self.filterValue = nil
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPOrderList:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.list_customers 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 TRPOrderList:setEventDelegate()
self.EventDelegate = {
ButtonAddCust = function()
getPanelAsy("PanelNewCust", onLoadedPanelTT)
end,
ButtonFilter = function()
getPanelAsy(
"PanelCustFilter",
onLoadedPanelTT,
{
callback = self:wrapFunc(self.onSetFilter),
queryKey = uiobjs.InputSeachKey.value,
defautFilter = self.filters
}
)
end,
InputSeachKey = function()
local queryKey = uiobjs.InputSeachKey.value
NetProto.send.list_customers(self.filterValue, queryKey, 1)
end
}
end
function TRPOrderList:getFilterStr()
if not self.filters then
return ""
end
local ret = {}
for i, g in ipairs(self.filters) do
local list = {}
for j, f in ipairs(g.list) do
if f.selected and f.value ~= -1 then
table.insert(list, f.value)
end
end
ret[g.key2] = table.concat(list, ",")
end
return ret
end
function TRPOrderList:onSetFilter(filters, queryKey)
local oldqueryKey = uiobjs.InputSeachKey.value
uiobjs.InputSeachKey.value = queryKey
self.filters = filters
self:refreshFilterBtnStatus()
local queryKey = uiobjs.InputSeachKey.value
queryKey = trim(queryKey)
showHotWheel()
self.filterValue = self:getFilterStr()
if oldqueryKey == queryKey then
NetProto.send.list_customers(self.filterValue, queryKey, 1)
else
-- 会触发input的onChange事件
end
end
-- 处理ui上的事件例如点击等
function TRPOrderList:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPOrderList:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPOrderList

View File

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