6字省略

master
DESKTOP-7R8JEQQ\k 2025-07-22 20:00:07 +08:00
parent 9fc9ba2315
commit c901948e97
26 changed files with 65 additions and 50 deletions

View File

@ -109,10 +109,11 @@ function M:FG_ExitGroup(group_id, callback)
end end
--加入圈 --加入圈
function M:FG_JoinGroup(id, callback) function M:FG_JoinGroup(id, callback, remark)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = id data.id = id
data.remark = remark
_client:send(Protocol.WEB_FG_JOIN_GROUP, data, function(res) _client:send(Protocol.WEB_FG_JOIN_GROUP, data, function(res)
callback(res) callback(res)
end) end)

View File

@ -1,8 +1,19 @@
local tipsWindow = import("..Common.tipsWindow")
local FamilyJoinAndCreate = {} 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) function FamilyJoinAndCreate:init(root)
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
--local createOrJoin = self._view:GetController('createOrJoin')
self._view = root._view:GetChild('com_createAndJoin') self._view = root._view:GetChild('com_createAndJoin')
self.style = self._view:GetController('cStyle') self.style = self._view:GetController('cStyle')
@ -18,21 +29,17 @@ function FamilyJoinAndCreate:init(root)
self.input_wxId.emojies = EmojiDitc.EmojiesDitc self.input_wxId.emojies = EmojiDitc.EmojiesDitc
self._view:GetChild('btn_create').onClick:Add(function() self._view:GetChild('btn_create').onClick:Add(function()
if self.style.selectedIndex ~= 1 then
if self.style.selectedIndex ~= 1 then
self.style.selectedIndex = 1 self.style.selectedIndex = 1
return return
end end
end) end)
self._view:GetChild('btn_join').onClick:Add(function() self._view:GetChild('btn_join').onClick:Add(function()
if self.style.selectedIndex ~= 0 then
if self.style.selectedIndex ~= 0 then
self.style.selectedIndex = 0 self.style.selectedIndex = 0
return return
end end
--self:JoinRoom(self.tex_num.text)
end) end)
self._view:GetChild('btn_c').onClick:Add(function() self._view:GetChild('btn_c').onClick:Add(function()
@ -55,30 +62,30 @@ function FamilyJoinAndCreate:KeyBoardInit()
print("self.list_keyBoard.numItems", self.list_keyBoard.numItems) 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 btn = self.list_keyBoard:GetChildAt(i)
local btnStyle = btn:GetController('cStyle') local btnStyle = btn:GetController('cStyle')
local num = i + 1 local num = i + 1
if num <= 9 then if num <= 9 then
btn:GetChild('text_num').text = num btn:GetChild('text_num').text = num
btn.onClick:Set(function() btn.onClick:Set(function()
print(num) print(num)
self:NumTexInput(num) self:NumTexInput(num)
end) end)
elseif num == 10 then elseif num == 10 then
btnStyle.selectedIndex = 1 btnStyle.selectedIndex = 1
btn.onClick:Set(function() btn.onClick:Set(function()
print(i) print(i)
self:ClearNumTex() self:ClearNumTex()
end) end)
elseif num == 11 then elseif num == 11 then
btn:GetChild('text_num').text = 0 btn:GetChild('text_num').text = 0
btn.onClick:Set(function() btn.onClick:Set(function()
print(num) print(num)
self:NumTexInput(0) self:NumTexInput(0)
end) end)
elseif num == 12 then elseif num == 12 then
btnStyle.selectedIndex = 2 btnStyle.selectedIndex = 2
btn.onClick:Set(function() btn.onClick:Set(function()
print(num) print(num)
@ -89,26 +96,25 @@ function FamilyJoinAndCreate:KeyBoardInit()
end end
function FamilyJoinAndCreate:NumTexInput(num) 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) self.tex_num.text = string.sub(self.tex_num.text, 1, 6)
return return
end end
self.tex_num.text = self.tex_num.text .. num 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) self:JoinRoom(self.tex_num.text)
end end
end end
function FamilyJoinAndCreate:BackNumTex() function FamilyJoinAndCreate:BackNumTex()
if #self.tex_num.text <= 0 then
if #self.tex_num.text <= 0 then
return return
end end
local cur = #self.tex_num.text 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 end
function FamilyJoinAndCreate:ClearNumTex() function FamilyJoinAndCreate:ClearNumTex()
@ -117,25 +123,12 @@ function FamilyJoinAndCreate:ClearNumTex()
end end
function FamilyJoinAndCreate:JoinRoom(roomId) function FamilyJoinAndCreate:JoinRoom(roomId)
local fgCtr = ControllerManager.GetController(NewGroupController)
--后端似乎还未调通
self:ClearNumTex() 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, local win = tipsWindow.New()
-- 1) win:Show("提交申请", "请输入申请信息", function(remark)
-- end) SendJoinRoom(self, roomId, remark)
end)
end end
return FamilyJoinAndCreate return FamilyJoinAndCreate

