This commit is contained in:
2020-07-21 22:50:03 +08:00
parent 4730b841ae
commit 3f114a6fca
69 changed files with 4668 additions and 1192 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

@@ -161,6 +161,9 @@ function CSPTasks.setEventDelegate()
ButtonOrder = function()
getPanelAsy("PanelOrderList", onLoadedPanelTT)
end,
ButtonGoods = function()
getPanelAsy("PanelProductList", onLoadedPanelTT)
end,
}
end

View File

@@ -25,6 +25,7 @@ function TRPCustDetail:init(csObj)
---@type UIPopupList
uiobjs.LabelStatus = getCC(uiobjs.Head.transform, "LabelStatus", "UIPopupList")
uiobjs.LabelType = getCC(uiobjs.Head.transform, "LabelType", "UIPopupList")
uiobjs.LabelLoginNo = getCC(uiobjs.Head.transform, "LabelLoginNo", "UIPopupList")
uiobjs.starGrid = getCC(uiobjs.Head.transform, "LabelStars/Grid", "UIGrid")
uiobjs.starGridPrefab = getChild(uiobjs.starGrid.transform, "00000").gameObject
@@ -135,6 +136,7 @@ function TRPCustDetail:show()
uiobjs.InputTask:refreshItems(optionInfor.options, optionInfor.values)
local poplist = DBUser.getPopList()
uiobjs.InputLogin:refreshItems(poplist.options, poplist.values)
uiobjs.LabelLoginNo:refreshItems(poplist.options, poplist.values)
-- 设置星级
local stars = {}
for i = 1, 5 do

View File

@@ -38,7 +38,7 @@ function TRPFollowList:show()
self:refreshFilterBtnStatus()
self:showList({})
showHotWheel()
NetProto.send.list_customers(self.filterValue, "", 1)
NetProto.send.list_followUp_records(self.filterValue, "", 1)
end
function TRPFollowList:showList(list)
@@ -70,7 +70,7 @@ end
function TRPFollowList:refreshList()
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
NetProto.send.list_customers(self.filterValue, queryKey, 1)
NetProto.send.list_followUp_records(self.filterValue, queryKey, 1)
end
function TRPFollowList:onHeadList(head)
@@ -85,7 +85,7 @@ function TRPFollowList:onEndList(tail)
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
-- 取得下一页
NetProto.send.list_customers(self.filterValue, queryKey, self.pageInfo.current_page + 1)
NetProto.send.list_followUp_records(self.filterValue, queryKey, self.pageInfo.current_page + 1)
else
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -335
SetActive(uiobjs.ButtonEndList.gameObject, true)
@@ -134,7 +134,7 @@ end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPFollowList:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.list_customers then
if cmd == NetProto.cmds.list_followUp_records then
local result = paras.result or {}
self.pageInfo = result.meta
if self.pageInfo and self.pageInfo.current_page > 1 then
@@ -143,19 +143,12 @@ function TRPFollowList:procNetwork(cmd, succ, msg, paras)
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",
@@ -169,7 +162,7 @@ function TRPFollowList:setEventDelegate()
end,
InputSeachKey = function()
local queryKey = uiobjs.InputSeachKey.value
NetProto.send.list_customers(self.filterValue, queryKey, 1)
NetProto.send.list_followUp_records(self.filterValue, queryKey, 1)
end
}
end
@@ -201,7 +194,7 @@ function TRPFollowList:onSetFilter(filters, queryKey)
showHotWheel()
self.filterValue = self:getFilterStr()
if oldqueryKey == queryKey then
NetProto.send.list_customers(self.filterValue, queryKey, 1)
NetProto.send.list_followUp_records(self.filterValue, queryKey, 1)
else
-- 会触发input的onChange事件
end

View File

