diff --git a/lua_probject/base_project/Game/Controller/LoddyController.lua b/lua_probject/base_project/Game/Controller/LoddyController.lua index 39d29010..d6d6a476 100644 --- a/lua_probject/base_project/Game/Controller/LoddyController.lua +++ b/lua_probject/base_project/Game/Controller/LoddyController.lua @@ -437,3 +437,25 @@ function M:RetrievePassword(data, callback) callback(res) end) end + +--找回账号信息 +function M:GetAccInfo(data, callback) + local _client = ControllerManager.WebClient + local _data = {} + data.id = 1534852132465 + _data.data = RSAHelper.Encrypt(json.encode(data)) + _client:send(Protocol.WEB_GET_ACC, _data, function(res) + callback(res) + end) +end + +--设置 +function M:SetAccInfo(data, callback) + local _client = ControllerManager.WebClient + local _data = {} + -- _data.data = RSAHelper.Encrypt(json.encode(data)) + _data = data + _client:send(Protocol.WEB_SET_ACC, _data, function(res) + callback(res) + end) +end diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index 52404240..c9e61796 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -52,7 +52,8 @@ local function __Login(cmd, _data, callBack) user.type = account["type"] user.agent = account["mng"] user.bind_pwd = data["havePassword"] - user.retri_pwd = data["havegroup"] + user.retri_pwd = data["havegroup"] + user.isBangding = tonumber(data.isBangding) user.real_info = account.real_info user.phone = account.phone @@ -87,7 +88,6 @@ local function __getCode(cmd, _data, callBack) end function __getCode_test(cmd, _data, callBack) - local _client = ControllerManager.WebClient _client:send(Protocol.WEB_GET_CODE, { id = _data.id }, function(res) if (res.ReturnCode == 0) then @@ -97,12 +97,10 @@ function __getCode_test(cmd, _data, callBack) end) end - - --得到app信息 function M:GetAppInfo() local _client = ControllerManager.WebClient - _client:send(Protocol.WEB_GET_APP_INFO,{id=1}, function(res) + _client:send(Protocol.WEB_GET_APP_INFO, { id = 1 }, function(res) if (res.ReturnCode == 0) then GameApplication.Instance:SetAppInfo(res.Data.appInfo) end @@ -165,10 +163,13 @@ end function M:Login(callback) local user = DataManager.SelfUser local _data = {} + printlog("lingmeng Login", UnityEngine.SystemInfo.deviceUniqueIdentifier) local result = pcall(function(...) _data.data = RSAHelper.Encrypt(json.encode({ acc = user.acc, + -- acc = "hjksa456asfas2sadg454dsdas354djbrdsdqadasd7fadij97845bd56r4", nick = user.nick_name, + -- nick = "test1", sex = user.sex, portrait = user.head_url, deviceCode = UnityEngine.SystemInfo.deviceUniqueIdentifier diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index 543ea983..bbbcf47a 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -53,9 +53,12 @@ Protocol = { WEB_UPDATE_NOTICE = "index/get_notice", --找回账号 WEB_BACK_PASSWORD = "acc/set_back_password", - --得到app信息 - WEB_GET_APP_INFO = "acc/get_app_info", - + --得到app信息 + WEB_GET_APP_INFO = "acc/get_app_info", + --获得同设备号的acc + WEB_GET_ACC = "acc/get_bangding_account", + --平移同设备号的acc + WEB_SET_ACC = "acc/bangding_account", diff --git a/lua_probject/base_project/Game/View/Lobby/SelectAcc.lua b/lua_probject/base_project/Game/View/Lobby/SelectAcc.lua new file mode 100644 index 00000000..637c768d --- /dev/null +++ b/lua_probject/base_project/Game/View/Lobby/SelectAcc.lua @@ -0,0 +1,119 @@ +local SelectAcc = {} + +local M = SelectAcc + +function SelectAcc.new(data, callback) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) + self.class = "SelectAcc" + self._callback = callback + self._close_zone = false + self._close_destroy = true + self._data = data + local url = "ui://Lobby/win_selectAccont" + self:init(url) + return self +end + +function M:init(url) + getmetatable(M).__index.init(self, url) + local lobbyCtr1 = ControllerManager.GetController(LoddyController) + + local user = DataManager.SelfUser + self._view:GetChild('text_nick').text = user.nick_name + self._view:GetChild('text_id').text = user.account_id + ImageLoad.Load(user.head_url, self._view:GetChild('head_url')) + + self._view:GetChild('btn_ok').onClick:Set(function() + self._view:GetController('choose').selectedIndex = 1 + end) + + self._view:GetChild('btn_cancle').onClick:Set(function() + self:Destroy() + end) + + self._list_acc = self._view:GetChild('list_acc') + self._list_acc:SetVirtual() + self._list_acc.itemRenderer = function(index, obj) + ImageLoad.Load(self._resData[index + 1].portrait, obj._iconObject) + obj:GetChild('text_id').text = self._resData[index + 1].id + obj:GetChild('text_name').text = self._resData[index + 1].nick + obj:GetChild('btn_bing').onClick:Set(function(context) + self._view:GetChild('tex_phone').text = self._resData[index + 1].id + self._view:GetController('choose').selectedIndex = 2 + end) + end + + self._view:GetChild('btn_ok_pws').onClick:Set(function() + self:Bind() + end) + + self._view:GetChild('btn_cancel_pws').onClick:Set(function() + self._view:GetController('choose').selectedIndex = 1 + end) + + self:initInfo() +end + +function M:initInfo() + local lobbyCtr1 = ControllerManager.GetController(LoddyController) + lobbyCtr1:GetAccInfo({}, function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + return + end + self._resData = res.Data.accounts + self._list_acc.numItems = #self._resData + end) +end + +function M:Bind() + local tex_passwd = self._view:GetChild("tex_passwd") + local password = tex_passwd.text + if string.len(password) < 6 then + ViewUtil.ShowTips("请输入5位以上的密码") + return + end + -- local flg_xiaozimu = false + -- local flg_dazimu = false + -- local fla_shuzi = false + -- for i = 1, #password do + -- local oneChar = string.sub(password, i, i) + -- if string.byte(oneChar) >= 65 and string.byte(oneChar) <= 90 then + -- flg_dazimu = true + -- elseif string.byte(oneChar) >= 97 and string.byte(oneChar) <= 122 then + -- flg_xiaozimu = true + -- elseif string.byte(oneChar) >= 48 and string.byte(oneChar) <= 57 then + -- fla_shuzi = true + -- end + -- end + -- if not (flg_xiaozimu or flg_dazimu) then + -- ViewUtil.ShowTips("密码必须包含字母") + -- return + -- end + + local _data = {} + + ViewUtil.ShowModalWait(self._root_view, "正在提交...") + local loddyctr = ControllerManager.GetController(LoddyController) + _data.password = password + _data.tagId = tonumber(self._view:GetChild("tex_phone").text) + + loddyctr:SetAccInfo(_data, function(res) + ViewUtil.CloseModalWait() + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode, "密码错误") + return + end + PlayerPrefs.DeleteKey('session_id') + PlayerPrefs.Save() + RestartGame() + self:Destroy() + end) +end + +function M:Destroy() + BaseWindow.Destroy(self) +end + +return M diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index c04aff59..05bce181 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -12,6 +12,7 @@ local PhoneBindView = import(".Lobby.PhoneBindView") local RealAddressView = import(".Lobby.RealAddressView") local LobbyHeadView = import(".Lobby.LobbyHeadView") local IDPasswordAlone = import(".Lobby.IDPasswordAlone") +local SelectAcc = import(".Lobby.SelectAcc") LobbyView = {} local M = {} @@ -372,20 +373,14 @@ function M:Destroy() end function M:Show() - print("on lobbyView show~~~~~~") BaseView.Show(self) ViewUtil.PlaySoundBg() UpdateBeat:Add(self.OnUpdate, self) - print("lingmeng show1") if self.alldonhua then - print("lingmeng show2", coroutine.status(self.alldonhua)) if not coroutine.status(self.alldonhua) == "running" then - print("lingmeng show2") coroutine.resume(self.alldonhua) - print("lingmeng show3") end else - print("lingmeng show4") self:InitClip() end -- 如果在圈子内的房间,显示tip @@ -428,8 +423,13 @@ function M:Show() local idPasswordAlone = IDPasswordAlone.new() idPasswordAlone:Show() elseif not DataManager.SelfUser.retri_pwd then - local idPasswordAlone = IDPasswordAlone.new({only_retrieve = true}) + local idPasswordAlone = IDPasswordAlone.new({ only_retrieve = true }) idPasswordAlone:Show() + elseif DataManager.SelfUser.isBangding and DataManager.SelfUser.isBangding == 0 then + local selectAcc = SelectAcc.new({}, function() + self._close_destroy = true + end) + selectAcc:Show() end end diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua index 6ee2feb6..6676130b 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupMemberOperateView.lua @@ -360,7 +360,7 @@ function M:init(url) end - if ((group.lev < 3 and member.parentId == 0) or (group.type == 2 and member.parentId == DataManager.SelfUser.account_id)) then + if ((group.lev < 3 and member.parentId == 0) or (group.type == 2 and member.parentId == DataManager.SelfUser.account_id)) then local btn_set_partner = lst_mng:AddItemFromPool() local pic = member.partnerLev == 0 and "mng_set_partner" or "mng_del_partner" btn_set_partner.icon = "ui://NewGroup/" .. pic @@ -407,7 +407,7 @@ function M:init(url) mflv:Show() end) - if group.lev == 1 and group.type == 2 then + if group.lev == 1 and group.type == 2 then local btn_move = lst_mng:AddItemFromPool() btn_move.icon = "ui://NewGroup/mng_move" btn_move.onClick:Set(function() diff --git a/wb_new_ui/.objs/metas/2d9xdj6z/qflm7e2o.info b/wb_new_ui/.objs/metas/2d9xdj6z/qflm7e2o.info new file mode 100644 index 00000000..f09795d2 --- /dev/null +++ b/wb_new_ui/.objs/metas/2d9xdj6z/qflm7e2o.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n55_qflm": { + "collapsed": true + }, + "n58_qflm": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/assets/Lobby/component/index/select_acc/Group 1053.png b/wb_new_ui/assets/Lobby/component/index/select_acc/Group 1053.png new file mode 100644 index 00000000..879fbe64 Binary files /dev/null and b/wb_new_ui/assets/Lobby/component/index/select_acc/Group 1053.png differ diff --git a/wb_new_ui/assets/Lobby/component/index/select_acc/Rectangle 333.png b/wb_new_ui/assets/Lobby/component/index/select_acc/Rectangle 333.png new file mode 100644 index 00000000..e2aa8884 Binary files /dev/null and b/wb_new_ui/assets/Lobby/component/index/select_acc/Rectangle 333.png differ diff --git a/wb_new_ui/assets/Lobby/component/index/select_acc/btnChild_acc.xml b/wb_new_ui/assets/Lobby/component/index/select_acc/btnChild_acc.xml new file mode 100644 index 00000000..0415028e --- /dev/null +++ b/wb_new_ui/assets/Lobby/component/index/select_acc/btnChild_acc.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + +