mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-16 07:06:14 +08:00
opt handle res
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:PiliPlus/build_config.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/models/dynamics/dyn_reserve/data.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||
@@ -198,16 +199,15 @@ Widget addWidget(ThemeData theme, DynamicItemModel item, BuildContext context,
|
||||
reserve.reserveTotal,
|
||||
);
|
||||
if (res['status']) {
|
||||
DynReserveData data =
|
||||
res['data'];
|
||||
reserve
|
||||
..desc2?.text =
|
||||
res['data']
|
||||
['desc_update']
|
||||
data.descUpdate
|
||||
..reserveTotal =
|
||||
res['data']
|
||||
['reserve_update']
|
||||
..button!.status = res[
|
||||
'data']
|
||||
['final_btn_status'];
|
||||
data.reserveUpdate
|
||||
..button!.status =
|
||||
data.finalBtnStatus;
|
||||
if (context.mounted) {
|
||||
(context as Element?)
|
||||
?.markNeedsBuild();
|
||||
|
||||
@@ -44,7 +44,7 @@ class AuthorPanel extends StatelessWidget {
|
||||
Widget avatar = PendantAvatar(
|
||||
avatar: item.modules.moduleAuthor?.face,
|
||||
size: pendant.isNullOrEmpty ? 40 : 34,
|
||||
isVip: null, // item.modules.moduleAuthor!.vip['status'] > 0
|
||||
isVip: null,
|
||||
officialType: null, // 已被注释
|
||||
garbPendantImage: pendant,
|
||||
);
|
||||
@@ -161,31 +161,28 @@ class AuthorPanel extends StatelessWidget {
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
height: 32,
|
||||
imageUrl: (item.modules.moduleAuthor!
|
||||
.decorate!['card_url'] as String)
|
||||
.http2https,
|
||||
imageUrl: item.modules.moduleAuthor!.decorate!
|
||||
.cardUrl.http2https,
|
||||
),
|
||||
if ((item.modules.moduleAuthor?.decorate?['fan']
|
||||
?['num_str'] as String?)
|
||||
if (item.modules.moduleAuthor?.decorate?.fan?.numStr
|
||||
?.isNotEmpty ==
|
||||
true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 32),
|
||||
child: Text(
|
||||
'${item.modules.moduleAuthor!.decorate!['fan']['num_str']}',
|
||||
'${item.modules.moduleAuthor!.decorate!.fan!.numStr}',
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 11,
|
||||
fontFamily: 'digital_id_num',
|
||||
color: (item.modules.moduleAuthor!
|
||||
.decorate!['fan']
|
||||
['color'] as String?)
|
||||
color: item.modules.moduleAuthor!.decorate!
|
||||
.fan?.color
|
||||
?.startsWith('#') ==
|
||||
true
|
||||
? Color(
|
||||
int.parse(
|
||||
item.modules.moduleAuthor!
|
||||
.decorate!['fan']['color']
|
||||
.decorate!.fan!.color!
|
||||
.replaceFirst('#', '0xFF'),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -82,7 +82,7 @@ Widget content(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) => imageView(
|
||||
constraints.maxWidth,
|
||||
(item.modules.moduleDynamic!.major!.opus!.pics as List)
|
||||
item.modules.moduleDynamic!.major!.opus!.pics!
|
||||
.map(
|
||||
(item) => ImageModel(
|
||||
width: item.width,
|
||||
|
||||
@@ -60,12 +60,13 @@ Widget livePanel(
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
content.live!.badge!['text'],
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
)
|
||||
if (content.live!.badge?.text != null)
|
||||
Text(
|
||||
content.live!.badge!.text!,
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -182,8 +182,7 @@ Widget module(
|
||||
borderRadius: floor == 1 ? null : StyleString.mdRadius,
|
||||
onTap: () {
|
||||
try {
|
||||
String url =
|
||||
item.modules.moduleDynamic!.major!.common!['jump_url'];
|
||||
String url = item.modules.moduleDynamic!.major!.common!.jumpUrl!;
|
||||
if (url.contains('bangumi/play') &&
|
||||
PageUtils.viewPgcFromUri(url)) {
|
||||
return;
|
||||
@@ -200,7 +199,7 @@ Widget module(
|
||||
radius: 8,
|
||||
width: 45,
|
||||
height: 45,
|
||||
src: item.modules.moduleDynamic!.major!.common!['cover'],
|
||||
src: item.modules.moduleDynamic!.major!.common!.cover,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
@@ -208,7 +207,7 @@ Widget module(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.modules.moduleDynamic!.major!.common!['title'],
|
||||
item.modules.moduleDynamic!.major!.common!.title!,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
@@ -217,7 +216,7 @@ Widget module(
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
item.modules.moduleDynamic!.major!.common!['desc'],
|
||||
item.modules.moduleDynamic!.major!.common!.desc!,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
@@ -283,26 +282,29 @@ Widget module(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (floor == 1) const SizedBox(width: 12),
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Hero(
|
||||
tag: item.modules.moduleDynamic!.major!.medialist!['cover'],
|
||||
child: NetworkImgLayer(
|
||||
width: 180,
|
||||
height: 110,
|
||||
src: item.modules.moduleDynamic!.major!.medialist!['cover'],
|
||||
if (item.modules.moduleDynamic!.major!.medialist!.cover?.isNotEmpty ==
|
||||
true) ...[
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Hero(
|
||||
tag: item.modules.moduleDynamic!.major!.medialist!.cover!,
|
||||
child: NetworkImgLayer(
|
||||
width: 180,
|
||||
height: 110,
|
||||
src: item.modules.moduleDynamic!.major!.medialist!.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
PBadge(
|
||||
right: 6,
|
||||
top: 6,
|
||||
text: item.modules.moduleDynamic!.major!.medialist!['badge']
|
||||
?['text'],
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
PBadge(
|
||||
right: 6,
|
||||
top: 6,
|
||||
text:
|
||||
item.modules.moduleDynamic!.major!.medialist!.badge?.text,
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
],
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 110,
|
||||
@@ -313,18 +315,16 @@ Widget module(
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
item.modules.moduleDynamic!.major!.medialist!['title'],
|
||||
item.modules.moduleDynamic!.major!.medialist!.title!,
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
if (item.modules.moduleDynamic?.major
|
||||
?.medialist?['sub_title'] !=
|
||||
if (item.modules.moduleDynamic?.major?.medialist?.subTitle !=
|
||||
null) ...[
|
||||
const Spacer(),
|
||||
Text(
|
||||
item.modules.moduleDynamic!.major!
|
||||
.medialist!['sub_title'],
|
||||
item.modules.moduleDynamic!.major!.medialist!.subTitle!,
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.labelLarge!.fontSize,
|
||||
color: theme.colorScheme.outline),
|
||||
|
||||
@@ -69,14 +69,14 @@ Widget videoSeasonWidget(
|
||||
height: width / StyleString.aspectRatio,
|
||||
src: itemContent.cover,
|
||||
),
|
||||
if (itemContent.badge?['text'] != null)
|
||||
if (itemContent.badge?.text != null)
|
||||
PBadge(
|
||||
text: itemContent.badge!['text'],
|
||||
text: itemContent.badge!.text,
|
||||
top: 8.0,
|
||||
right: 10.0,
|
||||
bottom: null,
|
||||
left: null,
|
||||
type: itemContent.badge!['text'] == '充电专属'
|
||||
type: itemContent.badge!.text == '充电专属'
|
||||
? PBadgeType.error
|
||||
: PBadgeType.primary,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user