@@ -0,0 +1,158 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPProductDetail:TRBasePanel
local TRPProductDetail = class("TRPProductDetail", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPProductDetail:init(csObj)
TRPProductDetail.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.TableForm = uiobjs.Table:GetComponent("CLUIFormRoot")
---@type Coolape.CLCellLua
uiobjs.TableLua = uiobjs.Table:GetComponent("CLCellLua")
end
function TRPProductDetail:initFiledsAttr()
---@type _ParamFieldAttr
local attr
self.baseFiledsAttr = {}
attr = {}
attr.attrName = "产品名称"
attr.id = "name"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "产品单价"
attr.id = "price"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "产品库存"
attr.id = "num"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "产品类型"
attr.id = "prodTypeName"
attr.attrType = DBCust.FieldType.text
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
attr = {}
attr.attrName = "产品描述"
attr.id = "productDesc"
attr.attrType = DBCust.FieldType.multext
attr.ifMust = 0
attr.donotJoinKey = true
table.insert(self.baseFiledsAttr, attr)
end
-- 设置数据
---@param paras _ParamTRPProductDetail
function TRPProductDetail:setData(paras)
self.mdata = paras
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPProductDetail: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.showOnly
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 TRPProductDetail:onClickField(el)
end
function TRPProductDetail:onFinishSetField(key, val)
if tostring(val) ~= tostring(self.mdata[key]) then
-- self:sendModifymsg(key, val, true)
--//TODO:
end
end
function TRPProductDetail:onSelectField(go)
end
function TRPProductDetail:reposition()
uiobjs.Table:Reposition()
uiobjs.Table.repositionNow = true
uiobjs.scrollView:ResetPosition()
end
-- 刷新
function TRPProductDetail:refresh()
end
-- 关闭页面
function TRPProductDetail:hide()
uiobjs.TableLua.luaTable.release()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPProductDetail:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPProductDetail:setEventDelegate()
self.EventDelegate = {}
end
function TRPProductDetail:onGetImage(path)
if isNilOrEmpty(path) then
return
end
--//TODO:
end
-- 处理ui上的事件例如点击等
function TRPProductDetail:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func(go)
end
end
-- 当顶层页面发生变化时回调
function TRPProductDetail:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPProductDetail

View File

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

View File

@@ -0,0 +1,120 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPProductList:TRBasePanel
local TRPProductList = class("TRPProductList", TRBasePanel)
local uiobjs = {}
local selectedMap = {}
-- 初始化,只会调用一次
function TRPProductList:init(csObj)
TRPProductList.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 298, 0)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
---@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")
end
-- 设置数据
---@param paras _ParamTRPProductList
function TRPProductList:setData(paras)
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPProductList:show()
uiobjs.InputSeachKey.value = ""
showHotWheel()
NetProto.send.selectProductInfo(uiobjs.InputSeachKey.value, 1)
self:showList({})
end
function TRPProductList:showList(products)
SetActive(uiobjs.ButtonEndList.gameObject, false)
local list = {}
for i, v in ipairs(products or {}) do
table.insert(list, {data = v, isSelected = false})
end
uiobjs.Grid:setList(list, self:wrapFunc(self.initCell), nil, self:wrapFunc(self.onEndList))
uiobjs.scrollView:ResetPosition()
end
function TRPProductList:appList(list)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:appendList(list)
end
function TRPProductList:initCell(cell, data)
cell:init(data, self:wrapFunc(self.onClickCell))
end
function TRPProductList:onClickCell(cell, data)
getPanelAsy("PanelProductDetail", onLoadedPanelTT, data.data)
end
function TRPProductList: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.selectProductInfo(queryKey, self.pageInfo.current_page + 1)
else
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -210
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
end
-- 刷新
function TRPProductList:refresh()
end
-- 关闭页面
function TRPProductList:hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPProductList:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
if cmd == NetProto.cmds.selectProductInfo 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()
end
end
end
function TRPProductList:setEventDelegate()
self.EventDelegate = {
InputSeachKey = function()
local queryKey = uiobjs.InputSeachKey.value
NetProto.send.selectProductInfo(queryKey, 1)
end,
ButtonProductGroup = function()
end
}
end
-- 处理ui上的事件例如点击等
function TRPProductList:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPProductList:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPProductList

View File

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

View File

@@ -112,6 +112,10 @@ end
function TRPSelectProduct:setEventDelegate()
self.EventDelegate = {
InputSeachKey = function()
local queryKey = uiobjs.InputSeachKey.value
NetProto.send.selectProductInfo(queryKey, 1)
end,
ButtonCancel = function()
hideTopPanel(self.csSelf)
end,