feat: 动态页面跳转个人主页

This commit is contained in:
guozhigq
2023-07-15 23:24:02 +08:00
parent a23103eb69
commit a0427c672b
10 changed files with 67 additions and 42 deletions

View File

@ -572,17 +572,20 @@ class RichTextNodeItem {
this.origText,
this.text,
this.type,
this.rid,
});
Emoji? emoji;
String? origText;
String? text;
String? type;
String? rid;
RichTextNodeItem.fromJson(Map<String, dynamic> json) {
emoji = json['emoji'] != null ? Emoji.fromJson(json['emoji']) : null;
origText = json['orig_text'];
text = json['text'];
type = json['type'];
rid = json['rid'];
}
}

View File

@ -93,13 +93,11 @@ class DynamicsController extends GetxController {
break;
case 'DYNAMIC_TYPE_AV':
String bvid = item.modules.moduleDynamic.major.archive.bvid;
int aid = item.modules.moduleDynamic.major.archive.aid;
String cover = item.modules.moduleDynamic.major.archive.cover;
String heroTag = Utils.makeHeroTag(aid);
try {
int cid = await SearchHttp.ab2c(bvid: bvid);
Get.toNamed('/video?bvid=$bvid&cid=$cid',
arguments: {'pic': cover, 'heroTag': heroTag});
arguments: {'pic': cover, 'heroTag': bvid});
} catch (err) {
SmartDialog.showToast(err.toString());
}
@ -136,6 +134,10 @@ class DynamicsController extends GetxController {
'heroTag': liveItem.roomId.toString()
});
break;
/// TODO
case 'DYNAMIC_TYPE_UGC_SEASON':
print('合集');
}
}

View File

@ -1,6 +1,7 @@
// 转发
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
import 'package:pilipala/utils/utils.dart';
import 'additional_panel.dart';
@ -24,7 +25,9 @@ Widget forWard(item, context, ctr, source, {floor = 1}) {
Row(
children: [
GestureDetector(
onTap: () {},
onTap: () => Get.toNamed(
'/member?mid=${item.modules.moduleAuthor.mid}',
arguments: {'face': item.modules.moduleAuthor.face}),
child: Text(
'@${item.modules.moduleAuthor.name}',
style: authorStyle,
@ -110,7 +113,9 @@ Widget forWard(item, context, ctr, source, {floor = 1}) {
Row(
children: [
GestureDetector(
onTap: () {},
onTap: () => Get.toNamed(
'/member?mid=${item.modules.moduleAuthor.mid}',
arguments: {'face': item.modules.moduleAuthor.face}),
child: Text(
'@${item.modules.moduleAuthor.name}',
style: authorStyle,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pilipala/common/constants.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart';
import 'package:pilipala/utils/utils.dart';
@ -16,7 +17,9 @@ Widget livePanel(item, context, {floor = 1}) {
Row(
children: [
GestureDetector(
onTap: () {},
onTap: () => Get.toNamed(
'/member?mid=${item.modules.moduleAuthor.mid}',
arguments: {'face': item.modules.moduleAuthor.face}),
child: Text(
'@${item.modules.moduleAuthor.name}',
style: authorStyle,

View File

@ -23,7 +23,9 @@ Widget liveRcmdPanel(item, context, {floor = 1}) {
Row(
children: [
GestureDetector(
onTap: () {},
onTap: () => Get.toNamed(
'/member?mid=${item.modules.moduleAuthor.mid}',
arguments: {'face': item.modules.moduleAuthor.face}),
child: Text(
'@${item.modules.moduleAuthor.name}',
style: authorStyle,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart';
// 富文本
@ -20,9 +21,10 @@ InlineSpan richNode(item, context) {
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () {},
onTap: () => Get.toNamed('/member?mid=${i.rid}',
arguments: {'face': null}),
child: Text(
'${i.text}',
' ${i.text}',
style: authorStyle,
),
),

View File

@ -164,8 +164,9 @@ class _UpPanelState extends State<UpPanel> {
padding: const EdgeInsets.only(left: 6, right: 6),
isLabelVisible: data.type == 'live' ||
(data.type == 'up' && (data.hasUpdate ?? false)),
backgroundColor:
Theme.of(context).colorScheme.secondaryContainer,
backgroundColor: data.type == 'live'
? Theme.of(context).colorScheme.secondaryContainer
: Theme.of(context).colorScheme.primary,
child: NetworkImgLayer(
width: 49,
height: 49,

View File

@ -1,5 +1,6 @@
// 视频or合集
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pilipala/common/constants.dart';
import 'package:pilipala/common/widgets/badge.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart';
@ -32,7 +33,9 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
Row(
children: [
GestureDetector(
onTap: () {},
onTap: () => Get.toNamed(
'/member?mid=${item.modules.moduleAuthor.mid}',
arguments: {'face': item.modules.moduleAuthor.face}),
child: Text(
item.modules.moduleAuthor.type == null
? '@${item.modules.moduleAuthor.name}'
@ -76,12 +79,15 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
double width = box.maxWidth;
return Stack(
children: [
NetworkImgLayer(
Hero(
tag: content.bvid,
child: NetworkImgLayer(
type: floor == 1 ? 'emote' : null,
width: width,
height: width / StyleString.aspectRatio,
src: content.cover,
),
),
if (content.badge != null && type == 'pgc')
pBadge(content.badge['text'], context, 8.0, 10.0, null, null),
Positioned(

View File

@ -19,8 +19,8 @@ class MemberController extends GetxController {
super.onInit();
mid = int.parse(Get.parameters['mid']!);
ownerMid = user.get(UserBoxKey.userMid);
face = Get.arguments['face']!;
heroTag = Get.arguments['heroTag']!;
face = Get.arguments['face'] ?? '';
heroTag = Get.arguments['heroTag'] ?? '';
}
// 获取用户信息

View File

@ -50,6 +50,7 @@ class _MemberPageState extends State<MemberPage>
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
if (_memberController.face != null)
Positioned.fill(
bottom: 10,
child: Container(