diff --git a/lua_probject/base_project/Game/Controller/LoddyController.lua b/lua_probject/base_project/Game/Controller/LoddyController.lua index 36d8ed37..6cac7487 100644 --- a/lua_probject/base_project/Game/Controller/LoddyController.lua +++ b/lua_probject/base_project/Game/Controller/LoddyController.lua @@ -530,3 +530,13 @@ function M:FG_Get_Diamond_Msg(callback) callback(res) end) end + +-- 设置支付图片 +function M:FG_Set_Pay_Code(paycode,callback) + local _data = {} + _data.pay_code = paycode + local _client = ControllerManager.WebClient + _client:send(Protocol.WEB_SEY_PAY_CODE, _data, function(res) + callback(res) + end) +end \ No newline at end of file diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index 11a817fe..1af3753e 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -17,9 +17,9 @@ local _LocalConfigAllGame = { -- 90, 22, 55, - 66,90 - ,91,93 - ,92 + 66, 90 +, 91, 93 +, 92 } @@ -55,6 +55,7 @@ local function __Login(cmd, _data, callBack) user.group_id = account["groupId"] user.type = account["type"] --为1的时候是代理,为0的时候是普通玩家 user.agent = account["mng"] + user.pay_code = account.pay_code user.real_info = account.real_info user.phone = account.phone @@ -62,6 +63,7 @@ local function __Login(cmd, _data, callBack) user.games = FilterGame(data.games) user.havaPsw = data.havaPassword user.currenIp = data.ip + if Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then --GameApplication.Instance.printLog = true else diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index c2ae0f6c..0ed64391 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -57,6 +57,8 @@ Protocol = { WEB_LOGIN_Phone = "acc/phone_login", -- 获取自己房卡记录 WEB_Get_Diamond_Mssages = "acc/get_messages", + -- 设置自己支付图片 + WEB_SEY_PAY_CODE = "acc/set_pay_code", ----index---- -- 获取公告 WEB_UPDATE_NOTICE = "index/get_notice", diff --git a/lua_probject/base_project/Game/View/FamilyViewZuo.lua b/lua_probject/base_project/Game/View/FamilyViewZuo.lua index e50c9b1f..d3d58ec4 100644 --- a/lua_probject/base_project/Game/View/FamilyViewZuo.lua +++ b/lua_probject/base_project/Game/View/FamilyViewZuo.lua @@ -344,6 +344,11 @@ end --点击桌子进入游戏 function M:ClickJoinRoom(context, room, selectSeat) + + if room.maxPlayers == 2 and (not DataManager.SelfUser.pay_code or #DataManager.SelfUser.pay_code < 6) then + ViewUtil:ErrorTip("没有绑定二维码不能进入双人游戏") + return + end local group = DataManager.CurrenGroup local roomCtr = ControllerManager.GetController(RoomController) roomCtr:PublicJoinRoom( diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua b/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua index f14a04ca..3ad58fd8 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbyPlayerInfoView.lua @@ -117,11 +117,40 @@ function M:init(url) local btn_changeInfo = self._view:GetChild('btn_changeInfo') btn_changeInfo:GetController('type').selectedIndex = pswType btn_changeInfo.onClick:Set(function() - local passwordUpdateView = PasswordUpdateView.new(pswType, function(res) - pswType = DataManager.SelfUser.havaPsw and 1 or 0 - btn_changeInfo:GetController('type').selectedIndex = pswType + -- local passwordUpdateView = PasswordUpdateView.new(pswType, function(res) + -- pswType = DataManager.SelfUser.havaPsw and 1 or 0 + -- btn_changeInfo:GetController('type').selectedIndex = pswType + -- end) + -- passwordUpdateView:Show() + + GameApplication.Instance:PickAndUploadImage(function(ok, jsonStr) + print("PickAndUpload ok=", ok, jsonStr) + + if not ok then + local err = json.decode(jsonStr) + print("err=", err.err, err.http, err.resp) + return + end + + local r = json.decode(jsonStr) + + -- 服务器返回在 r.serverResp + -- 你的 success 格式: {code=1,msg="ok",data={url=...,fullurl=...}} + local srv = r.serverResp + local data = srv.data + + print("local=", r.localPath) + print("uploaded url=", data.url) --实战用 + print("uploaded fullurl=", data.fullurl) --测试用 + + -- 这里 fullurl 就能直接用于显示/下载/存数据库 + local loddyCtr1 = ControllerManager.GetController(LoddyController) + loddyCtr1:FG_Set_Pay_Code(data.fullurl,function(res) + if res.ReturnCode == 0 then + + end + end) end) - passwordUpdateView:Show() end) local loddyCtr1 = ControllerManager.GetController(LoddyController) diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 7930f85d..1d0fd247 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -154,11 +154,12 @@ function M:InitView(url) self._flag_loadImageSucces = true end) - -- btn_head.onClick:Set(function() - -- local lobbyPlayerInfoView = LobbyPlayerInfoView.new(DataManager.SelfUser, function() - -- ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject) - -- end) - -- end) + --临时开去测试设置支付图片(全部样式没有修改) + btn_head.onClick:Set(function() + local lobbyPlayerInfoView = LobbyPlayerInfoView.new(DataManager.SelfUser, function() + ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject) + end) + end) diff --git a/wb_new_ui/assets/Common/component/comp_payTips.xml b/wb_new_ui/assets/Common/component/comp_payTips.xml new file mode 100644 index 00000000..53b08a3f --- /dev/null +++ b/wb_new_ui/assets/Common/component/comp_payTips.xml @@ -0,0 +1,10 @@ + + + + + +