mm
This commit is contained in:
@@ -102,7 +102,13 @@ function DBUser.wrapUserList(userlist, groupList)
|
||||
db.userGroupList[v.groupId] = list
|
||||
end
|
||||
|
||||
--//TODO:组装部门的数据
|
||||
-- 组装部门的数据
|
||||
for i, v in ipairs(groupList) do
|
||||
local parentId = v.parentId or -1
|
||||
local list = db.groupTree[parentId] or {}
|
||||
table.insert(list, v)
|
||||
db.groupTree[parentId] = list
|
||||
end
|
||||
end
|
||||
|
||||
function DBUser.getUserList()
|
||||
@@ -262,6 +268,9 @@ function DBUser.wrapMyinforData(myinfor)
|
||||
myinfor.loginNo = user.loginNo
|
||||
myinfor.imageUrl = user.imageUrl
|
||||
end
|
||||
if myinfor.ifPhoAuth == nil then
|
||||
myinfor.ifPhoAuth = companyInfro.ifPhoAuth
|
||||
end
|
||||
return myinfor
|
||||
end
|
||||
|
||||
|
||||
@@ -304,7 +304,8 @@ NetProto.cmds = {
|
||||
updateUserInfo = "updateUserInfo", -- 更新用户信息
|
||||
updateUserPhone = "updateUserPhone", -- 更新用户手机号
|
||||
get_customerById = "get_customerById", -- 取得客户
|
||||
readNotice = "readNotice" -- 已读公告
|
||||
readNotice = "readNotice", -- 已读公告
|
||||
authorizedPhone = "authorizedPhone", -- 认证手机号
|
||||
}
|
||||
---------------------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------
|
||||
@@ -748,5 +749,13 @@ NetProto.send.readNotice = function(id, callback, timeOutSec)
|
||||
NetProto.sendSocket(content, callback, timeOutSec)
|
||||
end
|
||||
|
||||
NetProto.send.authorizedPhone = function(data, callback, timeOutSec)
|
||||
local content = {}
|
||||
content.action = NetProto.cmds.authorizedPhone
|
||||
content.phone = data.phone
|
||||
content.msgcode = data.msgcode
|
||||
content.groupId = NetProto.groupId
|
||||
NetProto.sendSocket(content, callback, timeOutSec)
|
||||
end
|
||||
------------------------------------------------------
|
||||
return NetProto
|
||||
|
||||
@@ -241,7 +241,7 @@ CLLPSplash.selectServer = function(callback)
|
||||
end,
|
||||
nil,
|
||||
true,
|
||||
1
|
||||
2
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ CSPMain.contentRect = Vector4.zero
|
||||
local objs = {}
|
||||
|
||||
local bottomBtns = {
|
||||
-- {id = 2, name = "培训", panel = "PanelTraining", Background = "icon_icon_73_peixun", Checkmark = "icon_icon_78_peixun2"},
|
||||
{id = 4, name = "拨号", panel = "PanelMakeCall", Background = "main_icon_tel", Checkmark = "main_icon_tel2"},
|
||||
{id = 1, name = "消息", panel = "PanelMsg", Background = "main_icon_news", Checkmark = "main_icon_news2"},
|
||||
{id = 2, name = "工作", panel = "PanelTasks", Background = "main_icon_work", Checkmark = "main_icon_work2"},
|
||||
{id = 3, name = "我的", panel = "PanelMine", Background = "main_icon_me", Checkmark = "main_icon_me2"}
|
||||
|
||||
@@ -13,6 +13,7 @@ function TRPBindPhone:init(csObj)
|
||||
uiobjs.scrollview = getCC(self.transform, "PanelContent", "UIScrollView")
|
||||
uiobjs.scrollview.dampenStrength = MyUtl.dampenStrength
|
||||
uiobjs.formRoot = getCC(uiobjs.scrollview.transform, "Table", "CLUIFormRoot")
|
||||
uiobjs.ButtonAuth = getChild(uiobjs.formRoot.transform, "ButtonAuth").gameObject
|
||||
self:setEventDelegate()
|
||||
end
|
||||
|
||||
@@ -30,6 +31,9 @@ end
|
||||
|
||||
-- 刷新
|
||||
function TRPBindPhone:refresh()
|
||||
local user = DBUser.getMyInfor()
|
||||
printe("user.ifPhoAuth")
|
||||
SetActive(uiobjs.ButtonAuth, user.ifPhoAuth ~= "Y" or false)
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
@@ -49,7 +53,10 @@ end
|
||||
function TRPBindPhone:setEventDelegate()
|
||||
self.EventDelegate = {
|
||||
ButtonModify = function()
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = self.mdata.phone, isBindPhone = true})
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {isBindPhone = true})
|
||||
end,
|
||||
ButtonAuth = function()
|
||||
getPanelAsy("PanelResetPasswordStep1", onLoadedPanelTT, {phone = self.mdata.phoneNo, isAuth = true})
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
local TRPMakeCall = {}
|
||||
|
||||
local csSelf = nil
|
||||
local transform = nil
|
||||
local InputNumber
|
||||
local grid
|
||||
local cursorPosition = -1
|
||||
local currRecordName
|
||||
local LabelTitle
|
||||
|
||||
-- 初始化,只会调用一次
|
||||
function TRPMakeCall.init(csObj)
|
||||
csSelf = csObj
|
||||
transform = csObj.transform
|
||||
grid = getChild(transform, "AnchorBottom/grid"):GetComponent("UIGrid")
|
||||
|
||||
local contentRect = MyUtl.getUIContent(csSelf)
|
||||
grid.cellWidth = NumEx.getIntPart((contentRect.z - 100) / 3)
|
||||
|
||||
InputNumber = getChild(transform, "AnchorBottom/InputNumber"):GetComponent("UIInput")
|
||||
local prefabCell = getChild(grid.transform, "00000").gameObject
|
||||
local list = {1, 2, 3, 4, 5, 6, 7, 8, 9, "*", 0, "#"}
|
||||
CLUIUtl.resetList4Lua(
|
||||
grid,
|
||||
prefabCell,
|
||||
list,
|
||||
function(cell, data)
|
||||
cell:init(data, TRPMakeCall.onClickCell)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
function TRPMakeCall.setData(paras)
|
||||
end
|
||||
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPMakeCall.show()
|
||||
UIInput.selection = InputNumber
|
||||
InputNumber.value = ""
|
||||
cursorPosition = -1
|
||||
end
|
||||
|
||||
function TRPMakeCall.onClickCell(cell, data)
|
||||
UIInput.selection = InputNumber
|
||||
InputNumber:Insert(data)
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPMakeCall.refresh()
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
function TRPMakeCall.hide()
|
||||
UIInput.selection = nil
|
||||
end
|
||||
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPMakeCall.procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == 0) then
|
||||
if (cmd == "8888") then
|
||||
-- 回拨已调用成功
|
||||
local orgs = Hashtable()
|
||||
orgs.callback = "TRPMakeCall.onEndIncomingCall"
|
||||
orgs.id = msg
|
||||
CLLCallListner.waite4Callback(JSON.JsonEncode(orgs))
|
||||
CLUIUtl.showConfirm("云呼叫中,请准备接听电话", nil)
|
||||
elseif cmd == "1018" then
|
||||
-- 保存通话记录完成
|
||||
CLLRecordMgr.moveRecord2Upload(currRecordName)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 处理ui上的事件,例如点击等
|
||||
function TRPMakeCall.uiEventDelegate(go)
|
||||
local goName = go.name
|
||||
if (goName == "ButtonCancel") then
|
||||
CLPanelManager.hideTopPanel()
|
||||
elseif goName == "InputNumber" then
|
||||
cursorPosition = InputNumber.cursorPosition
|
||||
elseif goName == "ButtonCall" then
|
||||
if InputNumber.value == nil or InputNumber.value == "" then
|
||||
CLAlert.add("请输入要呼叫的号码", Color.white, 1)
|
||||
return
|
||||
end
|
||||
CLLCallListner.ready2Call("TRPMakeCall.onEndCall", InputNumber.value)
|
||||
MyUtl.callPhone(InputNumber.value)
|
||||
elseif goName == "ButtonCallYun" then
|
||||
if InputNumber.value == nil or InputNumber.value == "" then
|
||||
CLAlert.add("请输入要呼叫的号码", Color.white, 1)
|
||||
return
|
||||
end
|
||||
local selfPhoneNum = Prefs.getSelfPhoneNum()
|
||||
showHotWheel()
|
||||
CLLNet.callCust2(selfPhoneNum, InputNumber.value)
|
||||
elseif goName == "ButtonDel" then
|
||||
TRPMakeCall.DoBackspace()
|
||||
end
|
||||
end
|
||||
|
||||
-- 当结束通话
|
||||
function TRPMakeCall.onEndCall(orgs)
|
||||
local func = function(remark)
|
||||
local data = Hashtable()
|
||||
data.remark = remark
|
||||
data.caller_number = Prefs.getSelfPhoneNum()
|
||||
data.destination_number = orgs.phone
|
||||
data.created_time = orgs.created_time
|
||||
data.answered_time = orgs.answered_time
|
||||
data.over_time = orgs.over_time
|
||||
data.recording_file_name = Path.GetFileName(orgs.soundRecordFile)
|
||||
showHotWheel()
|
||||
CLLNet.saveCall(data)
|
||||
end
|
||||
currRecordName = Path.GetFileName(orgs.soundRecordFile)
|
||||
|
||||
CLPanelManager.getPanelAsy("PanelEndCallRemark", onLoadedPanelTT, func)
|
||||
end
|
||||
|
||||
-- 当结束回播通话
|
||||
function TRPMakeCall.onEndIncomingCall(orgs)
|
||||
local id = orgs.id
|
||||
local func = function(remark)
|
||||
showHotWheel()
|
||||
CLLNet.saveRemark4Call2(id, remark)
|
||||
end
|
||||
CLPanelManager.getPanelAsy("PanelEndCallRemark", onLoadedPanelTT, func)
|
||||
end
|
||||
|
||||
-- 当按了返回键时,关闭自己(返值为true时关闭)
|
||||
function TRPMakeCall.hideSelfOnKeyBack()
|
||||
return true
|
||||
end
|
||||
|
||||
function TRPMakeCall.DoBackspace()
|
||||
UIInput.selection = InputNumber
|
||||
if (InputNumber.value ~= nil and InputNumber.value ~= "") then
|
||||
if (InputNumber.selectionStart == InputNumber.selectionEnd) then
|
||||
if (InputNumber.selectionStart < 1) then
|
||||
return
|
||||
end
|
||||
InputNumber.selectionEnd = InputNumber.selectionEnd - 1
|
||||
end
|
||||
InputNumber:Insert("")
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------
|
||||
return TRPMakeCall
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e99fc9f936c6b43a3beb9bbd6b1bb95a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -25,6 +25,8 @@ function TRPMyInfor:init(csObj)
|
||||
uiobjs.Top = getCC(self.transform, "Top", "CLUIFormRoot")
|
||||
---@type UITexture
|
||||
uiobjs.HeadIcon = getCC(uiobjs.Top.transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
|
||||
uiobjs.InputPhone = getCC(uiobjs.Table.transform, "InputPhone", "CLCellLua")
|
||||
uiobjs.SpriteAuth = getCC(uiobjs.InputPhone.transform, "SpriteAuth", "UISprite")
|
||||
end
|
||||
|
||||
function TRPMyInfor:initFiledsAttr()
|
||||
@@ -80,16 +82,6 @@ function TRPMyInfor:initFiledsAttr()
|
||||
attr.donotJoinKey = true
|
||||
table.insert(self.baseFiledsAttr, attr)
|
||||
|
||||
attr = {}
|
||||
attr.attrName = "手机"
|
||||
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 = {}
|
||||
attr.attrName = "分机号"
|
||||
attr.id = "agentNo"
|
||||
@@ -132,6 +124,8 @@ end
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPMyInfor:show()
|
||||
self.mdata = DBUser.getMyInfor()
|
||||
|
||||
self:setPhoneInfor()
|
||||
---@type _ParamCellExtendFiledRoot
|
||||
local fieldRootInfor = {}
|
||||
fieldRootInfor.fields = {}
|
||||
@@ -156,6 +150,37 @@ function TRPMyInfor:show()
|
||||
self:setHeadInfor()
|
||||
end
|
||||
|
||||
function TRPMyInfor:setPhoneInfor()
|
||||
local attr = {}
|
||||
attr.attrName = "手机"
|
||||
attr.id = "phoneNo"
|
||||
attr.attrType = DBCust.FieldType.text
|
||||
attr.ifMust = 0
|
||||
attr.cannotEdit = true
|
||||
attr.donotJoinKey = true
|
||||
attr.defaultText = "未绑定"
|
||||
---@type _ParamCellExtendFiled
|
||||
local dPhone = {}
|
||||
dPhone.attr = attr
|
||||
dPhone.showMode = _FieldMode.showAndModify
|
||||
dPhone.onClick = self:wrapFunc(self.onClickField)
|
||||
dPhone.onSelect = self:wrapFunc(self.onSelectField)
|
||||
uiobjs.InputPhone:init(dPhone, nil)
|
||||
|
||||
if isNilOrEmpty(self.mdata.phoneNo) then
|
||||
SetActive(uiobjs.SpriteAuth.gameObject, false)
|
||||
else
|
||||
if self.mdata.ifPhoAuth == "Y" then
|
||||
uiobjs.SpriteAuth.color = ColorEx.getColor(0xfffe9100)
|
||||
uiobjs.SpriteAuth.spriteName = "mine_img_authenticated"
|
||||
else
|
||||
uiobjs.SpriteAuth.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.SpriteAuth.spriteName = "mine_img_unauthorized"
|
||||
end
|
||||
SetActive(uiobjs.SpriteAuth.gameObject, true)
|
||||
end
|
||||
end
|
||||
|
||||
function TRPMyInfor:setHeadInfor()
|
||||
DBUser.getIcon(
|
||||
self.mdata.loginNo,
|
||||
|
||||
@@ -29,6 +29,8 @@ function TRPResetPasswordStep1:onShowFrame(cs)
|
||||
d.title = "重置密码"
|
||||
elseif self.mData.isBindPhone then
|
||||
d.title = "绑定手机号"
|
||||
elseif self.mData.isAuth then
|
||||
d.title = "认证手机号"
|
||||
else
|
||||
d.title = "寻找密码"
|
||||
end
|
||||
@@ -75,6 +77,7 @@ function TRPResetPasswordStep1:setEventDelegate()
|
||||
if self.mData.isBindPhone then
|
||||
d.loginNo = DBUser.getMyInfor().loginNo
|
||||
d.oprType = "updatePho"
|
||||
elseif self.mData.isAuth then
|
||||
end
|
||||
NetProto.sendVerMsg(
|
||||
d,
|
||||
|
||||
@@ -30,6 +30,8 @@ function TRPResetPasswordStep2:onShowFrame(cs)
|
||||
d.title = "重置密码"
|
||||
elseif self.mData.isBindPhone then
|
||||
d.title = "绑定手机号"
|
||||
elseif self.mData.isAuth then
|
||||
d.title = "认证手机号"
|
||||
else
|
||||
d.title = "寻找密码"
|
||||
end
|
||||
@@ -98,10 +100,12 @@ function TRPResetPasswordStep2:setEventDelegate()
|
||||
end
|
||||
if self.mData.isBindPhone then
|
||||
-- 绑定号码
|
||||
showHotWheel()
|
||||
local data = uiobjs.formRoot:getValue(self.mData, true)
|
||||
NetProto.send.updateUserPhone(
|
||||
data,
|
||||
function(content)
|
||||
hideHotWheel()
|
||||
if content.success then
|
||||
MyUtl.toastS("绑定手机号成功")
|
||||
Prefs.setUserName(self.mData.phone)
|
||||
@@ -115,6 +119,22 @@ function TRPResetPasswordStep2:setEventDelegate()
|
||||
end
|
||||
end
|
||||
)
|
||||
elseif self.mData.isAuth then
|
||||
local data = uiobjs.formRoot:getValue(self.mData, true)
|
||||
showHotWheel()
|
||||
NetProto.send.authorizedPhone(
|
||||
data,
|
||||
function(content)
|
||||
hideHotWheel()
|
||||
if content.success then
|
||||
MyUtl.toastS("认证手机号成功")
|
||||
hideTopPanel(self.csSelf)
|
||||
hideTopPanel()
|
||||
hideTopPanel()
|
||||
NetProto.send.personal_data_query()
|
||||
end
|
||||
end
|
||||
)
|
||||
else
|
||||
local data = uiobjs.formRoot:getValue(self.mData, true)
|
||||
data.isModify = self.mData.isModify
|
||||
|
||||
@@ -14,6 +14,7 @@ function TRPSetting:init(csObj)
|
||||
uiobjs.scrollview.dampenStrength = MyUtl.dampenStrength
|
||||
self:setEventDelegate()
|
||||
uiobjs.LabelPhone = getCC(uiobjs.scrollview.transform, "Table/ButtonPhone/LabelPhone", "UILabel")
|
||||
uiobjs.SpriteAuth = getCC(uiobjs.scrollview.transform, "Table/ButtonPhone/SpriteAuth", "UISprite")
|
||||
end
|
||||
|
||||
-- 设置数据
|
||||
@@ -25,11 +26,26 @@ end
|
||||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||||
function TRPSetting:show()
|
||||
uiobjs.scrollview:ResetPosition()
|
||||
uiobjs.LabelPhone.text = Prefs.getUserName() or "未绑定"
|
||||
end
|
||||
|
||||
-- 刷新
|
||||
function TRPSetting:refresh()
|
||||
local phone = Prefs.getUserName()
|
||||
if phone then
|
||||
uiobjs.LabelPhone.text = phone
|
||||
local user = DBUser.getMyInfor()
|
||||
if user.ifPhoAuth == "Y" then
|
||||
uiobjs.SpriteAuth.color = ColorEx.getColor(0xfffe9100)
|
||||
uiobjs.SpriteAuth.spriteName = "mine_img_authenticated"
|
||||
else
|
||||
uiobjs.SpriteAuth.color = ColorEx.getColor(0xff999999)
|
||||
uiobjs.SpriteAuth.spriteName = "mine_img_unauthorized"
|
||||
end
|
||||
SetActive(uiobjs.SpriteAuth.gameObject, true)
|
||||
else
|
||||
uiobjs.LabelPhone.text = "未绑定"
|
||||
SetActive(uiobjs.SpriteAuth.gameObject, false)
|
||||
end
|
||||
end
|
||||
|
||||
-- 关闭页面
|
||||
@@ -39,10 +55,9 @@ end
|
||||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||||
function TRPSetting:procNetwork(cmd, succ, msg, paras)
|
||||
if (succ == NetSuccess) then
|
||||
--[[
|
||||
if cmd == xx then
|
||||
if cmd == NetProto.cmds.personal_data_query then
|
||||
self:refresh()
|
||||
end
|
||||
]]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user