This commit is contained in:
2020-07-24 22:12:55 +08:00
parent 3f114a6fca
commit 67a1f974bf
117 changed files with 14258 additions and 2325 deletions

View File

@@ -3,7 +3,10 @@ local db = {}
DBOrder.PopListGroup = {
urgencyLevels = "urgencyLevels", -- 紧急程序
templateList = "templateList" -- 订单模板
templateList = "templateList", -- 订单模板
orderType = "orderType", -- 订单类别
orderStatus = "orderStatus", -- 订单状态
payOrderStatus = "payOrderStatus" -- 回款订单状态
}
DBOrder.onGetFilter = function(data)
@@ -41,13 +44,69 @@ DBOrder.onGetFilter = function(data)
end
end
end
local filterInfor = {}
table.insert(filterInfor, {name = "我的订单", value = "0"})
table.insert(filterInfor, {name = "我的草稿", value = "1"})
db.filters[DBOrder.PopListGroup.orderType] = filterInfor
local options = ArrayList()
local values = ArrayList()
for i, v in ipairs(filterInfor) do
options:Add(v.name)
values:Add(v.value)
end
db.filtersPopup[DBOrder.PopListGroup.orderType] = {
options = options,
values = values
}
filterInfor = {}
table.insert(filterInfor, {name = "草稿", value = "-1"})
table.insert(filterInfor, {name = "正常工单", value = "0"})
table.insert(filterInfor, {name = "回退工单", value = "1"})
table.insert(filterInfor, {name = "回退到创建人", value = "2"})
table.insert(filterInfor, {name = "正常关闭", value = "3"})
table.insert(filterInfor, {name = "未正常关闭", value = "4"})
db.filters[DBOrder.PopListGroup.orderStatus] = filterInfor
options = ArrayList()
values = ArrayList()
for i, v in ipairs(filterInfor) do
options:Add(v.name)
values:Add(v.value)
end
db.filtersPopup[DBOrder.PopListGroup.orderStatus] = {
options = options,
values = values
}
filterInfor = {}
table.insert(filterInfor, {name = "暂无回款", value = "0"})
table.insert(filterInfor, {name = "部分回款", value = "1"})
table.insert(filterInfor, {name = "全部回款", value = "2"})
db.filters[DBOrder.PopListGroup.payOrderStatus] = filterInfor
options = ArrayList()
values = ArrayList()
for i, v in ipairs(filterInfor) do
options:Add(v.name)
values:Add(v.value)
end
db.filtersPopup[DBOrder.PopListGroup.payOrderStatus] = {
options = options,
values = values
}
end
DBOrder.getFilter = function(popGroup)
if popGroup then
return db.filters[popGroup]
end
return db.filters
end
DBOrder.getPopupList = function(popGroup)
if popGroup then
return db.filtersPopup[popGroup]
end
return db.filters
return db.filtersPopup
end
DBOrder.getFields = function(templateId)

View File

@@ -9,22 +9,54 @@ local db = {}
local icons = {}
local poplist = {}
function DBUser.onGetUsers(list)
poplist.options = ArrayList()
poplist.values = ArrayList()
DBUser.FilterGroup = {
user = "user",
group = "group"
}
function DBUser.onGetUsers(list, groupList)
local options = ArrayList()
local values = ArrayList()
db.filters = {}
local name
db.filters[DBUser.FilterGroup.user] = {}
for i, v in ipairs(list) do
db[v.loginNo] = v
if v.loginName == "系统生成" then
poplist.options:Add(joinStr(v.loginNo, "_", v.loginName))
name = joinStr(v.loginNo, "_", v.loginName)
else
poplist.options:Add(joinStr(v.loginName))
name = joinStr(v.loginName)
end
poplist.values:Add(v.loginNo)
table.insert(db.filters[DBUser.FilterGroup.user], {name = name, value = v.loginNo})
db[v.loginNo] = v
options:Add(name)
values:Add(v.loginNo)
end
poplist[DBUser.FilterGroup.user] = {
options = options,
values = values
}
--------------------------------------------
local options = ArrayList()
local values = ArrayList()
db.filters[DBUser.FilterGroup.group] = {}
for i, v in ipairs(groupList) do
table.insert(db.filters[DBUser.FilterGroup.group], {name = v.name, value = v.id})
options:Add(v.name)
values:Add(v.id)
end
poplist[DBUser.FilterGroup.group] = {
options = options,
values = values
}
end
function DBUser.getPopList()
return poplist
function DBUser.getFilters(group)
return db.filters[group]
end
function DBUser.getPopList(group)
return poplist[group]
end
---@return _DBUser

View File

