mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: video intro: show detailed owner info
Closes #229 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -334,8 +334,13 @@ class MemberHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future memberCardInfo({int? mid}) async {
|
static Future memberCardInfo({int? mid}) async {
|
||||||
var res = await Request()
|
var res = await Request().get(
|
||||||
.get(Api.memberCardInfo, queryParameters: {'mid': mid, 'photo': true});
|
Api.memberCardInfo,
|
||||||
|
queryParameters: {
|
||||||
|
'mid': mid,
|
||||||
|
'photo': false,
|
||||||
|
},
|
||||||
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/http/member.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/introduction/pay_coins_page.dart';
|
import 'package:PiliPlus/pages/video/detail/introduction/pay_coins_page.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
@@ -197,7 +198,8 @@ class VideoIntroController extends GetxController
|
|||||||
if (videoDetail.value.owner == null) {
|
if (videoDetail.value.owner == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var result = await UserHttp.userStat(mid: videoDetail.value.owner!.mid!);
|
var result =
|
||||||
|
await MemberHttp.memberCardInfo(mid: videoDetail.value.owner!.mid!);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
userStat.value = result['data'];
|
userStat.value = result['data'];
|
||||||
userStat.refresh();
|
userStat.refresh();
|
||||||
|
|||||||
@@ -332,15 +332,53 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
Obx(
|
||||||
type: 'avatar',
|
() => Stack(
|
||||||
src: widget.loadingStatus
|
clipBehavior: Clip.none,
|
||||||
? videoItem['owner']?.face ?? ""
|
children: [
|
||||||
: videoDetail.owner!.face,
|
NetworkImgLayer(
|
||||||
width: 35,
|
type: 'avatar',
|
||||||
height: 35,
|
src: videoIntroController.userStat
|
||||||
fadeInDuration: Duration.zero,
|
.value['card']?['face'] ??
|
||||||
fadeOutDuration: Duration.zero,
|
'',
|
||||||
|
width: 35,
|
||||||
|
height: 35,
|
||||||
|
fadeInDuration: Duration.zero,
|
||||||
|
fadeOutDuration: Duration.zero,
|
||||||
|
),
|
||||||
|
if ((videoIntroController.userStat
|
||||||
|
.value['card']
|
||||||
|
?['official_verify']
|
||||||
|
?['type'] ??
|
||||||
|
-1) !=
|
||||||
|
-1)
|
||||||
|
Positioned(
|
||||||
|
right: -2,
|
||||||
|
bottom: -2,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.surface,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.offline_bolt,
|
||||||
|
color: videoIntroController
|
||||||
|
.userStat
|
||||||
|
.value[
|
||||||
|
'card']?['vip']
|
||||||
|
['status'] ==
|
||||||
|
0
|
||||||
|
? Colors.yellow
|
||||||
|
: Colors
|
||||||
|
.lightBlueAccent,
|
||||||
|
size: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -348,23 +386,39 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Obx(
|
||||||
widget.loadingStatus
|
() => Text(
|
||||||
? videoItem['owner']?.name ??
|
videoIntroController.userStat
|
||||||
""
|
.value['card']
|
||||||
: videoDetail.owner!.name,
|
?['name'] ??
|
||||||
maxLines: 1,
|
"",
|
||||||
overflow: TextOverflow.ellipsis,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
overflow: TextOverflow.ellipsis,
|
||||||
fontSize: 13,
|
style: TextStyle(
|
||||||
// color: t.colorScheme.primary,
|
fontSize: 13,
|
||||||
|
color: (videoIntroController
|
||||||
|
.userStat
|
||||||
|
.value['card']?['vip']
|
||||||
|
?[
|
||||||
|
'status'] ??
|
||||||
|
-1) >
|
||||||
|
0 &&
|
||||||
|
(videoIntroController
|
||||||
|
.userStat
|
||||||
|
.value['card']?['vip']
|
||||||
|
?[
|
||||||
|
'type'] ??
|
||||||
|
-1) ==
|
||||||
|
2
|
||||||
|
? context.vipColor
|
||||||
|
: null,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// semanticsLabel: "UP主:${owner.name}",
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 0),
|
const SizedBox(height: 0),
|
||||||
Obx(
|
Obx(
|
||||||
() => Text(
|
() => Text(
|
||||||
'${Utils.numFormat(videoIntroController.userStat.value['follower'])}粉丝',
|
'${Utils.numFormat(videoIntroController.userStat.value['follower'])}粉丝 ${videoIntroController.userStat.value['archive_count'] != null ? '${Utils.numFormat(videoIntroController.userStat.value['archive_count'])}视频' : ''}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: t.colorScheme.outline,
|
color: t.colorScheme.outline,
|
||||||
@@ -414,7 +468,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
fadeInDuration: Duration.zero,
|
fadeInDuration: Duration.zero,
|
||||||
fadeOutDuration: Duration.zero,
|
fadeOutDuration: Duration.zero,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 5),
|
const SizedBox(width: 8),
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
|
|||||||
Reference in New Issue
Block a user