Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-23 09:04:37 +08:00
parent faaffd0f30
commit d69649f1b6
4 changed files with 13 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
import 'package:PiliPlus/models/model_avatar.dart';
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models/model_video.dart';
import 'package:PiliPlus/utils/duration_util.dart';
@@ -164,7 +165,7 @@ class SearchUserItemModel {
int? isUpUser;
int? isLive;
int? roomId;
Map? officialVerify;
BaseOfficialVerify? officialVerify;
int? isSeniorMember;
SearchUserItemModel.fromJson(Map<String, dynamic> json) {
@@ -183,7 +184,9 @@ class SearchUserItemModel {
isUpUser = json['is_upuser'];
isLive = json['is_live'];
roomId = json['room_id'];
officialVerify = json['official_verify'];
officialVerify = json['official_verify'] == null
? null
: BaseOfficialVerify.fromJson(json['official_verify']);
isSeniorMember = json['is_senior_member'];
}
}

View File

@@ -6,7 +6,7 @@ class Card {
String? face;
int? fans;
int? attention;
BaseOfficialVerify? officialVerify;
BaseOfficialVerify? official;
Vip? vip;
Card({
@@ -15,7 +15,7 @@ class Card {
this.face,
this.fans,
this.attention,
this.officialVerify,
this.official,
this.vip,
});
@@ -25,10 +25,10 @@ class Card {
face: json['face'] as String?,
fans: json['fans'] as int?,
attention: json['attention'] as int?,
officialVerify: json['official_verify'] == null
official: json['Official'] == null
? null
: BaseOfficialVerify.fromJson(
json['official_verify'] as Map<String, dynamic>,
json['Official'] as Map<String, dynamic>,
),
vip: json['vip'] == null
? null

View File

@@ -30,7 +30,7 @@ class SearchUserItem extends StatelessWidget {
avatar: item.upic,
size: 42,
isVip: false,
officialType: item.officialVerify?['type'],
officialType: item.officialVerify?.type,
roomId: item.isLive == 1 ? item.roomId : null,
),
const SizedBox(width: 10),
@@ -59,10 +59,9 @@ class SearchUserItem extends StatelessWidget {
'粉丝:${NumUtil.numFormat(item.fans)} 视频:${NumUtil.numFormat(item.videos)}',
style: style,
),
if (item.officialVerify?['desc'] != null &&
item.officialVerify?['desc'] != '')
if (item.officialVerify?.desc?.isNotEmpty == true)
Text(
item.officialVerify?['desc'],
item.officialVerify!.desc!,
style: style,
),
],

View File

@@ -815,7 +815,7 @@ class _UgcIntroPanelState extends TripleState<UgcIntroPanel>
size: 35,
badgeSize: 14,
isVip: isVip,
officialType: userStat.card?.officialVerify?.type,
officialType: userStat.card?.official?.type,
),
const SizedBox(width: 10),
Column(