View File

@ -76,7 +76,7 @@ end
function FamilyMyFamily:Refalsh() function FamilyMyFamily:Refalsh()
self.family = DataManager.groups.groupMap[self.groupId] 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_playerName.text = "亲友圈号:" .. self.family.id
self.tex_fNumber.text = self.family.member_num self.tex_fNumber.text = self.family.member_num
self.tex_cradNum.text = self.family.diamo self.tex_cradNum.text = self.family.diamo

View File

@ -71,6 +71,7 @@ function FamilyMyfamilyList:Init()
local loader_icon = obj:GetChild("loader_icon") local loader_icon = obj:GetChild("loader_icon")
tex_familyId.text = group.id tex_familyId.text = group.id
tex_familyName.emojies = EmojiDitc.EmojiesDitc
tex_familyName.text = Utils.TextOmit(group.name, 6) tex_familyName.text = Utils.TextOmit(group.name, 6)
tex_familyNumber.text = group.total_member_num tex_familyNumber.text = group.total_member_num
ImageLoad.Load(group.o_portrait, loader_icon) ImageLoad.Load(group.o_portrait, loader_icon)

View File

@ -54,13 +54,15 @@ function FamilyNumberRecord.New(root, page)
self.ctr_numberRecord = self._view:GetController('page') self.ctr_numberRecord = self._view:GetController('page')
self._cte_noPeople = self._view:GetController('noPeople') 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_type.items, box_type.values = self:InitBoxType()
box_mumberTime.items, box_mumberTime.values = self:InitBoxTime() box_mumberTime.items, box_mumberTime.values = self:InitBoxTime()
self.text_score_majiang.text = 0 - self.MJScore self.text_score_majiang.text = 0 - self.MJScore
self.text_score_poker.text = 0 - self.PKScore 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._viewText_titleRecord.text = string.format("%s 成员记录", self._text_groupTitle)
self._view:GetChild('text_residueDiamond').text = root._group.diamo 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()) self._view:GetChild('text_timeRecord').text = os.date('%Y-%m-%d %H:%M:%S', os.time())

View File

@ -915,6 +915,8 @@ end
function M:InitView(url) function M:InitView(url)
BaseView.InitView(self, url) BaseView.InitView(self, url)
self._full_offset = false self._full_offset = false
self._view:GetChild('tex_name').emojies = EmojiDitc.EmojiesDitc
-- __showBG(self._view) -- __showBG(self._view)
-- local btndel = self._view:GetChild("btn_del") -- 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_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) -- self._view:GetChild('tex_p_name').text = ViewUtil.stringEllipsis(DataManager.SelfUser.nick_name)
@ -1929,7 +1931,7 @@ function M:__refreshPay()
end end
-- self._view:GetChild("tex_name").text = __getLayerName(self,0) -- 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
end end

View File

@ -157,7 +157,8 @@ local function SortGroups(a, b)
end end
function M:__fill_item(item, group) 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 item:GetChild('tex_id').text = "ID:" .. group.id
local p_num = group.total_member_num local p_num = group.total_member_num
item:GetChild('tex_p_num').text = p_num > 99 and '99+' or p_num item:GetChild('tex_p_num').text = p_num > 99 and '99+' or p_num

View File

@ -88,7 +88,8 @@ function M:FillData()
for i = 1, #groups do for i = 1, #groups do
local group = groups[i] local group = groups[i]
local item = lst_group:AddItemFromPool() 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_id").text = group.id
item:GetChild("tex_nick").text ="创建人:" .. group.o_nick item:GetChild("tex_nick").text ="创建人:" .. group.o_nick
item.data = group item.data = group

View File

