diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index 9699a7e3..58099764 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -109,10 +109,11 @@ function M:FG_ExitGroup(group_id, callback) end --加入圈 -function M:FG_JoinGroup(id, callback) +function M:FG_JoinGroup(id, callback, remark) local _client = ControllerManager.GroupClient local data = {} data.id = id + data.remark = remark _client:send(Protocol.WEB_FG_JOIN_GROUP, data, function(res) callback(res) end) diff --git a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua index bca29f04..b3843a16 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyJoinAndCreate.lua @@ -1,8 +1,19 @@ +local tipsWindow = import("..Common.tipsWindow") + local FamilyJoinAndCreate = {} +local function SendJoinRoom(self, roomId, remark) + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_JoinGroup(tonumber(roomId), function(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + end + end, + remark) +end + function FamilyJoinAndCreate:init(root) local fgCtr = ControllerManager.GetController(NewGroupController) - --local createOrJoin = self._view:GetController('createOrJoin') self._view = root._view:GetChild('com_createAndJoin') self.style = self._view:GetController('cStyle') @@ -18,21 +29,17 @@ function FamilyJoinAndCreate:init(root) self.input_wxId.emojies = EmojiDitc.EmojiesDitc self._view:GetChild('btn_create').onClick:Add(function() - - if self.style.selectedIndex ~= 1 then + if self.style.selectedIndex ~= 1 then self.style.selectedIndex = 1 return end end) self._view:GetChild('btn_join').onClick:Add(function() - - if self.style.selectedIndex ~= 0 then + if self.style.selectedIndex ~= 0 then self.style.selectedIndex = 0 return end - - --self:JoinRoom(self.tex_num.text) end) self._view:GetChild('btn_c').onClick:Add(function() @@ -55,30 +62,30 @@ function FamilyJoinAndCreate:KeyBoardInit() print("self.list_keyBoard.numItems", self.list_keyBoard.numItems) - for i=0, self.list_keyBoard.numItems -1 do + for i = 0, self.list_keyBoard.numItems - 1 do local btn = self.list_keyBoard:GetChildAt(i) local btnStyle = btn:GetController('cStyle') local num = i + 1 if num <= 9 then - btn:GetChild('text_num').text = num + btn:GetChild('text_num').text = num btn.onClick:Set(function() print(num) self:NumTexInput(num) end) - elseif num == 10 then + elseif num == 10 then btnStyle.selectedIndex = 1 btn.onClick:Set(function() print(i) self:ClearNumTex() end) - elseif num == 11 then - btn:GetChild('text_num').text = 0 + elseif num == 11 then + btn:GetChild('text_num').text = 0 btn.onClick:Set(function() print(num) self:NumTexInput(0) end) - elseif num == 12 then + elseif num == 12 then btnStyle.selectedIndex = 2 btn.onClick:Set(function() print(num) @@ -89,26 +96,25 @@ function FamilyJoinAndCreate:KeyBoardInit() end function FamilyJoinAndCreate:NumTexInput(num) - if #self.tex_num.text >= 6 then + if #self.tex_num.text >= 6 then self.tex_num.text = string.sub(self.tex_num.text, 1, 6) return end self.tex_num.text = self.tex_num.text .. num - if #self.tex_num.text == 6 then + if #self.tex_num.text == 6 then self:JoinRoom(self.tex_num.text) end end function FamilyJoinAndCreate:BackNumTex() - - if #self.tex_num.text <= 0 then + if #self.tex_num.text <= 0 then return end local cur = #self.tex_num.text - self.tex_num.text = string.sub(self.tex_num.text, 0, cur -1) + self.tex_num.text = string.sub(self.tex_num.text, 0, cur - 1) end function FamilyJoinAndCreate:ClearNumTex() @@ -117,25 +123,12 @@ function FamilyJoinAndCreate:ClearNumTex() end function FamilyJoinAndCreate:JoinRoom(roomId) - local fgCtr = ControllerManager.GetController(NewGroupController) - --后端似乎还未调通 self:ClearNumTex() - fgCtr:FG_JoinGroup(tonumber(roomId), function(res) - if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode) - end - end) - --先换成邀请玩家 - -- fgCtr:FG_AddMember(self._group.id, tonumber(roomId), function(res) - -- if (res.ReturnCode == 0) then - -- ViewUtil.ShowBannerOnScreenCenter('添加成功!', 1) - -- else - -- ViewUtil.ErrorTip(res.ReturnCode, '邀请玩家失败!') - -- end - -- self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num1, false, - -- 1) - -- end) + local win = tipsWindow.New() + win:Show("提交申请", "请输入申请信息", function(remark) + SendJoinRoom(self, roomId, remark) + end) end return FamilyJoinAndCreate diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index 670f6410..123de8e5 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -76,7 +76,7 @@ end function FamilyMyFamily:Refalsh() self.family = DataManager.groups.groupMap[self.groupId] - self.tex_fName.text = self.family.name + self.tex_fName.text = Utils.TextOmit(self.family.name, 6) self.tex_playerName.text = "亲友圈号:" .. self.family.id self.tex_fNumber.text = self.family.member_num self.tex_cradNum.text = self.family.diamo diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua index 4781a6a9..b208db05 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua @@ -71,6 +71,7 @@ function FamilyMyfamilyList:Init() local loader_icon = obj:GetChild("loader_icon") tex_familyId.text = group.id + tex_familyName.emojies = EmojiDitc.EmojiesDitc tex_familyName.text = Utils.TextOmit(group.name, 6) tex_familyNumber.text = group.total_member_num ImageLoad.Load(group.o_portrait, loader_icon) diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua index b4195037..4749962f 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua @@ -54,13 +54,15 @@ function FamilyNumberRecord.New(root, page) self.ctr_numberRecord = self._view:GetController('page') self._cte_noPeople = self._view:GetController('noPeople') - self._text_groupTitle = string.format("%s(%s)", root._group.name, group_id) + local groupName = Utils.TextOmit(root._group.name, 6) + self._text_groupTitle = string.format("%s(%s)", groupName, group_id) box_type.items, box_type.values = self:InitBoxType() box_mumberTime.items, box_mumberTime.values = self:InitBoxTime() self.text_score_majiang.text = 0 - self.MJScore self.text_score_poker.text = 0 - self.PKScore + self._viewText_titleRecord.emojies = EmojiDitc.EmojiesDitc self._viewText_titleRecord.text = string.format("%s 成员记录", self._text_groupTitle) self._view:GetChild('text_residueDiamond').text = root._group.diamo self._view:GetChild('text_timeRecord').text = os.date('%Y-%m-%d %H:%M:%S', os.time()) diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua index 0d2a00c4..60402ecc 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua @@ -915,6 +915,8 @@ end function M:InitView(url) BaseView.InitView(self, url) self._full_offset = false + + self._view:GetChild('tex_name').emojies = EmojiDitc.EmojiesDitc -- __showBG(self._view) -- local btndel = self._view:GetChild("btn_del") @@ -969,7 +971,7 @@ function M:InitView(url) self._view:GetChild('tex_id').text = "ID:" .. self.curGroup.id - self._view:GetChild('tex_name').text = self.curGroup.name + self._view:GetChild('tex_name').text = Utils.TextOmit(self.curGroup.name, 6) -- self._view:GetChild('tex_p_name').text = ViewUtil.stringEllipsis(DataManager.SelfUser.nick_name) @@ -1929,7 +1931,7 @@ function M:__refreshPay() end -- self._view:GetChild("tex_name").text = __getLayerName(self,0) - self._view:GetChild('tex_name').text = self.curGroup.name + self._view:GetChild('tex_name').text = Utils.TextOmit(self.curGroup.name, 6) end end diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua index 293264f4..0d77c0bb 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupMainView.lua @@ -157,7 +157,8 @@ local function SortGroups(a, b) end function M:__fill_item(item, group) - item:GetChild('tex_name').text = group.name + item:GetChild('tex_name').emojies = EmojiDitc.EmojiesDitc + item:GetChild('tex_name').text = Utils.TextOmit(group.name, 6) item:GetChild('tex_id').text = "ID:" .. group.id local p_num = group.total_member_num item:GetChild('tex_p_num').text = p_num > 99 and '99+' or p_num diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua index 5d3993fc..46c1a3ae 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupSettingView.lua @@ -88,7 +88,8 @@ function M:FillData() for i = 1, #groups do local group = groups[i] local item = lst_group:AddItemFromPool() - item:GetChild("tex_name").text = group.name + item:GetChild("tex_name").emojies = EmojiDitc.EmojiesDitc + item:GetChild("tex_name").text = Utils.TextOmit(group.name, 6) item:GetChild("tex_id").text = group.id item:GetChild("tex_nick").text ="创建人:" .. group.o_nick item.data = group diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index f80716d6..35daca49 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -2099,6 +2099,17 @@ + + + + + + + + + + + diff --git a/wb_new_ui/assets/Family/Main/Component/btn_familyName.xml b/wb_new_ui/assets/Family/Main/Component/btn_familyName.xml index e4d4d93b..334ec46b 100644 --- a/wb_new_ui/assets/Family/Main/Component/btn_familyName.xml +++ b/wb_new_ui/assets/Family/Main/Component/btn_familyName.xml @@ -8,7 +8,7 @@ - + diff --git a/wb_new_ui/assets/Family/MyFamily/Component/item_myFamilyList.xml b/wb_new_ui/assets/Family/MyFamily/Component/item_myFamilyList.xml index cbace4dd..baf3e75f 100644 --- a/wb_new_ui/assets/Family/MyFamily/Component/item_myFamilyList.xml +++ b/wb_new_ui/assets/Family/MyFamily/Component/item_myFamilyList.xml @@ -10,7 +10,7 @@ - + diff --git a/wb_new_ui/assets/Family/NumberRecord/comp_numberRecord.xml b/wb_new_ui/assets/Family/NumberRecord/comp_numberRecord.xml index 6aebcf54..a41abad1 100644 --- a/wb_new_ui/assets/Family/NumberRecord/comp_numberRecord.xml +++ b/wb_new_ui/assets/Family/NumberRecord/comp_numberRecord.xml @@ -14,9 +14,9 @@ - + - + diff --git a/wb_unity_pro/Assets/ART/base/Family/ui/Family_fui.bytes b/wb_unity_pro/Assets/ART/base/Family/ui/Family_fui.bytes index 786047ae..b0544587 100644 Binary files a/wb_unity_pro/Assets/ART/base/Family/ui/Family_fui.bytes and b/wb_unity_pro/Assets/ART/base/Family/ui/Family_fui.bytes differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0.png index 5475a725..649d9274 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_1.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_1.png index 15f3965c..997bc29d 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_1.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_1.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_10.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_10.png index 75097a82..ab1d72a6 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_10.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_10.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_2.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_2.png index c8b8ca5d..79eef21a 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_2.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_2.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_3.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_3.png index 5889a66c..09789d27 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_3.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_3.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_4.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_4.png index b3f5cef4..33a6dc14 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_4.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_4.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_5.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_5.png index dfe33b42..3d0fc925 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_5.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_5.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_6.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_6.png index a3fd11e8..e6a7bd01 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_6.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_6.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_7.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_7.png index 9df0dd58..d32ee689 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_7.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_7.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_9.png b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_9.png index 459982b6..b672483d 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_9.png and b/wb_unity_pro/Assets/ART/base/common/ui/Common_atlas0_9.png differ diff --git a/wb_unity_pro/Assets/ART/base/common/ui/Common_fui.bytes b/wb_unity_pro/Assets/ART/base/common/ui/Common_fui.bytes index 29aa8b03..6341a89f 100644 Binary files a/wb_unity_pro/Assets/ART/base/common/ui/Common_fui.bytes and b/wb_unity_pro/Assets/ART/base/common/ui/Common_fui.bytes differ diff --git a/wb_unity_pro/Assets/Scripts/Game/EmojiDitc.cs b/wb_unity_pro/Assets/Scripts/Game/EmojiDitc.cs index efa777cc..bc6f1538 100644 --- a/wb_unity_pro/Assets/Scripts/Game/EmojiDitc.cs +++ b/wb_unity_pro/Assets/Scripts/Game/EmojiDitc.cs @@ -9,8 +9,8 @@ public static class EmojiDitc public static void AddEmoji(uint code, string emoji) { - Debug.Log($"add emoji code={code} emoji={emoji}"); - EmojiesDitc.Add(code, new Emoji(emoji)); + //Debug.Log($"add emoji code={code} emoji={emoji}"); + EmojiesDitc.Add(code, new Emoji(emoji, 36 , 36)); } diff --git a/wb_unity_pro/Assets/Scripts/Game/Utils.cs b/wb_unity_pro/Assets/Scripts/Game/Utils.cs index 946781d7..0dac55c0 100644 --- a/wb_unity_pro/Assets/Scripts/Game/Utils.cs +++ b/wb_unity_pro/Assets/Scripts/Game/Utils.cs @@ -7,6 +7,7 @@ using System.Security.Cryptography; using System.Text; using System.Net; using taurus.unity; +using System.Globalization; namespace Game { @@ -136,9 +137,11 @@ namespace Game public static string TextOmit(string str, int num) { - if (str.Length > num) + StringInfo info = new StringInfo(str); + + if (info.LengthInTextElements > num) { - return str.Substring(0, num) + "..."; + return info.SubstringByTextElements(0, 6) + "..."; } return str;