Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-17 16:55:43 +08:00
parent 7ae92970ef
commit 906c21e252
5 changed files with 98 additions and 85 deletions

View File

@@ -244,7 +244,7 @@ class VideoHttp {
}; };
} }
} catch (err) { } catch (err) {
return {'status': false, 'msg': err}; return {'status': false, 'msg': err.toString()};
} }
} }

View File

@@ -220,7 +220,7 @@ class Goods {
class GoodsItem { class GoodsItem {
String? brief; String? brief;
String? cover; String? cover;
int? id; dynamic id;
String? jumpDesc; String? jumpDesc;
String? jumpUrl; String? jumpUrl;
String? name; String? name;

View File

@@ -201,37 +201,38 @@ class OpusContent extends StatelessWidget {
), ),
color: colorScheme.onInverseSurface, color: colorScheme.onInverseSurface,
child: InkWell( child: InkWell(
onTap: () { onTap: element.linkCard!.card!.type == 'LINK_CARD_TYPE_GOODS'
try { ? null
if (element.linkCard!.card!.type == : () {
'LINK_CARD_TYPE_VOTE') { try {
showVoteDialog( if (element.linkCard!.card!.type ==
context, 'LINK_CARD_TYPE_VOTE') {
element.linkCard!.card!.vote?.voteId ?? showVoteDialog(
element.linkCard!.card!.oid, context,
); element.linkCard!.card!.vote?.voteId ??
return; element.linkCard!.card!.oid,
} );
String? url = switch (element.linkCard!.card!.type) { return;
'LINK_CARD_TYPE_UGC' => }
element.linkCard!.card!.ugc!.jumpUrl, String? url =
'LINK_CARD_TYPE_COMMON' => switch (element.linkCard!.card!.type) {
element.linkCard!.card!.common!.jumpUrl, 'LINK_CARD_TYPE_UGC' =>
'LINK_CARD_TYPE_LIVE' => element.linkCard!.card!.ugc!.jumpUrl,
element.linkCard!.card!.live!.jumpUrl, 'LINK_CARD_TYPE_COMMON' =>
'LINK_CARD_TYPE_OPUS' => element.linkCard!.card!.common!.jumpUrl,
element.linkCard!.card!.opus!.jumpUrl, 'LINK_CARD_TYPE_LIVE' =>
'LINK_CARD_TYPE_MUSIC' => element.linkCard!.card!.live!.jumpUrl,
element.linkCard!.card!.music!.jumpUrl, 'LINK_CARD_TYPE_OPUS' =>
'LINK_CARD_TYPE_GOODS' => element.linkCard!.card!.opus!.jumpUrl,
element.linkCard!.card!.goods!.jumpUrl, 'LINK_CARD_TYPE_MUSIC' =>
_ => null, element.linkCard!.card!.music!.jumpUrl,
}; _ => null,
if (url != null) { };
PiliScheme.routePushFromUrl(url); if (url?.isNotEmpty == true) {
} PiliScheme.routePushFromUrl(url!);
} catch (_) {} }
}, } catch (_) {}
},
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
@@ -381,12 +382,12 @@ class OpusContent extends StatelessWidget {
), ),
color: colorScheme.secondaryContainer, color: colorScheme.secondaryContainer,
), ),
width: 75, width: 70,
height: 50, height: 50,
alignment: Alignment.center, alignment: Alignment.center,
child: Icon( child: Icon(
Icons.bar_chart_rounded, Icons.bar_chart_rounded,
color: colorScheme.onSecondaryContainer, color: colorScheme.onSurfaceVariant,
), ),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
@@ -435,47 +436,53 @@ class OpusContent extends StatelessWidget {
), ),
], ],
), ),
'LINK_CARD_TYPE_GOODS' => Row( 'LINK_CARD_TYPE_GOODS' => Column(
children: [ children:
NetworkImgLayer( element.linkCard!.card!.goods!.items!.map((e) {
radius: 6, return GestureDetector(
width: 65 * StyleString.aspectRatio, onTap: () {
height: 65, if (e.jumpUrl?.isNotEmpty == true) {
src: element PiliScheme.routePushFromUrl(e.jumpUrl!);
.linkCard!.card!.goods!.items!.first.cover, }
), },
const SizedBox(width: 10), child: Row(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(element.linkCard!.card!.goods!.items! NetworkImgLayer(
.first.name!), radius: 6,
if (element.linkCard!.card!.goods!.items! width: 65 * StyleString.aspectRatio,
.first.brief != height: 65,
null) src: e.cover,
Text( ),
element.linkCard!.card!.goods!.items! const SizedBox(width: 10),
.first.brief!, Expanded(
style: TextStyle( child: Column(
fontSize: 13, crossAxisAlignment:
color: colorScheme.outline, CrossAxisAlignment.start,
), children: [
), Text(e.name!),
if (element.linkCard!.card!.goods!.items! if (e.brief?.isNotEmpty == true)
.first.price != Text(
null) e.brief!,
Text( style: TextStyle(
'${element.linkCard!.card!.goods!.items!.first.price!}', fontSize: 13,
style: TextStyle( color: colorScheme.outline,
fontSize: 13, ),
color: colorScheme.outline, ),
), if (e.price?.isNotEmpty == true)
Text(
'${e.price!}',
style: TextStyle(
fontSize: 13,
color: colorScheme.outline,
),
),
],
), ),
),
], ],
), ),
), );
], }).toList(),
), ),
_ => throw UnimplementedError( _ => throw UnimplementedError(
'\nparaType: ${element.paraType},\ncard type: ${element.linkCard?.card?.type}', '\nparaType: ${element.paraType},\ncard type: ${element.linkCard?.card?.type}',
@@ -586,14 +593,14 @@ Widget moduleBlockedItem(
shape: shape, shape: shape,
), ),
onPressed: () { onPressed: () {
if (moduleBlocked.button!.jumpUrl != null) { if (moduleBlocked.button!.jumpUrl?.isNotEmpty == true) {
PiliScheme.routePushFromUrl(moduleBlocked.button!.jumpUrl!); PiliScheme.routePushFromUrl(moduleBlocked.button!.jumpUrl!);
} }
}, },
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (moduleBlocked.button!.icon != null) if (moduleBlocked.button!.icon?.isNotEmpty == true)
CachedNetworkImage( CachedNetworkImage(
height: 16, height: 16,
color: Colors.white, color: Colors.white,
@@ -618,7 +625,7 @@ Widget moduleBlockedItem(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
if (moduleBlocked.icon != null) icon(max(40, maxWidth / 7)), if (moduleBlocked.icon != null) icon(max(40, maxWidth / 7)),
if (moduleBlocked.hintMessage != null) ...[ if (moduleBlocked.hintMessage?.isNotEmpty == true) ...[
const SizedBox(height: 5), const SizedBox(height: 5),
Text( Text(
moduleBlocked.hintMessage!, moduleBlocked.hintMessage!,
@@ -651,8 +658,9 @@ Widget moduleBlockedItem(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (moduleBlocked.title != null) Text(moduleBlocked.title!), if (moduleBlocked.title?.isNotEmpty == true)
if (moduleBlocked.hintMessage != null) ...[ Text(moduleBlocked.title!),
if (moduleBlocked.hintMessage?.isNotEmpty == true) ...[
const SizedBox(height: 2), const SizedBox(height: 2),
Text( Text(
moduleBlocked.hintMessage!, moduleBlocked.hintMessage!,
@@ -684,10 +692,10 @@ Widget opusCollection(ThemeData theme, ModuleCollection item) {
return Padding( return Padding(
padding: const EdgeInsets.only(bottom: 10), padding: const EdgeInsets.only(bottom: 10),
child: Material( child: Material(
borderRadius: const BorderRadius.all(Radius.circular(6)), borderRadius: const BorderRadius.all(Radius.circular(8)),
color: theme.colorScheme.onInverseSurface, color: theme.colorScheme.onInverseSurface,
child: InkWell( child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(6)), borderRadius: const BorderRadius.all(Radius.circular(8)),
onTap: () { onTap: () {
Get.toNamed( Get.toNamed(
'/articleList', '/articleList',

View File

@@ -327,8 +327,11 @@ Widget addWidget(
const BorderRadius.all(Radius.circular(8)), const BorderRadius.all(Radius.circular(8)),
), ),
width: 70, width: 70,
height: 56, height: 50,
child: const Icon(Icons.bar_chart_rounded), child: Icon(
Icons.bar_chart_rounded,
color: theme.colorScheme.onSurfaceVariant,
),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(

View File

@@ -91,7 +91,10 @@ class _EditProfilePageState extends State<EditProfilePage> {
return switch (loadingState) { return switch (loadingState) {
Loading() => loadingWidget, Loading() => loadingWidget,
Success(:var response) => ListView( Success(:var response) => ListView(
padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 25),
children: [ children: [
divider1,
_item( _item(
theme: theme, theme: theme,
title: '头像', title: '头像',
@@ -177,7 +180,7 @@ class _EditProfilePageState extends State<EditProfilePage> {
_item( _item(
theme: theme, theme: theme,
title: '头像挂件', title: '头像挂件',
onTap: () => PageUtils.launchURL( onTap: () => PageUtils.inAppWebview(
'https://www.bilibili.com/h5/mall/pendant/home'), 'https://www.bilibili.com/h5/mall/pendant/home'),
), ),
divider1, divider1,
@@ -192,11 +195,10 @@ class _EditProfilePageState extends State<EditProfilePage> {
_item( _item(
theme: theme, theme: theme,
title: '哔哩哔哩认证', title: '哔哩哔哩认证',
onTap: () => PageUtils.launchURL( onTap: () => PageUtils.inAppWebview(
'https://account.bilibili.com/official/mobile/home'), 'https://account.bilibili.com/official/mobile/home'),
), ),
divider, divider1,
SizedBox(height: 25 + MediaQuery.paddingOf(context).bottom),
], ],
), ),
Error(:var errMsg) => scrollErrorWidget( Error(:var errMsg) => scrollErrorWidget(