@ -2099,6 +2099,17 @@
<image id="qmc17jby" name="egg.png" path="/images/Emojies2/" exported="true" disableTrim="true"/> <image id="qmc17jby" name="egg.png" path="/images/Emojies2/" exported="true" disableTrim="true"/>
<image id="qmc17jbz" name="loginBg.png" path="/bg/" exported="true" atlas="alone"/> <image id="qmc17jbz" name="loginBg.png" path="/bg/" exported="true" atlas="alone"/>
<movieclip id="uans7jc0" name="MovieClip3.jta" path="/window/Component/"/> <movieclip id="uans7jc0" name="MovieClip3.jta" path="/window/Component/"/>
<component id="brmc7jc1" name="tips.xml" path="/window/" exported="true"/>
<component id="brmc7jc2" name="btn_bg.xml" path="/MyFamily/Component/"/>
<image id="brmc7jc3" name="Rectangle 39.png" path="/MyFamily/Image/" scale="9grid" scale9grid="59,53,51,62"/>
<image id="brmc7jc4" name="Rectangle 40.png" path="/MyFamily/Image/" scale="9grid" scale9grid="28,23,56,46"/>
<image id="brmc7jc5" name="title_top.png" path="/RoomCrad/Image/"/>
<component id="brmc7jc6" name="btn_quitNotice.xml" path="/MyFamily/Component/"/>
<image id="brmc7jc7" name="CommonRes_3.png" path="/MyFamily/Image/"/>
<image id="brmc7jc8" name="Rectangle 267.png" path="/MyFamily/Image/" scale="9grid" scale9grid="41,37,13,14"/>
<component id="brmc7jc9" name="btn_confirmNotice.xml" path="/MyFamily/Component/"/>
<image id="brmc7jca" name="hall_club_common_btntext_queding.png" path="/MyFamily/Image/"/>
<image id="brmc7jcb" name="Rectangle 113.png" path="/window/Image/" scale="9grid" scale9grid="39,37,82,77"/>
</resources> </resources>
<publish name="Common" path="..\wb_unity_pro\Assets\ART\base\common\ui" packageCount="2" maxAtlasSize="2048"> <publish name="Common" path="..\wb_unity_pro\Assets\ART\base\common\ui" packageCount="2" maxAtlasSize="2048">
<atlas name="默认" index="0"/> <atlas name="默认" index="0"/>

View File

@ -8,7 +8,7 @@
<image id="n8_jrro" name="n8" src="jrro7cyb" fileName="Main/Image/btn_familyName_off.png" xy="0,0"> <image id="n8_jrro" name="n8" src="jrro7cyb" fileName="Main/Image/btn_familyName_off.png" xy="0,0">
<gearDisplay controller="button" pages="0"/> <gearDisplay controller="button" pages="0"/>
</image> </image>
<richtext id="n9_jrro" name="title" xy="-1,18" size="296,56" font="ui://27vd145bh35o7iln" fontSize="42" color="#2c1f16" align="center" autoSize="none" text="亲友圈名称名称名友圈名称名称名"> <richtext id="n9_jrro" name="title" xy="-1,18" size="296,56" font="ui://27vd145bh35o7iln" fontSize="42" color="#2c1f16" align="center" vAlign="middle" autoSize="none" text="亲友圈名称名称名友圈名称名称名">
<relation target="" sidePair="center-center,middle-middle"/> <relation target="" sidePair="center-center,middle-middle"/>
</richtext> </richtext>
</displayList> </displayList>

View File

@ -10,7 +10,7 @@
<loader id="n1_yk1o" name="loader_icon" xy="30,24" size="186,186" group="n10_q3uh" align="center" vAlign="middle" fill="scaleMatchHeight"/> <loader id="n1_yk1o" name="loader_icon" xy="30,24" size="186,186" group="n10_q3uh" align="center" vAlign="middle" fill="scaleMatchHeight"/>
<image id="n6_yk1o" name="n6" src="yk1o7d40" fileName="MyFamily/Image/hall_club_common_club_liebiao_icon_renshu.png" xy="555,54" group="n10_q3uh"/> <image id="n6_yk1o" name="n6" src="yk1o7d40" fileName="MyFamily/Image/hall_club_common_club_liebiao_icon_renshu.png" xy="555,54" group="n10_q3uh"/>
<text id="n7_yk1o" name="tex_familyId" xy="282,52" size="243,49" group="n10_q3uh" font="ui://27vd145bg2mo7ij0" fontSize="36" color="#940f0e" vAlign="middle" autoSize="none" text="940F0E"/> <text id="n7_yk1o" name="tex_familyId" xy="282,52" size="243,49" group="n10_q3uh" font="ui://27vd145bg2mo7ij0" fontSize="36" color="#940f0e" vAlign="middle" autoSize="none" text="940F0E"/>
<text id="n8_yk1o" name="tex_familyName" xy="282,112" size="392,64" group="n10_q3uh" font="ui://27vd145bg2mo7ij0" fontSize="48" color="#333333" vAlign="middle" autoSize="none" text="家族名字家族名字"/> <richtext id="n8_yk1o" name="tex_familyName" xy="282,112" size="392,64" group="n10_q3uh" font="ui://27vd145bg2mo7ij0" fontSize="48" color="#333333" vAlign="middle" autoSize="none" text="家族名字家族名字"/>
<text id="n9_yk1o" name="tex_familyNumber" xy="595,43" size="272,56" group="n10_q3uh" font="ui://27vd145bg2mo7ij0" fontSize="42" color="#333333" vAlign="middle" autoSize="none" text="333333"/> <text id="n9_yk1o" name="tex_familyNumber" xy="595,43" size="272,56" group="n10_q3uh" font="ui://27vd145bg2mo7ij0" fontSize="42" color="#333333" vAlign="middle" autoSize="none" text="333333"/>
<group id="n10_q3uh" name="n10" xy="30,24" size="837,186" advanced="true"> <group id="n10_q3uh" name="n10" xy="30,24" size="837,186" advanced="true">
<relation target="" sidePair="left-left"/> <relation target="" sidePair="left-left"/>

