feat: 动态页面跳转个人主页
This commit is contained in:
@ -572,17 +572,20 @@ class RichTextNodeItem {
|
|||||||
this.origText,
|
this.origText,
|
||||||
this.text,
|
this.text,
|
||||||
this.type,
|
this.type,
|
||||||
|
this.rid,
|
||||||
});
|
});
|
||||||
Emoji? emoji;
|
Emoji? emoji;
|
||||||
String? origText;
|
String? origText;
|
||||||
String? text;
|
String? text;
|
||||||
String? type;
|
String? type;
|
||||||
|
String? rid;
|
||||||
|
|
||||||
RichTextNodeItem.fromJson(Map<String, dynamic> json) {
|
RichTextNodeItem.fromJson(Map<String, dynamic> json) {
|
||||||
emoji = json['emoji'] != null ? Emoji.fromJson(json['emoji']) : null;
|
emoji = json['emoji'] != null ? Emoji.fromJson(json['emoji']) : null;
|
||||||
origText = json['orig_text'];
|
origText = json['orig_text'];
|
||||||
text = json['text'];
|
text = json['text'];
|
||||||
type = json['type'];
|
type = json['type'];
|
||||||
|
rid = json['rid'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,13 +93,11 @@ class DynamicsController extends GetxController {
|
|||||||
break;
|
break;
|
||||||
case 'DYNAMIC_TYPE_AV':
|
case 'DYNAMIC_TYPE_AV':
|
||||||
String bvid = item.modules.moduleDynamic.major.archive.bvid;
|
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 cover = item.modules.moduleDynamic.major.archive.cover;
|
||||||
String heroTag = Utils.makeHeroTag(aid);
|
|
||||||
try {
|
try {
|
||||||
int cid = await SearchHttp.ab2c(bvid: bvid);
|
int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||||
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
||||||
arguments: {'pic': cover, 'heroTag': heroTag});
|
arguments: {'pic': cover, 'heroTag': bvid});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
SmartDialog.showToast(err.toString());
|
SmartDialog.showToast(err.toString());
|
||||||
}
|
}
|
||||||
@ -136,6 +134,10 @@ class DynamicsController extends GetxController {
|
|||||||
'heroTag': liveItem.roomId.toString()
|
'heroTag': liveItem.roomId.toString()
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/// TODO
|
||||||
|
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||||
|
print('合集');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// 转发
|
// 转发
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
import 'additional_panel.dart';
|
import 'additional_panel.dart';
|
||||||
@ -24,7 +25,9 @@ Widget forWard(item, context, ctr, source, {floor = 1}) {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () => Get.toNamed(
|
||||||
|
'/member?mid=${item.modules.moduleAuthor.mid}',
|
||||||
|
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||||
child: Text(
|
child: Text(
|
||||||
'@${item.modules.moduleAuthor.name}',
|
'@${item.modules.moduleAuthor.name}',
|
||||||
style: authorStyle,
|
style: authorStyle,
|
||||||
@ -110,7 +113,9 @@ Widget forWard(item, context, ctr, source, {floor = 1}) {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () => Get.toNamed(
|
||||||
|
'/member?mid=${item.modules.moduleAuthor.mid}',
|
||||||
|
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||||
child: Text(
|
child: Text(
|
||||||
'@${item.modules.moduleAuthor.name}',
|
'@${item.modules.moduleAuthor.name}',
|
||||||
style: authorStyle,
|
style: authorStyle,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
@ -16,7 +17,9 @@ Widget livePanel(item, context, {floor = 1}) {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () => Get.toNamed(
|
||||||
|
'/member?mid=${item.modules.moduleAuthor.mid}',
|
||||||
|
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||||
child: Text(
|
child: Text(
|
||||||
'@${item.modules.moduleAuthor.name}',
|
'@${item.modules.moduleAuthor.name}',
|
||||||
style: authorStyle,
|
style: authorStyle,
|
||||||
|
@ -23,7 +23,9 @@ Widget liveRcmdPanel(item, context, {floor = 1}) {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () => Get.toNamed(
|
||||||
|
'/member?mid=${item.modules.moduleAuthor.mid}',
|
||||||
|
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||||
child: Text(
|
child: Text(
|
||||||
'@${item.modules.moduleAuthor.name}',
|
'@${item.modules.moduleAuthor.name}',
|
||||||
style: authorStyle,
|
style: authorStyle,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
|
|
||||||
// 富文本
|
// 富文本
|
||||||
@ -20,9 +21,10 @@ InlineSpan richNode(item, context) {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () => Get.toNamed('/member?mid=${i.rid}',
|
||||||
|
arguments: {'face': null}),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${i.text}',
|
' ${i.text}',
|
||||||
style: authorStyle,
|
style: authorStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -164,8 +164,9 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
padding: const EdgeInsets.only(left: 6, right: 6),
|
padding: const EdgeInsets.only(left: 6, right: 6),
|
||||||
isLabelVisible: data.type == 'live' ||
|
isLabelVisible: data.type == 'live' ||
|
||||||
(data.type == 'up' && (data.hasUpdate ?? false)),
|
(data.type == 'up' && (data.hasUpdate ?? false)),
|
||||||
backgroundColor:
|
backgroundColor: data.type == 'live'
|
||||||
Theme.of(context).colorScheme.secondaryContainer,
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
|
: Theme.of(context).colorScheme.primary,
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 49,
|
width: 49,
|
||||||
height: 49,
|
height: 49,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// 视频or合集
|
// 视频or合集
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'package:pilipala/common/widgets/badge.dart';
|
import 'package:pilipala/common/widgets/badge.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
@ -32,7 +33,9 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () => Get.toNamed(
|
||||||
|
'/member?mid=${item.modules.moduleAuthor.mid}',
|
||||||
|
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||||
child: Text(
|
child: Text(
|
||||||
item.modules.moduleAuthor.type == null
|
item.modules.moduleAuthor.type == null
|
||||||
? '@${item.modules.moduleAuthor.name}'
|
? '@${item.modules.moduleAuthor.name}'
|
||||||
@ -76,12 +79,15 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
|||||||
double width = box.maxWidth;
|
double width = box.maxWidth;
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
Hero(
|
||||||
|
tag: content.bvid,
|
||||||
|
child: NetworkImgLayer(
|
||||||
type: floor == 1 ? 'emote' : null,
|
type: floor == 1 ? 'emote' : null,
|
||||||
width: width,
|
width: width,
|
||||||
height: width / StyleString.aspectRatio,
|
height: width / StyleString.aspectRatio,
|
||||||
src: content.cover,
|
src: content.cover,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
if (content.badge != null && type == 'pgc')
|
if (content.badge != null && type == 'pgc')
|
||||||
pBadge(content.badge['text'], context, 8.0, 10.0, null, null),
|
pBadge(content.badge['text'], context, 8.0, 10.0, null, null),
|
||||||
Positioned(
|
Positioned(
|
||||||
|
@ -19,8 +19,8 @@ class MemberController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
mid = int.parse(Get.parameters['mid']!);
|
mid = int.parse(Get.parameters['mid']!);
|
||||||
ownerMid = user.get(UserBoxKey.userMid);
|
ownerMid = user.get(UserBoxKey.userMid);
|
||||||
face = Get.arguments['face']!;
|
face = Get.arguments['face'] ?? '';
|
||||||
heroTag = Get.arguments['heroTag']!;
|
heroTag = Get.arguments['heroTag'] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
|
@ -50,6 +50,7 @@ class _MemberPageState extends State<MemberPage>
|
|||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: Stack(
|
background: Stack(
|
||||||
children: [
|
children: [
|
||||||
|
if (_memberController.face != null)
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
Reference in New Issue
Block a user