add
This commit is contained in:
@@ -13,6 +13,7 @@ local InputHH
|
||||
local InputMM
|
||||
local InputSS
|
||||
|
||||
local LabelTitle
|
||||
local LabelSelectDate
|
||||
|
||||
local callback = nil
|
||||
@@ -23,7 +24,11 @@ local selectedDay
|
||||
|
||||
local oldSelectedCell
|
||||
local isNeedTime = false
|
||||
local isDateRange = false
|
||||
local curIndex = 0
|
||||
local InputTimeStart, InputTimeEnd, InputTime
|
||||
local startDate, endDate, startDateStr, endDateStr
|
||||
local defaultDateStr, defaultDate, defaultDate2
|
||||
|
||||
PanelCalender = {}
|
||||
function PanelCalender.init(_cs)
|
||||
@@ -34,45 +39,124 @@ function PanelCalender.init(_cs)
|
||||
local content = getChild(transform, "content")
|
||||
LabelYY = getChild(content, "Title", "LabelYY"):GetComponent("UILabel")
|
||||
LabelMM = getChild(content, "Title", "LabelMM"):GetComponent("UILabel")
|
||||
LabelTitle = getChild(content, "Title", "LabelTitle"):GetComponent("UILabel")
|
||||
---@type Coolape.UIGridPage
|
||||
grid = getChild(content, "PanelDay/GridPage"):GetComponent("UIGridPage")
|
||||
LabelSelectDate = getChild(content, "LabelSelectDate"):GetComponent("UILabel")
|
||||
|
||||
ButtonRoot = getChild(content, "ButtonRoot")
|
||||
TimeRoot = getChild(content, "TimeRoot")
|
||||
InputHH = getChild(TimeRoot, "InputHH"):GetComponent("UIPopupList")
|
||||
InputMM = getChild(TimeRoot, "InputMM"):GetComponent("UIPopupList")
|
||||
InputSS = getChild(TimeRoot, "InputSS"):GetComponent("UIPopupList")
|
||||
InputTimeStart = getCC(TimeRoot, "InputTimeStart", "CLUIElement")
|
||||
InputTimeEnd = getCC(TimeRoot, "InputTimeEnd", "CLUIElement")
|
||||
InputTime = getCC(TimeRoot, "InputTime", "CLUIElement")
|
||||
end
|
||||
|
||||
function PanelCalender.setData(pars)
|
||||
curYear = pars[0]
|
||||
curMonth = pars[1]
|
||||
callback = pars[2]
|
||||
if (pars.Count > 3) then
|
||||
isNeedTime = pars[3]
|
||||
defaultDateStr = pars[0]
|
||||
-- curMonth = pars[1]
|
||||
callback = pars[1]
|
||||
if (pars.Count > 2) then
|
||||
isNeedTime = pars[2]
|
||||
else
|
||||
isNeedTime = false
|
||||
end
|
||||
if (pars.Count > 3) then
|
||||
isDateRange = pars[3]
|
||||
else
|
||||
isDateRange = false
|
||||
end
|
||||
|
||||
if isDateRange then
|
||||
if isNilOrEmpty(defaultDateStr) then
|
||||
startDate = nil
|
||||
endDate = nil
|
||||
curYear = DateTime.Now.Year
|
||||
curMonth = DateTime.Now.Month
|
||||
else
|
||||
local strs = strSplit(defaultDateStr, "~")
|
||||
defaultDate = DateTime.Parse(strs[1])
|
||||
local date = defaultDate
|
||||
startDate =
|
||||
tonumber(
|
||||
joinStr(NumEx.nStrForLen(date.Year, 4), NumEx.nStrForLen(date.Month, 2), NumEx.nStrForLen(date.Day, 2))
|
||||
)
|
||||
startDateStr = joinStr(date.Year, "-", date.Month, "-", date.Day)
|
||||
curYear = date.Year
|
||||
curMonth = date.Month
|
||||
|
||||
defaultDate2 = DateTime.Parse(strs[2])
|
||||
date = defaultDate2
|
||||
endDate =
|
||||
tonumber(
|
||||
joinStr(NumEx.nStrForLen(date.Year, 4), NumEx.nStrForLen(date.Month, 2), NumEx.nStrForLen(date.Day, 2))
|
||||
)
|
||||
endDateStr = joinStr(date.Year, "-", date.Month, "-", date.Day)
|
||||
end
|
||||
else
|
||||
if isNilOrEmpty(defaultDateStr) then
|
||||
curYear = DateTime.Now.Year
|
||||
curMonth = DateTime.Now.Month
|
||||
defaultDate = nil
|
||||
selectedYear = nil
|
||||
selectedMonth = nil
|
||||
selectedDay = nil
|
||||
else
|
||||
defaultDate = DateTime.Parse(defaultDateStr)
|
||||
curYear = defaultDate.Year
|
||||
curMonth = defaultDate.Month
|
||||
selectedYear = defaultDate.Year
|
||||
selectedMonth = defaultDate.Month
|
||||
selectedDay = defaultDate.Day
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.getData()
|
||||
return curYear, curMonth
|
||||
end
|
||||
|
||||
function PanelCalender.getDateRangeDate()
|
||||
return isDateRange, startDate, endDate
|
||||
end
|
||||
|
||||
function PanelCalender.show()
|
||||
csSelf.panel.depth = CLPanelManager.self.depth + 80
|
||||
|
||||
oldSelectedCell = nil
|
||||
selectedYear = nil
|
||||
selectedMonth = nil
|
||||
selectedDay = nil
|
||||
if (isNeedTime) then
|
||||
if isDateRange then
|
||||
LabelTitle.text = "选择时间范围"
|
||||
SetActive(InputTimeStart.gameObject, true)
|
||||
if defaultDate then
|
||||
InputTimeStart.value = defaultDate:ToString(DateEx.fmt_HH_mm_ss)
|
||||
else
|
||||
InputTimeStart.value = DateEx.format(DateEx.fmt_HH_mm_ss)
|
||||
end
|
||||
SetActive(InputTimeEnd.gameObject, true)
|
||||
if defaultDate2 then
|
||||
InputTimeEnd.value = defaultDate2:ToString(DateEx.fmt_HH_mm_ss)
|
||||
else
|
||||
InputTimeEnd.value = DateEx.format(DateEx.fmt_HH_mm_ss)
|
||||
end
|
||||
SetActive(InputTime.gameObject, false)
|
||||
else
|
||||
LabelTitle.text = "选择时间"
|
||||
SetActive(InputTimeStart.gameObject, false)
|
||||
SetActive(InputTimeEnd.gameObject, false)
|
||||
SetActive(InputTime.gameObject, true)
|
||||
if defaultDate then
|
||||
InputTime.value = defaultDate:ToString(DateEx.fmt_HH_mm_ss)
|
||||
else
|
||||
InputTime.value = DateEx.format(DateEx.fmt_HH_mm_ss)
|
||||
end
|
||||
end
|
||||
NGUITools.SetActive(TimeRoot.gameObject, true)
|
||||
InputHH.value = NumEx.nStrForLen(DateTime.Now.Hour, 2)
|
||||
InputMM.value = NumEx.nStrForLen(DateTime.Now.Minute, 2)
|
||||
InputSS.value = NumEx.nStrForLen(DateTime.Now.Second, 2)
|
||||
ButtonRoot.localPosition = Vector3(0, -627, 0)
|
||||
ButtonRoot.localPosition = Vector3(0, -915, 0)
|
||||
else
|
||||
if isDateRange then
|
||||
LabelTitle.text = "选择日期范围"
|
||||
else
|
||||
LabelTitle.text = "选择日期"
|
||||
end
|
||||
NGUITools.SetActive(TimeRoot.gameObject, false)
|
||||
ButtonRoot.localPosition = TimeRoot.localPosition
|
||||
end
|
||||
@@ -80,14 +164,31 @@ end
|
||||
|
||||
function PanelCalender.refresh()
|
||||
PanelCalender.showCalender(curYear, curMonth)
|
||||
if (selectedYear ~= nil) then
|
||||
local dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
LabelSelectDate.text = dataStr
|
||||
if isDateRange then
|
||||
if startDate and endDate then
|
||||
LabelSelectDate.text =
|
||||
joinStr(
|
||||
"[999999]开始日期:[-][363636]",
|
||||
startDateStr,
|
||||
"[-] ",
|
||||
"[999999]结束日期:[-][363636]",
|
||||
endDateStr,
|
||||
"[-]"
|
||||
)
|
||||
else
|
||||
LabelSelectDate.text =
|
||||
joinStr("[999999]开始日期:[-][363636]", "请选择", "[-] ", "[999999]结束日期:[-][363636]", "请选择", "[-]")
|
||||
end
|
||||
else
|
||||
LabelSelectDate.text = ""
|
||||
if (selectedYear ~= nil) then
|
||||
local dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
LabelSelectDate.text = joinStr("[999999]选择日期:[-][363636]", dataStr, "[-])")
|
||||
else
|
||||
LabelSelectDate.text = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -159,17 +260,69 @@ function PanelCalender.setSelectDate(cell, year, month, day)
|
||||
selectedDay = day
|
||||
selectedYear = year
|
||||
selectedMonth = month
|
||||
local dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
LabelSelectDate.text = dataStr
|
||||
if isDateRange then
|
||||
local dataStr = ""
|
||||
local tmpDate =
|
||||
tonumber(joinStr(NumEx.nStrForLen(year, 4), NumEx.nStrForLen(month, 2), NumEx.nStrForLen(day, 2)))
|
||||
local tmpDateStr = joinStr(year, "-", month, "-", day)
|
||||
-- 选择日期范围
|
||||
if startDate == nil then
|
||||
startDate = tmpDate
|
||||
startDateStr = tmpDateStr
|
||||
dataStr =
|
||||
joinStr("[999999]开始日期:[-][363636]", startDateStr, "[-] ", "[999999]结束日期:[-][363636]", "请选择", "[-]")
|
||||
elseif startDate > tmpDate then
|
||||
startDate = tmpDate
|
||||
startDateStr = tmpDateStr
|
||||
endDate = nil
|
||||
dataStr =
|
||||
joinStr("[999999]开始日期:[-][363636]", startDateStr, "[-] ", "[999999]结束日期:[-][363636]", "请选择", "[-]")
|
||||
else
|
||||
endDate = tmpDate
|
||||
endDateStr = tmpDateStr
|
||||
dataStr =
|
||||
joinStr(
|
||||
"[999999]开始日期:[-][363636]",
|
||||
startDateStr,
|
||||
"[-] ",
|
||||
"[999999]结束日期:[-][363636]",
|
||||
tmpDateStr,
|
||||
"[-]"
|
||||
)
|
||||
end
|
||||
LabelSelectDate.text = dataStr
|
||||
|
||||
if (oldSelectedCell ~= nil) then
|
||||
oldSelectedCell.luaTable.refreshState(false)
|
||||
curYear = selectedYear
|
||||
curMonth = selectedMonth
|
||||
PanelCalender.refreshDays()
|
||||
else
|
||||
local dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
LabelSelectDate.text = joinStr("[999999]选择日期:[-][363636]", dataStr, "[-]")
|
||||
|
||||
if (oldSelectedCell ~= nil) then
|
||||
oldSelectedCell.luaTable.refreshState(false)
|
||||
end
|
||||
oldSelectedCell = cell
|
||||
oldSelectedCell.luaTable.refreshState(true)
|
||||
end
|
||||
end
|
||||
|
||||
function PanelCalender.refreshDays()
|
||||
local cell = grid.page1:GetComponent("CLCellLua")
|
||||
if cell and cell.luaTable then
|
||||
cell.luaTable.doRefresh()
|
||||
end
|
||||
cell = grid.page2:GetComponent("CLCellLua")
|
||||
if cell and cell.luaTable then
|
||||
cell.luaTable.doRefresh()
|
||||
end
|
||||
cell = grid.page3:GetComponent("CLCellLua")
|
||||
if cell and cell.luaTable then
|
||||
cell.luaTable.doRefresh()
|
||||
end
|
||||
oldSelectedCell = cell
|
||||
oldSelectedCell.luaTable.refreshState(true)
|
||||
end
|
||||
|
||||
-- function PanelCalender.addMonth(m)
|
||||
@@ -192,6 +345,10 @@ end
|
||||
-- end
|
||||
|
||||
function PanelCalender.hide()
|
||||
if (oldSelectedCell ~= nil) then
|
||||
oldSelectedCell.luaTable.refreshState(false)
|
||||
end
|
||||
oldSelectedCell = nil
|
||||
end
|
||||
|
||||
function PanelCalender.procNetwork(cmd, succ, msg, paras)
|
||||
@@ -220,21 +377,38 @@ function PanelCalender.onClickBtn(btnName)
|
||||
oldSelectedCell = nil
|
||||
curYear = DateTime.Now.Year
|
||||
curMonth = DateTime.Now.Month
|
||||
selectedYear = nil
|
||||
selectedMonth = nil
|
||||
selectedDay = nil
|
||||
startDate = nil
|
||||
endDate = nil
|
||||
startDateStr = ""
|
||||
endDateStr = ""
|
||||
PanelCalender.show()
|
||||
PanelCalender.refresh()
|
||||
elseif btnName == "ButtonOkay" then
|
||||
CLPanelManager.hidePanel(csSelf)
|
||||
local dataStr = ""
|
||||
if (selectedYear ~= nil) then
|
||||
dataStr =
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
if (isNeedTime) then
|
||||
if isDateRange then
|
||||
if startDate == nil or endDate == nil then
|
||||
MyUtl.toastW("请选择开始结束日期")
|
||||
return
|
||||
end
|
||||
CLPanelManager.hidePanel(csSelf)
|
||||
if isNeedTime then
|
||||
dataStr = joinStr(startDateStr, " ", InputTimeStart.value, "~", endDateStr, " ", InputTimeEnd.value)
|
||||
else
|
||||
dataStr = joinStr(startDateStr, "~", endDateStr)
|
||||
end
|
||||
else
|
||||
CLPanelManager.hidePanel(csSelf)
|
||||
if (selectedYear ~= nil) then
|
||||
dataStr =
|
||||
PStr.b():a(dataStr):a(" "):a(NumEx.nStrForLen(InputHH.value, 2)):a(":"):a(
|
||||
NumEx.nStrForLen(InputMM.value, 2)
|
||||
):a(":"):a(NumEx.nStrForLen(InputSS.value, 2)):e()
|
||||
PStr.b():a(tostring(selectedYear)):a("-"):a(NumEx.nStrForLen(selectedMonth, 2)):a("-"):a(
|
||||
NumEx.nStrForLen(selectedDay, 2)
|
||||
):e()
|
||||
if (isNeedTime) then
|
||||
dataStr = joinStr(dataStr, " ", InputTime.value)
|
||||
end
|
||||
end
|
||||
end
|
||||
Utl.doCallback(callback, dataStr)
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
-- xx界面
|
||||
local CLLPPopTime = {}
|
||||
|
||||
---@type Coolape.CLPanelLua
|
||||
local csSelf = nil
|
||||
---@type UnityEngine.Transform
|
||||
local transform = nil
|
||||
local uiobjs = {}
|
||||
local defaultTime
|
||||
local callback
|
||||
local hours = {}
|
||||
local minutes = {}
|
||||
local seconds = {}
|
||||
local hh, mm, ss
|
||||
local firstCell
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function CLLPPopTime.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
table.insert(hours, joinStr(NumEx.nStrForLen(23, 2), "点"))
|
||||
for i = 0, 22 do
|
||||
table.insert(hours, joinStr(NumEx.nStrForLen(i, 2), "点"))
|
||||
end
|
||||
|
||||
table.insert(minutes, joinStr(NumEx.nStrForLen(59, 2), "分"))
|
||||
table.insert(seconds, joinStr(NumEx.nStrForLen(59, 2), "秒"))
|
||||
for i = 0, 58 do
|
||||
table.insert(minutes, joinStr(NumEx.nStrForLen(i, 2), "分"))
|
||||
table.insert(seconds, joinStr(NumEx.nStrForLen(i, 2), "秒"))
|
||||
end
|
||||
---@type UISprite
|
||||
uiobjs.SpriteBg = getCC(transform, "Bottom/offset/SpriteBg", "UISprite")
|
||||
local offset = getChild(transform, "Bottom/offset")
|
||||
---@type Coolape.CLUILoopGrid
|
||||
uiobjs.listGridHH = getCC(offset, "ListHH/Content/Grid", "CLUILoopGrid")
|
||||
uiobjs.centerOnChildHH = uiobjs.listGridHH:GetComponent("UICenterOnChild")
|
||||
---@type Coolape.CLUILoopGrid
|
||||
uiobjs.listGridMM = getCC(offset, "ListMM/Content/Grid", "CLUILoopGrid")
|
||||
uiobjs.centerOnChildMM = uiobjs.listGridMM:GetComponent("UICenterOnChild")
|
||||
---@type Coolape.CLUILoopGrid
|
||||
uiobjs.listGridSS = getCC(offset, "ListSS/Content/Grid", "CLUILoopGrid")
|
||||
uiobjs.centerOnChildSS = uiobjs.listGridSS:GetComponent("UICenterOnChild")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function CLLPPopTime.setData(paras)
|
||||
callback = MapEx.getObject(paras, "callback")
|
||||
defaultTime = MapEx.getString(paras, "time")
|
||||
defaultTime = isNilOrEmpty(defaultTime) and DateEx.toHHMMSS(DateEx.nowMS) or defaultTime
|
||||
local strs = strSplit(defaultTime, ":")
|
||||
hh = strs[1]
|
||||
mm = strs[2]
|
||||
ss = strs[3]
|
||||
end
|
||||
|
||||
--当有通用背板显示时的回调
|
||||
function CLLPPopTime.onShowFrame()
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function CLLPPopTime.show()
|
||||
firstCell = nil
|
||||
uiobjs.listGridHH:setList(hours, CLLPPopTime.initCellHour, CLLPPopTime.onHeadHour, CLLPPopTime.onEndHour)
|
||||
uiobjs.centerOnChildHH:Recenter()
|
||||
-- uiobjs.centerOnChildHH:CenterOn(firstCell.transform)
|
||||
firstCell = nil
|
||||
uiobjs.listGridMM:setList(minutes, CLLPPopTime.initCellMinute, CLLPPopTime.onHeadMinute, CLLPPopTime.onEndMinute)
|
||||
uiobjs.centerOnChildMM:Recenter()
|
||||
-- uiobjs.centerOnChildMM:CenterOn(firstCell.transform)
|
||||
firstCell = nil
|
||||
uiobjs.listGridSS:setList(seconds, CLLPPopTime.initCellSec, CLLPPopTime.onHeadSec, CLLPPopTime.onEndSec)
|
||||
uiobjs.centerOnChildSS:Recenter()
|
||||
-- uiobjs.centerOnChildSS:CenterOn(firstCell.transform)
|
||||
end
|
||||
function CLLPPopTime.initCellHour(cell, data)
|
||||
cell:init(data, nil)
|
||||
cell.luaTable.setCenterObj(uiobjs.centerOnChildHH)
|
||||
if firstCell == nil then
|
||||
firstCell = cell
|
||||
end
|
||||
end
|
||||
function CLLPPopTime.onHeadHour(head)
|
||||
uiobjs.listGridHH:insertList(hours)
|
||||
end
|
||||
function CLLPPopTime.onEndHour(tail)
|
||||
uiobjs.listGridHH:appendList(hours)
|
||||
end
|
||||
|
||||
function CLLPPopTime.initCellMinute(cell, data)
|
||||
cell:init(data, nil)
|
||||
cell.luaTable.setCenterObj(uiobjs.centerOnChildMM)
|
||||
if firstCell == nil then
|
||||
firstCell = cell
|
||||
end
|
||||
end
|
||||
function CLLPPopTime.onHeadMinute(head)
|
||||
uiobjs.listGridMM:insertList(minutes)
|
||||
end
|
||||
function CLLPPopTime.onEndMinute(tail)
|
||||
uiobjs.listGridMM:appendList(minutes)
|
||||
end
|
||||
|
||||
function CLLPPopTime.initCellSec(cell, data)
|
||||
cell:init(data, nil)
|
||||
cell.luaTable.setCenterObj(uiobjs.centerOnChildSS)
|
||||
if firstCell == nil then
|
||||
firstCell = cell
|
||||
end
|
||||
end
|
||||
function CLLPPopTime.onHeadSec(head)
|
||||
uiobjs.listGridSS:insertList(seconds)
|
||||
end
|
||||
function CLLPPopTime.onEndSec(tail)
|
||||
uiobjs.listGridSS:appendList(seconds)
|
||||
end
|
||||
|
||||
function CLLPPopTime.onStartCenterOnChild(scrollview)
|
||||
end
|
||||
|
||||
function CLLPPopTime.onCenterChild(center, scrollview)
|
||||
---@type Coolape.CLUILoopGrid
|
||||
local grid = getCC(scrollview.transform, "Grid", "CLUILoopGrid")
|
||||
grid:refreshContentOnly()
|
||||
end
|
||||
|
||||
function CLLPPopTime.onFinishCenterChild(scrollview)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function CLLPPopTime.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function CLLPPopTime.hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function CLLPPopTime.procNetwork(cmd, succ, msg, paras)
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function CLLPPopTime.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if goName == "ButtonClose" then
|
||||
hideTopPanel(csSelf)
|
||||
elseif goName == "ButtonOkay" then
|
||||
local cell = uiobjs.centerOnChildHH.centeredObject:GetComponent("CLCellLua")
|
||||
local hh = cell.luaTable.getData()
|
||||
hh = string.gsub(hh, "点", "")
|
||||
cell = uiobjs.centerOnChildMM.centeredObject:GetComponent("CLCellLua")
|
||||
local mm = cell.luaTable.getData()
|
||||
mm = string.gsub(mm, "分", "")
|
||||
cell = uiobjs.centerOnChildSS.centeredObject:GetComponent("CLCellLua")
|
||||
local ss = cell.luaTable.getData()
|
||||
ss = string.gsub(ss, "秒", "")
|
||||
hideTopPanel(csSelf)
|
||||
Utl.doCallback(callback, joinStr(hh, ":", mm, ":", ss))
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function CLLPPopTime.onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function CLLPPopTime.hideSelfOnKeyBack()
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return CLLPPopTime
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e30ca31b514448f4966eb300b3a5191
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPBindPhone:TRBasePanel
|
||||
local TRPBindPhone = class("TRPBindPhone", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPBindPhone:init(csObj)
|
||||
TRPBindPhone.super.init(self, csObj)
|
||||
uiobjs.content = getChild(self.transform, "PanelContent")
|
||||
MyUtl.setContentView(uiobjs.content)
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
uiobjs.formRoot = getCC(uiobjs.scrollview.transform, "Table", "CLUIFormRoot")
|
||||
self:setEventDelegate()
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPBindPhone
|
||||
function TRPBindPhone:setData(paras)
|
||||
self.mdata = paras
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPBindPhone:show()
|
||||
uiobjs.formRoot:setValue(self.mdata)
|
||||
uiobjs.scrollview:ResetPosition()
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPBindPhone:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPBindPhone:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPBindPhone:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPBindPhone:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonModify = function()
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = self.mdata.phone, isBindPhone = true})
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPBindPhone:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPBindPhone:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPBindPhone
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59cc4c59a26144c999f66447094be492
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,140 @@
|
||||
---@class _ParamPCustFilter
|
||||
---@field title
|
||||
---@field callback
|
||||
---@field defautFilter table
|
||||
---@field queryKey
|
||||
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPComFilter:TRBasePanel 邮件列表
|
||||
local TRPComFilter = class("TRPComFilter", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPComFilter:init(csObj)
|
||||
TRPComFilter.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 50, 190)
|
||||
---@type UIScrollView
|
||||
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
uiobjs.Table = getCC(self.transform, "PanelContent/Grid", "UITable")
|
||||
uiobjs.prefab = getChild(uiobjs.Table.transform, "00000").gameObject
|
||||
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
|
||||
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
|
||||
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPComFilter
|
||||
function TRPComFilter:setData(paras)
|
||||
---@type _ParamPCustFilter
|
||||
self.mdata = paras
|
||||
|
||||
if self.mdata.defautFilter then
|
||||
self.list = self.mdata.defautFilter
|
||||
end
|
||||
end
|
||||
|
||||
---public 当有通用背板显示时的回调
|
||||
---@param cs Coolape.CLPanelLua
|
||||
function TRPComFilter:onShowFrame(cs)
|
||||
if cs.frameObj then
|
||||
---@type _BGFrame1Param
|
||||
local d = {}
|
||||
-- d.title = LGet(cs.titleKeyName)
|
||||
d.title = self.mdata.title
|
||||
d.panel = cs
|
||||
cs.frameObj:init(d)
|
||||
end
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPComFilter:show()
|
||||
uiobjs.InputSeachKey.value = self.mdata.queryKey
|
||||
self:refreshFilterBtnStatus()
|
||||
CLUIUtl.resetList4Lua(uiobjs.Table, uiobjs.prefab, self.list, self:wrapFunc(self.initCell))
|
||||
end
|
||||
|
||||
function TRPComFilter:initCell(cell, data)
|
||||
data.panel = self
|
||||
cell:init(data, nil)
|
||||
end
|
||||
|
||||
function TRPComFilter: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 TRPComFilter:hadFilterVal()
|
||||
for i,v in ipairs(self.list) do
|
||||
for j, f in ipairs(v.list) do
|
||||
if f.selected then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPComFilter:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPComFilter:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPComFilter:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
function TRPComFilter:reset()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
for i,v in ipairs(self.list) do
|
||||
for j, f in ipairs(v.list) do
|
||||
f.selected = false
|
||||
end
|
||||
end
|
||||
CLUIUtl.resetList4Lua(uiobjs.Table, uiobjs.prefab, self.list, self:wrapFunc(self.initCell))
|
||||
self:refreshFilterBtnStatus()
|
||||
end
|
||||
|
||||
function TRPComFilter:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonReset = function()
|
||||
self:reset()
|
||||
end,
|
||||
ButtonOkay = function()
|
||||
Utl.doCallback(self.mdata.callback, self.list, uiobjs.InputSeachKey.value)
|
||||
hideTopPanel(self.csSelf)
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPComFilter:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPComFilter:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPComFilter
|
||||
@@ -30,7 +30,7 @@ function TRPConnect.show()
|
||||
local phone = Prefs.getUserName()
|
||||
local currGroup = Prefs.getCurrGroup(Prefs.getUserName())
|
||||
companyInfro = json.decode(currGroup)
|
||||
DBUser.onGetUsers(companyInfro.loginNoList) -- 缓存工号相关信息
|
||||
DBUser.onGetUsers(companyInfro.loginNoList, companyInfro.groupInfoList) -- 缓存工号相关信息
|
||||
NetProto.socketInit(companyInfro.company_id, companyInfro.login_no, companyInfro.group_id)
|
||||
end
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ function TRPCustDetail:init(csObj)
|
||||
uiobjs.ButtonEndListOrder = getChild(uiobjs.OrderRoot.transform, "ButtonEndList")
|
||||
|
||||
uiobjs.MoreRoot = getCC(uiobjs.Table.transform, "MoreRoot", "CLCellLua")
|
||||
uiobjs.SysRoot = getCC(uiobjs.Table.transform, "SysRoot", "CLCellLua")
|
||||
end
|
||||
|
||||
function TRPCustDetail:prepareMoreData()
|
||||
@@ -95,6 +96,69 @@ function TRPCustDetail:prepareMoreData()
|
||||
attr.height = 180
|
||||
attr.donotJoinKey = true
|
||||
table.insert(self.moreProcList, attr)
|
||||
--------------------------------------------
|
||||
|
||||
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
|
||||
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)
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
@@ -134,7 +198,7 @@ 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()
|
||||
local poplist = DBUser.getPopList(DBUser.FilterGroup.user)
|
||||
uiobjs.InputLogin:refreshItems(poplist.options, poplist.values)
|
||||
uiobjs.LabelLoginNo:refreshItems(poplist.options, poplist.values)
|
||||
-- 设置星级
|
||||
@@ -165,6 +229,7 @@ function TRPCustDetail:showDetail()
|
||||
self:release()
|
||||
SetActive(uiobjs.DetailRoot.gameObject, true)
|
||||
SetActive(uiobjs.ExtendRoot.gameObject, true)
|
||||
SetActive(uiobjs.SysRoot.gameObject, true)
|
||||
SetActive(uiobjs.OrderRoot.gameObject, false)
|
||||
SetActive(uiobjs.Records.gameObject, false)
|
||||
SetActive(uiobjs.MoreRoot.gameObject, false)
|
||||
@@ -172,6 +237,7 @@ function TRPCustDetail:showDetail()
|
||||
|
||||
-- uiobjs.ExtendRoot:init({data = self.mdata, isEditMode = false}, nil)
|
||||
self:showExtentFiles(self.mdata.taskId)
|
||||
self:showSysFiles()
|
||||
|
||||
-- 设置星级
|
||||
local stars = {}
|
||||
@@ -186,6 +252,12 @@ function TRPCustDetail:showDetail()
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
function TRPCustDetail:reposition()
|
||||
uiobjs.Table:Reposition()
|
||||
uiobjs.scrollView.disableDragIfFits = true
|
||||
uiobjs.scrollView:ResetPosition()
|
||||
end
|
||||
|
||||
---public 显示扩展字段
|
||||
function TRPCustDetail:showExtentFiles(taskId)
|
||||
---@type _ParamCellExtendFiledRoot
|
||||
@@ -199,16 +271,36 @@ function TRPCustDetail:showExtentFiles(taskId)
|
||||
for i, v in ipairs(fields) do
|
||||
filedInfor = {}
|
||||
filedInfor.attr = v
|
||||
filedInfor.isEditMode = false
|
||||
filedInfor.showMode = _FieldMode.showOnly
|
||||
table.insert(param.fields, filedInfor)
|
||||
end
|
||||
uiobjs.ExtendRoot:init(param, nil)
|
||||
end
|
||||
|
||||
---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
|
||||
|
||||
function TRPCustDetail:showRecords()
|
||||
self:release()
|
||||
SetActive(uiobjs.DetailRoot.gameObject, false)
|
||||
SetActive(uiobjs.ExtendRoot.gameObject, false)
|
||||
SetActive(uiobjs.SysRoot.gameObject, false)
|
||||
SetActive(uiobjs.OrderRoot.gameObject, false)
|
||||
SetActive(uiobjs.Records.gameObject, true)
|
||||
SetActive(uiobjs.MoreRoot.gameObject, false)
|
||||
@@ -254,6 +346,7 @@ function TRPCustDetail:showOrders()
|
||||
self:release()
|
||||
SetActive(uiobjs.DetailRoot.gameObject, false)
|
||||
SetActive(uiobjs.ExtendRoot.gameObject, false)
|
||||
SetActive(uiobjs.SysRoot.gameObject, false)
|
||||
SetActive(uiobjs.Records.gameObject, false)
|
||||
SetActive(uiobjs.OrderRoot.gameObject, true)
|
||||
SetActive(uiobjs.MoreRoot.gameObject, false)
|
||||
@@ -300,6 +393,7 @@ function TRPCustDetail:showMore()
|
||||
self:release()
|
||||
SetActive(uiobjs.DetailRoot.gameObject, false)
|
||||
SetActive(uiobjs.ExtendRoot.gameObject, false)
|
||||
SetActive(uiobjs.SysRoot.gameObject, false)
|
||||
SetActive(uiobjs.Records.gameObject, false)
|
||||
SetActive(uiobjs.OrderRoot.gameObject, false)
|
||||
SetActive(uiobjs.MoreRoot.gameObject, true)
|
||||
|
||||
@@ -8,6 +8,7 @@ local uiobjs = {}
|
||||
function TRPCustList:init(csObj)
|
||||
TRPCustList.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
self:initFilters()
|
||||
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")
|
||||
@@ -26,6 +27,59 @@ function TRPCustList:init(csObj)
|
||||
uiobjs.ButtonHeadList = getChild(uiobjs.Grid.transform, "ButtonHeadList")
|
||||
end
|
||||
|
||||
function TRPCustList:initFilters()
|
||||
self.filters = {}
|
||||
local d = {}
|
||||
d.title = "归属工号"
|
||||
d.key = DBCust.FilterGroup.loginNoList
|
||||
d.key2 = "loginNos"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.loginNoList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "任务名称"
|
||||
d.key = DBCust.FilterGroup.taskList
|
||||
d.key2 = "taskId"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.taskList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户来源"
|
||||
d.key = DBCust.FilterGroup.custFromList
|
||||
d.key2 = "custFrom"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.custFromList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户状态"
|
||||
d.key = DBCust.FilterGroup.dealFlagList
|
||||
d.key2 = "dealFlag"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.dealFlagList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户类型"
|
||||
d.key = DBCust.FilterGroup.custTypeList
|
||||
d.key2 = "custType"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.custTypeList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCustList
|
||||
function TRPCustList:setData(paras)
|
||||
@@ -35,6 +89,7 @@ end
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCustList:show()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
self:resetFilters()
|
||||
self:refreshFilterBtnStatus()
|
||||
self:showList({})
|
||||
showHotWheel()
|
||||
@@ -158,9 +213,10 @@ function TRPCustList:setEventDelegate()
|
||||
end,
|
||||
ButtonFilter = function()
|
||||
getPanelAsy(
|
||||
"PanelCustFilter",
|
||||
"PanelComFilter",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
title = "客户筛选",
|
||||
callback = self:wrapFunc(self.onSetFilter),
|
||||
queryKey = uiobjs.InputSeachKey.value,
|
||||
defautFilter = self.filters
|
||||
@@ -174,6 +230,12 @@ function TRPCustList:setEventDelegate()
|
||||
}
|
||||
end
|
||||
|
||||
function TRPCustList:resetFilters()
|
||||
for i, v in ipairs(self.filters) do
|
||||
v.selected = false
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustList:getFilterStr()
|
||||
if not self.filters then
|
||||
return ""
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
---@type IDBasePanel
|
||||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||||
---@class TRPCustFilter:TRBasePanel 邮件列表
|
||||
local TRPCustFilter = class("TRPCustFilter", TRBasePanel)
|
||||
---@class TRPFollowFilter:TRBasePanel
|
||||
local TRPFollowFilter = class("TRPFollowFilter", TRBasePanel)
|
||||
|
||||
local uiobjs = {}
|
||||
-- 初始化,只会调用一次
|
||||
function TRPCustFilter:init(csObj)
|
||||
TRPCustFilter.super.init(self, csObj)
|
||||
function TRPFollowFilter:init(csObj)
|
||||
TRPFollowFilter.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
|
||||
MyUtl.setContentView(getChild(self.transform, "PanelContent"), 132 + 132 + 50, 190)
|
||||
@@ -20,13 +20,14 @@ function TRPCustFilter:init(csObj)
|
||||
uiobjs.Table = getCC(self.transform, "PanelContent/Grid", "UITable")
|
||||
uiobjs.prefab = getChild(uiobjs.Table.transform, "00000").gameObject
|
||||
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
|
||||
uiobjs.InputDate = getCC(uiobjs.Table.transform, "DateRang/InputDate", "CLUIElement")
|
||||
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
|
||||
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPCustFilter
|
||||
function TRPCustFilter:setData(paras)
|
||||
---@param paras _ParamTRPFollowFilter
|
||||
function TRPFollowFilter:setData(paras)
|
||||
---@type _ParamPCustFilter
|
||||
self.mdata = paras
|
||||
|
||||
@@ -35,51 +36,33 @@ function TRPCustFilter:setData(paras)
|
||||
else
|
||||
self.list = {}
|
||||
local d = {}
|
||||
d.title = "归属工号"
|
||||
d.key = DBCust.FilterGroup.loginNoList
|
||||
|
||||
d = {}
|
||||
d.title = "跟进类型"
|
||||
d.key = DBCust.FilterGroup.followUpTypeList
|
||||
d.key2 = "followTypeUp"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.followUpTypeList)
|
||||
if d.list and #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "商机"
|
||||
d.key = DBCust.FilterGroup.opportunityList
|
||||
d.key2 = "opportunity"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.opportunityList)
|
||||
if d.list and #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "跟进人员"
|
||||
d.key = "loginNos"
|
||||
d.key2 = "loginNos"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.loginNoList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "任务名称"
|
||||
d.key = DBCust.FilterGroup.taskList
|
||||
d.key2 = "taskId"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.taskList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户来源"
|
||||
d.key = DBCust.FilterGroup.custFromList
|
||||
d.key2 = "custFrom"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.custFromList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户状态"
|
||||
d.key = DBCust.FilterGroup.dealFlagList
|
||||
d.key2 = "dealFlag"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.dealFlagList)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "客户类型"
|
||||
d.key = DBCust.FilterGroup.custTypeList
|
||||
d.key2 = "custType"
|
||||
d.list = DBCust.getFilter(DBCust.FilterGroup.custTypeList)
|
||||
if #(d.list) > 0 then
|
||||
d.list = DBUser.getFilters(DBUser.FilterGroup.user)
|
||||
if d.list and #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.list, d)
|
||||
end
|
||||
@@ -87,18 +70,19 @@ function TRPCustFilter:setData(paras)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPCustFilter:show()
|
||||
function TRPFollowFilter:show()
|
||||
uiobjs.InputSeachKey.value = self.mdata.queryKey
|
||||
uiobjs.InputDate.value = self.mdata.defaultTimeRange
|
||||
self:refreshFilterBtnStatus()
|
||||
CLUIUtl.resetList4Lua(uiobjs.Table, uiobjs.prefab, self.list, self:wrapFunc(self.initCell))
|
||||
end
|
||||
|
||||
function TRPCustFilter:initCell(cell, data)
|
||||
function TRPFollowFilter:initCell(cell, data)
|
||||
data.panel = self
|
||||
cell:init(data, nil)
|
||||
end
|
||||
|
||||
function TRPCustFilter:refreshFilterBtnStatus()
|
||||
function TRPFollowFilter:refreshFilterBtnStatus()
|
||||
if self:hadFilterVal() then
|
||||
uiobjs.ButtonFilterLb.color = ColorEx.getColor(0xff2990dc)
|
||||
uiobjs.ButtonFilterSp.color = ColorEx.getColor(0xff2990dc)
|
||||
@@ -110,27 +94,30 @@ function TRPCustFilter:refreshFilterBtnStatus()
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustFilter:hadFilterVal()
|
||||
for i,v in ipairs(self.list) do
|
||||
function TRPFollowFilter:hadFilterVal()
|
||||
for i, v in ipairs(self.list) do
|
||||
for j, f in ipairs(v.list) do
|
||||
if f.selected then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
if not isNilOrEmpty(uiobjs.InputDate.value) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPCustFilter:refresh()
|
||||
function TRPFollowFilter:refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPCustFilter:hide()
|
||||
function TRPFollowFilter:hide()
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPCustFilter:procNetwork(cmd, succ, msg, paras)
|
||||
function TRPFollowFilter:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
@@ -139,9 +126,10 @@ function TRPCustFilter:procNetwork(cmd, succ, msg, paras)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPCustFilter:reset()
|
||||
function TRPFollowFilter:reset()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
for i,v in ipairs(self.list) do
|
||||
uiobjs.InputDate.value = ""
|
||||
for i, v in ipairs(self.list) do
|
||||
for j, f in ipairs(v.list) do
|
||||
f.selected = false
|
||||
end
|
||||
@@ -150,19 +138,31 @@ function TRPCustFilter:reset()
|
||||
self:refreshFilterBtnStatus()
|
||||
end
|
||||
|
||||
function TRPCustFilter:setEventDelegate()
|
||||
function TRPFollowFilter:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonReset = function()
|
||||
self:reset()
|
||||
end,
|
||||
ButtonOkay = function()
|
||||
Utl.doCallback(self.mdata.callback, self.list, uiobjs.InputSeachKey.value)
|
||||
local startDate, endDate
|
||||
if not isNilOrEmpty(uiobjs.InputDate) then
|
||||
local strs = strSplit(uiobjs.InputDate.value, "~")
|
||||
startDate = strs[1]
|
||||
endDate = strs[2]
|
||||
end
|
||||
Utl.doCallback(self.mdata.callback, self.list, uiobjs.InputSeachKey.value, startDate, endDate)
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonResetDate = function()
|
||||
uiobjs.InputDate.value = ""
|
||||
end,
|
||||
InputDate = function()
|
||||
self:refreshFilterBtnStatus()
|
||||
end
|
||||
}
|
||||
end
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPCustFilter:uiEventDelegate(go)
|
||||
function TRPFollowFilter:uiEventDelegate(go)
|
||||
local func = self.EventDelegate[go.name]
|
||||
if func then
|
||||
func()
|
||||
@@ -170,8 +170,8 @@ function TRPCustFilter:uiEventDelegate(go)
|
||||
end
|
||||
|
||||
-- 当顶层页面发生变化时回调
|
||||
function TRPCustFilter:onTopPanelChange(topPanel)
|
||||
function TRPFollowFilter:onTopPanelChange(topPanel)
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPCustFilter
|
||||
return TRPFollowFilter
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab45f16b9152c4843b3b6b6ea7f1dd42
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -120,6 +120,9 @@ function TRPFollowList:hadFilterVal()
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.startTime then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
-- 刷新
|
||||
@@ -151,12 +154,13 @@ function TRPFollowList:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonFilter = function()
|
||||
getPanelAsy(
|
||||
"PanelCustFilter",
|
||||
"PanelFollowFilter",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
callback = self:wrapFunc(self.onSetFilter),
|
||||
queryKey = uiobjs.InputSeachKey.value,
|
||||
defautFilter = self.filters
|
||||
defautFilter = self.filters,
|
||||
defaultTimeRange = self.startTime and joinStr(self.startTime, "~", self.endTime) or ""
|
||||
}
|
||||
)
|
||||
end,
|
||||
@@ -176,18 +180,29 @@ function TRPFollowList:getFilterStr()
|
||||
local list = {}
|
||||
for j, f in ipairs(g.list) do
|
||||
if f.selected and f.value ~= -1 then
|
||||
table.insert(list, f.value)
|
||||
if g.key == DBCust.FilterGroup.opportunityList or g.key == DBCust.FilterGroup.followUpTypeList then
|
||||
table.insert(list, f.name)
|
||||
else
|
||||
table.insert(list, f.value)
|
||||
end
|
||||
end
|
||||
end
|
||||
ret[g.key2] = table.concat(list, ",")
|
||||
end
|
||||
|
||||
if self.startTime then
|
||||
ret.startTime = self.startTime
|
||||
ret.endTime = self.endTime
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
function TRPFollowList:onSetFilter(filters, queryKey)
|
||||
function TRPFollowList:onSetFilter(filters, queryKey, startTime, endTime)
|
||||
local oldqueryKey = uiobjs.InputSeachKey.value
|
||||
uiobjs.InputSeachKey.value = queryKey
|
||||
self.filters = filters
|
||||
self.startTime = startTime
|
||||
self.endTime = endTime
|
||||
self:refreshFilterBtnStatus()
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
queryKey = trim(queryKey)
|
||||
|
||||
@@ -81,11 +81,12 @@ function TRPMyInfor:initFiledsAttr()
|
||||
|
||||
attr = {}
|
||||
attr.attrName = "手机"
|
||||
attr.id = ""
|
||||
attr.id = "phoneNo"
|
||||
attr.attrType = DBCust.FieldType.text
|
||||
attr.ifMust = 0
|
||||
attr.cannotEdit = true
|
||||
attr.donotJoinKey = true
|
||||
attr.defaultText = "未绑定"
|
||||
table.insert(self.baseFiledsAttr, attr)
|
||||
|
||||
attr = {}
|
||||
@@ -108,6 +109,7 @@ function TRPMyInfor:setData(paras)
|
||||
local user = DBUser.getUserById(companyInfro.login_no)
|
||||
self.mdata.company_id = companyInfro.company_id
|
||||
self.mdata.company_name = companyInfro.company_name
|
||||
self.mdata.phoneNo = Prefs.getUserName()
|
||||
if user then
|
||||
self.mdata.loginNo = user.loginNo
|
||||
self.mdata.loginName = user.loginName
|
||||
@@ -155,23 +157,31 @@ 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)
|
||||
}
|
||||
)
|
||||
if el.jsonKey == "phoneNo" then
|
||||
if isNilOrEmpty(self.mdata.phoneNo) then
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = self.mdata.phoneNo, isBindPhone = true})
|
||||
else
|
||||
getPanelAsy("PanelBindPhone", onLoadedPanelTT, {phoneNo = self.mdata.phoneNo})
|
||||
end
|
||||
else
|
||||
getPanelAsy(
|
||||
"PanelModifyFiled",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
label = el.labeName.text,
|
||||
key = el.jsonKey,
|
||||
value = el.value,
|
||||
canNull = el.canNull,
|
||||
callback = self:wrapFunc(self.onFinishSetField)
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPMyInfor:onFinishSetField(key, val)
|
||||
if tostring(val) ~= tostring(self.mdata[key]) then
|
||||
-- self:sendModifymsg(key, val, true)
|
||||
--//TODO:
|
||||
-- self:sendModifymsg(key, val, true)
|
||||
MyUtl.toastW("TODO:修改数据")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ local uiobjs = {}
|
||||
function TRPOrderList:init(csObj)
|
||||
TRPOrderList.super.init(self, csObj)
|
||||
self:setEventDelegate()
|
||||
self:initFilters()
|
||||
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")
|
||||
@@ -26,6 +27,65 @@ function TRPOrderList:init(csObj)
|
||||
uiobjs.ButtonHeadList = getChild(uiobjs.Grid.transform, "ButtonHeadList")
|
||||
end
|
||||
|
||||
function TRPOrderList:initFilters()
|
||||
self.filters = {}
|
||||
local d = {}
|
||||
d.title = "订单分类"
|
||||
d.key = DBOrder.PopListGroup.orderType
|
||||
d.key2 = "myWfType"
|
||||
d.list = DBOrder.getFilter(DBOrder.PopListGroup.orderType)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "订单状态"
|
||||
d.key = DBOrder.PopListGroup.orderStatus
|
||||
d.key2 = "status"
|
||||
d.list = DBOrder.getFilter(DBOrder.PopListGroup.orderStatus)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "回款订单"
|
||||
d.key = DBOrder.PopListGroup.payOrderStatus
|
||||
d.key2 = "payStatus"
|
||||
d.list = DBOrder.getFilter(DBOrder.PopListGroup.payOrderStatus)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "跟进人员"
|
||||
d.key = "loginNos"
|
||||
d.key2 = "createLoginNo"
|
||||
d.list = DBUser.getFilters(DBUser.FilterGroup.user)
|
||||
if d.list and #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
|
||||
d = {}
|
||||
d.title = "所属部门"
|
||||
d.key = DBUser.FilterGroup.group
|
||||
d.key2 = "groupId"
|
||||
d.list = DBUser.getFilters(DBUser.FilterGroup.group)
|
||||
if #(d.list) > 0 then
|
||||
-- table.insert(d.list, 1, {name = "全部", value = -1})
|
||||
table.insert(self.filters, d)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPOrderList:resetFilters()
|
||||
for i, v in ipairs(self.filters) do
|
||||
v.selected = false
|
||||
end
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
---@param paras _ParamTRPOrderList
|
||||
function TRPOrderList:setData(paras)
|
||||
@@ -35,10 +95,11 @@ end
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPOrderList:show()
|
||||
uiobjs.InputSeachKey.value = ""
|
||||
self:resetFilters()
|
||||
self:refreshFilterBtnStatus()
|
||||
self:showList({})
|
||||
showHotWheel()
|
||||
NetProto.send.list_customers(self.filterValue, "", 1)
|
||||
NetProto.send.workFlowQuery(self.filterValue, "", 1)
|
||||
end
|
||||
|
||||
function TRPOrderList:showList(list)
|
||||
@@ -70,7 +131,7 @@ end
|
||||
function TRPOrderList:refreshList()
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
showHotWheel()
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
NetProto.send.workFlowQuery(self.filterValue, queryKey, 1)
|
||||
end
|
||||
|
||||
function TRPOrderList:onHeadList(head)
|
||||
@@ -85,7 +146,7 @@ function TRPOrderList:onEndList(tail)
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
showHotWheel()
|
||||
-- 取得下一页
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, self.pageInfo.current_page + 1)
|
||||
NetProto.send.workFlowQuery(self.filterValue, queryKey, self.pageInfo.current_page + 1)
|
||||
else
|
||||
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -235
|
||||
SetActive(uiobjs.ButtonEndList.gameObject, true)
|
||||
@@ -97,7 +158,7 @@ function TRPOrderList:initCell(cell, data)
|
||||
end
|
||||
|
||||
function TRPOrderList:onClickCell(cell, data)
|
||||
getPanelAsy("PanelCustDetail", onLoadedPanelTT, data)
|
||||
-- getPanelAsy("PanelCustDetail", onLoadedPanelTT, data)
|
||||
end
|
||||
|
||||
function TRPOrderList:refreshFilterBtnStatus()
|
||||
@@ -134,7 +195,7 @@ end
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPOrderList:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
if cmd == NetProto.cmds.list_customers then
|
||||
if cmd == NetProto.cmds.workFlowQuery then
|
||||
local result = paras.result or {}
|
||||
self.pageInfo = result.meta
|
||||
if self.pageInfo and self.pageInfo.current_page > 1 then
|
||||
@@ -153,14 +214,12 @@ end
|
||||
|
||||
function TRPOrderList:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonAddCust = function()
|
||||
getPanelAsy("PanelNewCust", onLoadedPanelTT)
|
||||
end,
|
||||
ButtonFilter = function()
|
||||
getPanelAsy(
|
||||
"PanelCustFilter",
|
||||
"PanelComFilter",
|
||||
onLoadedPanelTT,
|
||||
{
|
||||
title="订单筛选",
|
||||
callback = self:wrapFunc(self.onSetFilter),
|
||||
queryKey = uiobjs.InputSeachKey.value,
|
||||
defautFilter = self.filters
|
||||
@@ -169,7 +228,7 @@ function TRPOrderList:setEventDelegate()
|
||||
end,
|
||||
InputSeachKey = function()
|
||||
local queryKey = uiobjs.InputSeachKey.value
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
NetProto.send.workFlowQuery(self.filterValue, queryKey, 1)
|
||||
end
|
||||
}
|
||||
end
|
||||
@@ -201,7 +260,7 @@ function TRPOrderList:onSetFilter(filters, queryKey)
|
||||
showHotWheel()
|
||||
self.filterValue = self:getFilterStr()
|
||||
if oldqueryKey == queryKey then
|
||||
NetProto.send.list_customers(self.filterValue, queryKey, 1)
|
||||
NetProto.send.workFlowQuery(self.filterValue, queryKey, 1)
|
||||
else
|
||||
-- 会触发input的onChange事件
|
||||
end
|
||||
|
||||
@@ -27,6 +27,8 @@ function TRPResetPasswordStep1:onShowFrame(cs)
|
||||
local d = {}
|
||||
if self.mData.isModify then
|
||||
d.title = "重置密码"
|
||||
elseif self.mData.isBindPhone then
|
||||
d.title = "绑定手机号"
|
||||
else
|
||||
d.title = "寻找密码"
|
||||
end
|
||||
@@ -62,11 +64,13 @@ function TRPResetPasswordStep1:setEventDelegate()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonRight = function()
|
||||
if not isNilOrEmpty(uiobjs.formRoot:checkValid()) then
|
||||
local err = uiobjs.formRoot:checkValid()
|
||||
if not isNilOrEmpty(err) then
|
||||
MyUtl.toastW(err)
|
||||
return
|
||||
end
|
||||
|
||||
local d = uiobjs.formRoot:getValue(true)
|
||||
local d = uiobjs.formRoot:getValue(self.mData, true)
|
||||
NetProto.sendVerMsg(
|
||||
d,
|
||||
function(data, orgs)
|
||||
|
||||
@@ -28,6 +28,8 @@ function TRPResetPasswordStep2:onShowFrame(cs)
|
||||
local d = {}
|
||||
if self.mData.isModify then
|
||||
d.title = "重置密码"
|
||||
elseif self.mData.isBindPhone then
|
||||
d.title = "绑定手机号"
|
||||
else
|
||||
d.title = "寻找密码"
|
||||
end
|
||||
@@ -89,12 +91,19 @@ function TRPResetPasswordStep2:setEventDelegate()
|
||||
hideTopPanel(self.csSelf)
|
||||
end,
|
||||
ButtonRight = function()
|
||||
if not isNilOrEmpty(uiobjs.formRoot:checkValid()) then
|
||||
local err = uiobjs.formRoot:checkValid()
|
||||
if not isNilOrEmpty(err) then
|
||||
MyUtl.toastW(err)
|
||||
return
|
||||
end
|
||||
local data = uiobjs.formRoot:getValue(self.mData, true)
|
||||
data.isModify = self.mData.isModify
|
||||
getPanelAsy("PanelResetPasswordStep3", onLoadedPanelTT, data)
|
||||
if self.mData.isBindPhone then
|
||||
-- 绑定号码
|
||||
MyUtl.toastW("TODO:绑定号码")
|
||||
else
|
||||
local data = uiobjs.formRoot:getValue(self.mData, true)
|
||||
data.isModify = self.mData.isModify
|
||||
getPanelAsy("PanelResetPasswordStep3", onLoadedPanelTT, data)
|
||||
end
|
||||
end,
|
||||
ButtonReGetCode = function()
|
||||
if self.canReGetcode then
|
||||
|
||||
@@ -13,6 +13,7 @@ function TRPSetting:init(csObj)
|
||||
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
|
||||
self:setEventDelegate()
|
||||
uiobjs.LabelPhone = getCC(uiobjs.scrollview.transform, "Table/ButtonPhone/LabelPhone", "UILabel")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
@@ -24,6 +25,7 @@ end
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPSetting:show()
|
||||
uiobjs.scrollview:ResetPosition()
|
||||
uiobjs.LabelPhone.text = Prefs.getUserName() or "未绑定"
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
@@ -46,22 +48,33 @@ end
|
||||
|
||||
function TRPSetting:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonPersonInfor=function()
|
||||
ButtonPersonInfor = function()
|
||||
getPanelAsy("PanelMyInfor", onLoadedPanelTT)
|
||||
end,
|
||||
ButtonPassword = function()
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = Prefs.getUserName(), isModify = true})
|
||||
end,
|
||||
ButtonPhone = function()
|
||||
if isNilOrEmpty(Prefs.getUserName()) then
|
||||
getPanelAsy(
|
||||
"PanelResetPasswordStep1",
|
||||
onLoadedPanelTT,
|
||||
{phone = Prefs.getUserName(), isBindPhone = true}
|
||||
)
|
||||
else
|
||||
getPanelAsy("PanelBindPhone", onLoadedPanelTT, {phoneNo = Prefs.getUserName()})
|
||||
end
|
||||
end,
|
||||
ButtonLogout = function()
|
||||
MyUtl.confirm(
|
||||
"确定要退出当前账号?",
|
||||
function()
|
||||
Prefs.setCurrGroup(Prefs.getUserName(), "")
|
||||
Prefs.setUserPsd("")
|
||||
hideTopPanel(self.csSelf)
|
||||
hideTopPanel()
|
||||
hideTopPanel()
|
||||
getPanelAsy("PanelLogin", onLoadedPanel)
|
||||
function()
|
||||
Prefs.setCurrGroup(Prefs.getUserName(), "")
|
||||
Prefs.setUserPsd("")
|
||||
hideTopPanel(self.csSelf)
|
||||
hideTopPanel()
|
||||
hideTopPanel()
|
||||
getPanelAsy("PanelLogin", onLoadedPanel)
|
||||
end,
|
||||
"退出账号"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user