View File

@ -14,9 +14,9 @@
<relation target="" sidePair="right-left,top-top,rightext-right"/> <relation target="" sidePair="right-left,top-top,rightext-right"/>
</image> </image>
<group id="n173_g71b" name="n173" xy="0,0" size="2532,1170" group="n73_lgoh"/> <group id="n173_g71b" name="n173" xy="0,0" size="2532,1170" group="n73_lgoh"/>
<text id="n0_lgoh" name="text_titleRecord" xy="264,22" size="2002,102" group="n73_lgoh" font="ui://27vd145bg2mo7ij0" fontSize="72" color="#ffffff" align="center" autoSize="none" shadowColor="#4c5058" shadowOffset="3,3" text="亲友圈xxxx123456成员记录"> <richtext id="n0_lgoh" name="text_titleRecord" xy="264,22" size="2002,102" group="n73_lgoh" font="ui://27vd145bg2mo7ij0" fontSize="72" color="#ffffff" align="center" autoSize="none" shadowColor="#4c5058" shadowOffset="3,3" text="亲友圈xxxx123456成员记录">
<relation target="" sidePair="center-center"/> <relation target="" sidePair="center-center"/>
</text> </richtext>
<image id="n1_lgoh" name="n1" src="mc627d05" fileName="Main/Image/Rectangle 91.png" xy="23,193" size="2484,960" group="n4_lgoh"/> <image id="n1_lgoh" name="n1" src="mc627d05" fileName="Main/Image/Rectangle 91.png" xy="23,193" size="2484,960" group="n4_lgoh"/>
<image id="n2_lgoh" name="n2" src="mc627d04" fileName="NumberRecord/Image/Rectangle 112.png" xy="38,211" size="2454,924" group="n4_lgoh"/> <image id="n2_lgoh" name="n2" src="mc627d04" fileName="NumberRecord/Image/Rectangle 112.png" xy="38,211" size="2454,924" group="n4_lgoh"/>
<image id="n3_lgoh" name="n3" src="mc627d07" fileName="NumberRecord/Image/image(1).png" xy="59,445" size="2412,678" group="n4_lgoh"/> <image id="n3_lgoh" name="n3" src="mc627d07" fileName="NumberRecord/Image/image(1).png" xy="59,445" size="2412,678" group="n4_lgoh"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

After

Width:  |  Height:  |  Size: 5.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 692 KiB

After

Width:  |  Height:  |  Size: 984 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 KiB

After

Width:  |  Height:  |  Size: 789 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 927 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 KiB

After

Width:  |  Height:  |  Size: 482 KiB

View File

@ -9,8 +9,8 @@ public static class EmojiDitc
public static void AddEmoji(uint code, string emoji) public static void AddEmoji(uint code, string emoji)
{ {
Debug.Log($"add emoji code={code} emoji={emoji}"); //Debug.Log($"add emoji code={code} emoji={emoji}");
EmojiesDitc.Add(code, new Emoji(emoji)); EmojiesDitc.Add(code, new Emoji(emoji, 36 , 36));
} }

View File

@ -7,6 +7,7 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Net; using System.Net;
using taurus.unity; using taurus.unity;
using System.Globalization;
namespace Game namespace Game
{ {
@ -136,9 +137,11 @@ namespace Game
public static string TextOmit(string str, int num) 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; return str;