@@ -33,8 +33,8 @@ local wrapSendData = function(map)
map.sign = NetProto.sign
local dList = {}
for k, v in pairs(map) do
if (type(v) == "number" or type(v) == "string" or type(v) == "boolean") then
table.insert(dList, joinStr(k, "=", Uri.EscapeDataString(v or "")))
if v and (type(v) == "number" or type(v) == "string" or type(v) == "boolean") then
table.insert(dList, joinStr(k, "=", Uri.EscapeDataString(tostring(v))))
end
end
return table.concat(dList, "&")
@@ -242,7 +242,8 @@ NetProto.cmds = {
selectProductInfo = "selectProductInfo", -- 商品列表
createWfInfo = "createWfInfo", -- 创建订单
create_followUp_task = "create_followUp_task", -- 创建跟进预约
list_followUp_records = "list_followUp_records" -- 跟进记录
list_followUp_records = "list_followUp_records", -- 跟进记录
workFlowQuery = "workFlowQuery" -- 工单列表
}
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
@@ -585,5 +586,15 @@ NetProto.send.list_followUp_records = function(filters, queryKey, page, callback
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
NetProto.send.workFlowQuery = function(filters, queryKey, page, callback, timeOutSec)
local content = {}
content.action = NetProto.cmds.workFlowQuery
content.groupId = NetProto.groupId
content.filters = filters
content.keywords = queryKey
content.current_page = page
NetProto.sendSocket(content, callback, timeOutSec)
end
------------------------------------------------------
return NetProto

View File

@@ -115,6 +115,7 @@ function MyUtl.setIsHidePhone(val)
end
MyUtl.hidePhone = function(phone)
if not phone then return end
if not MyUtl.isHidePhone then
return phone
end

View File

@@ -1,101 +1,122 @@
-- xx单元
do
local _cell = {}
local csSelf = nil;
local transform = nil;
local grid;
local dayPrefab = nil;
local mData = nil;
local csSelf = nil
local transform = nil
local grid
local dayPrefab = nil
local mData = nil
local dayList
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj;
transform = csSelf.transform;
grid = getChild(transform, "Grid"):GetComponent("UIGrid");
dayPrefab = getChild(grid.transform, "00000").gameObject;
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
csSelf = csObj
transform = csSelf.transform
grid = getChild(transform, "Grid"):GetComponent("UIGrid")
dayPrefab = getChild(grid.transform, "00000").gameObject
end
-- 注意c#侧不会在调用show时调用refresh
function _cell.refresh(data, pageIndex)
mData = data;
mData = data
if (mData == nil) then
mData = {}
local curYear, curMonth = PanelCalender.getData();
local curYear, curMonth = PanelCalender.getData()
if (pageIndex < 0) then
mData.year, mData.month = PanelCalender.getYYHH_ByaddMonth(curYear, curMonth, -6 + pageIndex);
mData.year, mData.month = PanelCalender.getYYHH_ByaddMonth(curYear, curMonth, -6 + pageIndex)
else
mData.year, mData.month = PanelCalender.getYYHH_ByaddMonth(curYear, curMonth, -6 + pageIndex);
mData.year, mData.month = PanelCalender.getYYHH_ByaddMonth(curYear, curMonth, -6 + pageIndex)
end
end
dayList = _cell.resetCalender(mData.year, mData.month)
CLUIUtl.resetList4Lua(grid, dayPrefab, dayList, _cell.initCellDay)
end
CLUIUtl.resetList4Lua(grid, dayPrefab,
_cell.resetCalender(mData.year, mData.month),
_cell.initCellDay);
function _cell.doRefresh()
CLUIUtl.resetList4Lua(grid, dayPrefab, dayList, _cell.initCellDay)
end
-- 取得数据
function _cell.getData()
return mData;
return mData
end
function _cell.initCellDay(cell, day)
local data = {}
data.day = day;
-- print(mData.year);
-- print(mData.month);
-- print(day);
-- print("=================");
if (mData.year == DateTime.Now.Year and
mData.month == DateTime.Now.Month and
day == DateTime.Now.Day) then
data.isToday = true;
PanelCalender.setDefalutSelectDate(cell, mData.year, mData.month, day);
local data
if cell.luaTable then
data = cell.luaTable.getData()
else
data.isToday = false;
data.isSelected = false;
data = {}
end
local selectedYear, selectedMonth, selectedDay = PanelCalender.getSelectDate();
if (mData.year == selectedYear and mData.month == selectedMonth and selectedDay == data.day) then
data.isSelected = true;
data.day = day
local selectedYear, selectedMonth, selectedDay = PanelCalender.getSelectDate()
if (mData.year == DateTime.Now.Year and mData.month == DateTime.Now.Month and day == DateTime.Now.Day) then
data.isToday = true
if selectedYear == nil then
PanelCalender.setDefalutSelectDate(cell, mData.year, mData.month, day)
end
else
data.isToday = false
data.isSelected = false
end
cell:init(data, _cell.onClickDay);
data.isSelected = false
local isDateRange, startDate, endDate = PanelCalender.getDateRangeDate()
if isDateRange then
local tmpDate =
tonumber(
joinStr(
NumEx.nStrForLen(mData.year, 4),
NumEx.nStrForLen(mData.month, 2),
NumEx.nStrForLen(data.day, 2)
)
)
if tmpDate and (startDate and tmpDate >= startDate) and (endDate and tmpDate <= endDate) then
data.isSelected = true
elseif tmpDate and (startDate and tmpDate == startDate) and endDate == nil then
data.isSelected = true
else
data.isSelected = false
end
else
if (mData.year == selectedYear and mData.month == selectedMonth and selectedDay == data.day) then
data.isSelected = true
PanelCalender.setDefalutSelectDate(cell, mData.year, mData.month, day)
end
end
cell:init(data, _cell.onClickDay)
end
function _cell.onClickDay(cell)
local d = cell.luaTable.getData();
local d = cell.luaTable.getData()
if (d.day == -1) then
return;
return
end
local selectedDay = cell.luaTable.getData().day;
local selectedMonth = mData.month;
local selectedYear = mData.year;
local selectedDay = cell.luaTable.getData().day
local selectedMonth = mData.month
local selectedYear = mData.year
PanelCalender.setSelectDate(cell, selectedYear, selectedMonth, selectedDay);
PanelCalender.setSelectDate(cell, selectedYear, selectedMonth, selectedDay)
end
function _cell.resetCalender(year, month)
local list = ArrayList();
local dayCount = DateEx.getMothDays(year, month);
local week = DateEx.getWeek(year, month, 1);
local list = ArrayList()
local dayCount = DateEx.getMothDays(year, month)
local week = DateEx.getWeek(year, month, 1)
for i = 0, week - 1 do
list:Add(-1);
list:Add(-1)
end
for i = week, dayCount - 1 + week do
-- print(i .. "-" .. week .. "+1");
list:Add(i - week + 1);
list:Add(i - week + 1)
end
for i = dayCount + week, 41 do
list:Add(-1);
list:Add(-1)
end
return list;
return list
end
--------------------------------------------
return _cell;
return _cell
end

View File

@@ -0,0 +1,44 @@
-- 单元
local uiCell = {}
local csSelf = nil
local transform = nil
local gameObject = nil
-- local Background = nil;
local Label = nil
local mData = nil
local centerObj
function uiCell.init(go)
gameObject = go
transform = go.transform
csSelf = gameObject:GetComponent("CLCellLua")
-- Background = getChild(transform, "Background"):GetComponent("UISprite");
Label = csSelf:GetComponent("UILabel")
end
function uiCell.setCenterObj(val)
centerObj = val
uiCell.refresh()
end
function uiCell.show(go, data)
mData = data
uiCell.refresh()
end
function uiCell.refresh(flag)
Label.text = isNilOrEmpty(mData) and "请选择" or mData
if centerObj and centerObj.centeredObject and centerObj.centeredObject.name == gameObject.name then
Label.color = ColorEx.getColor(0xff2990dc)
else
Label.color = ColorEx.getColor(0xff363636)
end
end
function uiCell.getData()
return mData
end
return uiCell

View File

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

View File

@@ -12,6 +12,7 @@
---@field popValues
---@field donotJoinKey boolean 是否要拼接key
---@field height numb 高度只有在emptyspace有用
---@field defaultText
---@class _ParamCellExtendFiled
---@field showMode _FieldMode
@@ -152,7 +153,7 @@ function _cell.setElementMode(mode)
uiobjs.Label.text = uiobjs.inputLabel
end
if uiobjs.input then
uiobjs.input.defaultText = uiobjs.inputLabel
uiobjs.input.defaultText = attr.defaultText or uiobjs.inputLabel
end
_cell.enabeldObj(uiobjs.Label4, true) -- multext
if
@@ -179,7 +180,7 @@ function _cell.setElementMode(mode)
uiobjs.Label.text = ""
end
if uiobjs.input then
uiobjs.input.defaultText = ""
uiobjs.input.defaultText = attr.defaultText or ""
end
_cell.enabeldObj(uiobjs.Label4, false)
_cell.enabeldObj(uiobjs.SpriteRight, false)
@@ -196,7 +197,7 @@ function _cell.setElementMode(mode)
uiobjs.Label.text = uiobjs.inputLabel
end
if uiobjs.input then
uiobjs.input.defaultText = uiobjs.inputLabel
uiobjs.input.defaultText = attr.defaultText or uiobjs.inputLabel
end
_cell.enabeldObj(uiobjs.Label4, true)
_cell.enabeldObj(uiobjs.SpriteRight, true)
@@ -213,7 +214,7 @@ function _cell.setElementMode(mode)
uiobjs.Label.text = ""
end
if uiobjs.input then
uiobjs.input.defaultText = ""
uiobjs.input.defaultText = attr.defaultText or ""
end
_cell.enabeldObj(uiobjs.Label4, false)
_cell.enabeldObj(uiobjs.SpriteRight, true)
@@ -230,7 +231,7 @@ function _cell.setElementMode(mode)
uiobjs.Label.text = ""
end
if uiobjs.input then
uiobjs.input.defaultText = ""
uiobjs.input.defaultText = attr.defaultText or ""
end
_cell.enabeldObj(uiobjs.Label4, false)
_cell.enabeldObj(uiobjs.SpriteRight, true)

View File

@@ -28,7 +28,7 @@ function _cell.show(go, data)
mData = data
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
local optionInfor = DBUser.getPopList()
local optionInfor = DBUser.getPopList(DBUser.FilterGroup.user)
uiobjs.LabelServerNo:refreshItems(optionInfor.options, optionInfor.values)
if tostring(mData.dealFlag) == "0" then

View File

@@ -11,13 +11,9 @@ local uiobjs = {}
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
-- uiobjs.LabelCompanyName = getCC(transform, "LabelCompanyName", "UILabel")
-- uiobjs.LabelTime = getCC(transform, "LabelTime", "UILabel")
---@type UIPopupList
uiobjs.LabelStatus = getCC(transform, "LabelStatus", "UIPopupList")
-- uiobjs.LabelCustName = getCC(transform, "LabelCustName", "UILabel")
-- uiobjs.SpriteStatus = getCC(transform, "SpriteStatus", "UISprite")
uiobjs.LabelServerNo = getCC(transform, "LabelServerNo", "UILabel")
uiobjs.LabelServerNo = getCC(transform, "LabelServerNo", "UIPopupList")
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
uiobjs.SpriteStatus = getChild(transform, "SpriteStatus")
@@ -28,12 +24,15 @@ end
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
mData.money = mData.prodNum * mData.salePrice
mData._phoneNo = MyUtl.hidePhone(mData.phoneNo)
mData.lastFollowUpTime = isNilOrEmpty(mData.lastFollowUpTime) and "" or mData.lastFollowUpTime
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
local optionInfor = DBOrder.getPopupList(DBOrder.PopListGroup.orderStatus)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
optionInfor = DBUser.getPopList(DBUser.FilterGroup.user)
uiobjs.LabelServerNo:refreshItems(optionInfor.options, optionInfor.values)
uiobjs.formRoot:setValue(mData)
if tostring(mData.dealFlag) == "0" then
if tostring(mData.status) == "0" then
SetActive(uiobjs.SpriteStatus.gameObject, true)
else
SetActive(uiobjs.SpriteStatus.gameObject, false)
@@ -44,11 +43,10 @@ end
function _cell.setHeadIcon()
---@type _DBUser
local user = DBUser.getUserById(mData.serviceNo)
local user = DBUser.getUserById(mData.upLoginNo)
if user then
uiobjs.LabelServerNo.text = user.loginName
DBUser.getIcon(
mData.serviceNo,
mData.upLoginNo,
function(texture)
if texture and texture.name == user.imageUrl then
uiobjs.SpriteHeadIcon.mainTexture = texture
@@ -63,16 +61,5 @@ function _cell.getData()
return mData
end
function _cell.uiEventDelegate(go)
local goName = go.name
if goName == "ButtonFollow" then
getPanelAsy("PanelNewFollow", onLoadedPanelTT, mData)
elseif goName == "ButtonTask" then
getPanelAsy("PanelNewFollowTask", onLoadedPanelTT, mData)
elseif goName == "ButtonContact" then
MyUtl.callCust(mData)
end
end
--------------------------------------------
return _cell

View File

@@ -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)

View File

@@ -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为调用refreshshow和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

View File

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

View File

@@ -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为调用refreshshow和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

View File

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

View File

@@ -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为调用refreshshow和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

View File

@@ -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

View File

@@ -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)

View File

@@ -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为调用refreshshow和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 ""

View File

@@ -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为调用refreshshow和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

View File

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

View File

@@ -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)

View File

@@ -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

View File

@@ -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为调用refreshshow和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

View File

@@ -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)

View File

@@ -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

View File

@@ -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为调用refreshshow和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,
"退出账号"
)