diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index c6d1ae99..40af1a67 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -47,6 +47,7 @@ local function __Login(cmd, _data, callBack) user.group_id = account["groupId"] user.type = account["type"] user.agent = account["mng"] + user.bind_pwd = data.havePassword user.real_info = account.real_info user.phone = account.phone @@ -117,6 +118,7 @@ end function M:QuickLogin(session_id, callback) local _data = {} + _data["deviceCode"] = UnityEngine.SystemInfo.deviceUniqueIdentifier local _client = ControllerManager.WebClient _client:setSession(session_id) -- ControllerManager.GroupClient:setSession(session_id) diff --git a/lua_probject/base_project/Game/Data/User.lua b/lua_probject/base_project/Game/Data/User.lua index 8e0b0e63..8cdd411f 100644 --- a/lua_probject/base_project/Game/Data/User.lua +++ b/lua_probject/base_project/Game/Data/User.lua @@ -4,39 +4,41 @@ --- -- a user User = { - account_id = "", - -- acc - acc ="", - --头像 - head_url = "", - -- 用户IP - host_ip = "", - -- 经纬度坐标 - location = nil, - -- 昵称 - nick_name = "", - --性别 - sex = 0, - -- 房间ID - room_id = "", - -- 房卡数 - diamo = 0, - -- 代理类型,0不是代理,1普通代理,2大联盟代理 - agent = 0, - invite_code = "1", - -- 当前圈子 - cur_group = nil, - -- 圈子id,重连时用来标记是否在圈子房间中 - group_id = 0, + account_id = "", + -- acc + acc = "", + --头像 + head_url = "", + -- 用户IP + host_ip = "", + -- 经纬度坐标 + location = nil, + -- 昵称 + nick_name = "", + --性别 + sex = 0, + -- 房间ID + room_id = "", + -- 房卡数 + diamo = 0, + -- 代理类型,0不是代理,1普通代理,2大联盟代理 + agent = 0, + invite_code = "1", + -- 当前圈子 + cur_group = nil, + -- 圈子id,重连时用来标记是否在圈子房间中 + group_id = 0, + --用于标记是否有密码,没有密码则强制调用绑定密码页面,true表示有密码。false表示没有密码 + bind_pwd = false, - playback = {}, + playback = {}, - --弹窗公告 - notices = {}, + --弹窗公告 + notices = {}, } ---- +--- -- @type User local M = User @@ -44,42 +46,40 @@ local M = User --- Create a new User function User.new() - local self = {} - setmetatable(self, {__index = M}) - return self + local self = {} + setmetatable(self, { __index = M }) + return self end - function M:getGameData(game_id) local game_list = self.games - for i=1,#game_list do - local game = game_list[i] + for i = 1, #game_list do + local game = game_list[i] if game.game_id == game_id then - return game + return game end end end function M:addGameData(data) local game_list = self.games - for i=1,#game_list do - local game = game_list[i] + for i = 1, #game_list do + local game = game_list[i] if game.game_id == data.game_id then game_list[i] = data return end end - game_list[#game_list+1] = data + game_list[#game_list + 1] = data end - function M:removeGameData(game_id) local game_list = self.games - for i=1,#game_list do - local game = game_list[i] + for i = 1, #game_list do + local game = game_list[i] if game.game_id == game_id then - table.remove(game_list,i) + table.remove(game_list, i) return end end @@ -107,4 +107,3 @@ local GameInfo = { table_data = nil } ]] - diff --git a/lua_probject/base_project/Game/View/Lobby/IDPasswordAlone.lua b/lua_probject/base_project/Game/View/Lobby/IDPasswordAlone.lua new file mode 100644 index 00000000..884879f7 --- /dev/null +++ b/lua_probject/base_project/Game/View/Lobby/IDPasswordAlone.lua @@ -0,0 +1,78 @@ +local IDPasswordAlone = {} + +local M = IDPasswordAlone + +function IDPasswordAlone.new(callback) + setmetatable(M, { __index = BaseWindow }) + local self = setmetatable({}, { __index = M }) + self.class = "IDPasswordAlone" + self._callback = callback + self._close_zone = false + self._close_destroy = true + local url = "ui://Lobby/win_id_password_alone" + self:init(url) + return self +end + +function M:init(url) + BaseWindow.init(self, url) + + self._view:GetChild("tex_phone").text = DataManager.SelfUser.account_id + + local btn_ok = self._view:GetChild("btn_ok") + btn_ok.onClick:Set(function() + self:Bind() + end) +end + +function M:Destroy() + BaseWindow.Destroy(self) +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) + print("lingmeng Bind", oneChar, string.byte(oneChar)) + 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 + + _data = {} + + ViewUtil.ShowModalWait(self._root_view, "正在提交...") + local loddyctr = ControllerManager.GetController(LoddyController) + _data.password = password + _data.type = 3 + + loddyctr:UpdateUserInfo(_data, function(res) + ViewUtil.CloseModalWait() + if (res.ReturnCode == 0) then + DataManager.SelfUser.password = "123" + if self._callback then self._callback() end + else + ViewUtil.ErrorTip(res.ReturnCode, "提交失败") + end + self:Close() + end) +end + +return M diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index dc9b146b..ec838173 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -11,6 +11,7 @@ local HeadView = import(".Lobby.LobbyHeadView") local PhoneBindView = import(".Lobby.PhoneBindView") local RealAddressView = import(".Lobby.RealAddressView") local LobbyHeadView = import(".Lobby.LobbyHeadView") +local IDPasswordAlone = import(".Lobby.IDPasswordAlone") LobbyView = {} local M = {} @@ -174,8 +175,8 @@ function M:InitView(url) self.groupMainView._view.visible = true else Application.Quit() - -- ViewUtil.ErrorTip(-1, "code!" + code) - + -- ViewUtil.ErrorTip(-1, "code!" + code) + printlog("获取圈子数据失败=======>>>>") end end @@ -422,6 +423,11 @@ function M:Show() if self.groupMainView and self.groupMainView._groupInfoView then self.groupMainView._groupInfoView:hidePipei() end + + if not DataManager.SelfUser.bind_pwd then + local idPasswordAlone = IDPasswordAlone.new() + idPasswordAlone:Show() + end end function M:GetPlayerInfoData() diff --git a/wb_new_ui/.objs/metas/2d9xdj6z/ab5pcji.info b/wb_new_ui/.objs/metas/2d9xdj6z/ab5pcji.info new file mode 100644 index 00000000..8cf75acc --- /dev/null +++ b/wb_new_ui/.objs/metas/2d9xdj6z/ab5pcji.info @@ -0,0 +1,13 @@ +{ + "objectStatus": { + "n50_ab5p": { + "collapsed": true + }, + "n39_ab5p": { + "collapsed": true + }, + "n19_p41o": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/assets/Lobby/component/user_info/win_id_password_alone.xml b/wb_new_ui/assets/Lobby/component/user_info/win_id_password_alone.xml new file mode 100644 index 00000000..b7ba4ad8 --- /dev/null +++ b/wb_new_ui/assets/Lobby/component/user_info/win_id_password_alone.xml @@ -0,0 +1,21 @@ + + + + +