Commit c99ff78b authored by xiaoye's avatar xiaoye

update copy QQ

parent 521b3b81
Pipeline #38199 passed with stages
in 1 minute and 22 seconds
...@@ -487,9 +487,9 @@ ...@@ -487,9 +487,9 @@
match.array.filter(i => i.round == round).forEach((i, v) => { match.array.filter(i => i.round == round).forEach((i, v) => {
if (i.player1.id || i.player2.id) { if (i.player1.id || i.player2.id) {
string += `[${v + 1}]组\n`; string += `[${v + 1}]组\n`;
string += `\t[选手A][${i.player1.fullName ?? ''}]\n`; string += `\t[选手A][${i.player1.name ?? ''}]${i.player1.qq ? `[${i.player1.qq}]` : ''}\n`;
string += `\t[比 分][${i.status == 'Finished' ? `${i.player1.score} : ${i.player2.score}` : 'VS'}]\n`; string += `\t[比 分][${i.status == 'Finished' ? `${i.player1.score} : ${i.player2.score}` : 'VS'}]\n`;
string += `\t[选手B][${i.player2.fullName ?? ''}]\n`; string += `\t[选手B][${i.player2.name ?? ''}]${i.player2.qq ? `[${i.player2.qq}]` : ''}\n`;
} }
}); });
} }
...@@ -666,7 +666,7 @@ ...@@ -666,7 +666,7 @@
]); ]);
for (let i = 0; i < copyValue; i++) { for (let i = 0; i < copyValue; i++) {
let p = participant.array[i]; let p = participant.array[i];
string += `[${map.get(i) ?? `${i + 1}名`}]${p.fullName}\n` string += `[${map.get(i) ?? `${i + 1}名`}][${p.name}]${p.qq ? `[${p.qq}]` : ''}\n`
} }
UniApp.copy(string); UniApp.copy(string);
}, },
......
...@@ -5,7 +5,7 @@ interface player { ...@@ -5,7 +5,7 @@ interface player {
id : number; id : number;
score : number; score : number;
name : string; name : string;
fullName : string; qq : string | undefined;
} }
class Match { class Match {
...@@ -29,14 +29,14 @@ class Match { ...@@ -29,14 +29,14 @@ class Match {
this.player1 = { this.player1 = {
id : obj.player1Id, id : obj.player1Id,
name : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[1] : obj.player1?.name ?? '', name : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[1] : obj.player1?.name ?? '',
fullName : obj.player1?.name ?? '', qq : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[0] : undefined,
score : obj.player1Score score : obj.player1Score
}; };
const name2 = obj.player2?.name.split(/[\+\uFF0B]/) ?? []; const name2 = obj.player2?.name.split(/[\+\uFF0B]/) ?? [];
this.player2 = { this.player2 = {
id : obj.player2Id, id : obj.player2Id,
name : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name2[1] : obj.player2?.name ?? '', name : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name2[1] : obj.player2?.name ?? '',
fullName : obj.player2?.name ?? '', qq : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name1[0] : undefined,
score : obj.player2Score score : obj.player2Score
}; };
this.winnerId = obj.winnerId as number | null; this.winnerId = obj.winnerId as number | null;
......
...@@ -5,7 +5,7 @@ import { Base64 } from 'js-base64'; ...@@ -5,7 +5,7 @@ import { Base64 } from 'js-base64';
class Participant { class Participant {
id : number; id : number;
name : string; name : string;
fullName : string; qq : string | undefined;
quit : boolean; quit : boolean;
tournamentId : number; tournamentId : number;
score : Score; score : Score;
...@@ -13,9 +13,9 @@ class Participant { ...@@ -13,9 +13,9 @@ class Participant {
deck : YGOProDeck | undefined; deck : YGOProDeck | undefined;
constructor(obj: ParticipantObject) { constructor(obj: ParticipantObject) {
this.fullName = obj.name;
const name = obj.name.split(/[\+\uFF0B]/); const name = obj.name.split(/[\+\uFF0B]/);
this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name; this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name;
this.qq = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[0] : undefined;
this.tournamentId = obj.tournamentId; this.tournamentId = obj.tournamentId;
this.id = obj.id; this.id = obj.id;
this.score = obj.score; this.score = obj.score;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment