Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-31 15:30:50 +08:00
parent 1462e6ecf1
commit 19bbdaac65
10 changed files with 113 additions and 134 deletions

View File

@@ -60,21 +60,13 @@ class VideoCardH extends StatelessWidget {
label: Utils.videoItemSemantics(videoItem),
excludeSemantics: true,
child: InkWell(
onLongPress: () {
if (onLongPress != null) {
onLongPress!();
} else {
imageSaveDialog(
onLongPress: onLongPress ??
() => imageSaveDialog(
title: videoItem.title,
cover: videoItem.pic,
);
}
},
onTap: () async {
if (onTap != null) {
onTap!();
return;
}
),
onTap: onTap ??
() async {
if (type == 'ketang') {
SmartDialog.showToast('课堂视频暂不支持播放');
return;

View File

@@ -37,12 +37,10 @@ class VideoCardHMemberVideo extends StatelessWidget {
title: videoItem.title,
cover: videoItem.cover,
),
onTap: () async {
if (onTap != null) {
onTap!();
return;
}
if (videoItem.isPgc == true && videoItem.uri?.isNotEmpty == true) {
onTap: onTap ??
() async {
if (videoItem.isPgc == true &&
videoItem.uri?.isNotEmpty == true) {
if (PageUtils.viewPgcFromUri(videoItem.uri!)) {
return;
}

View File

@@ -215,14 +215,13 @@ class SearchHttp {
dynamic seasonId,
dynamic epId,
}) async {
final Map<String, dynamic> data = {};
if (seasonId != null) {
data['season_id'] = seasonId;
} else if (epId != null) {
data['ep_id'] = epId;
}
var res = await Request().get(Api.bangumiInfo, queryParameters: data);
var res = await Request().get(
Api.bangumiInfo,
queryParameters: {
if (seasonId != null) 'season_id': seasonId,
if (epId != null) 'ep_id': epId,
},
);
if (res.data['code'] == 0) {
return {
'status': true,

View File

@@ -149,10 +149,9 @@ class _UpPanelState extends State<UpPanel> {
}
},
onDoubleTap: data is LiveUserItem ? () => _onSelect(data) : null,
onLongPress: () {
if (data.mid == -1) {
return;
}
onLongPress: data.mid == -1
? null
: () {
String heroTag = Utils.makeHeroTag(data.mid);
Get.toNamed('/member?mid=${data.mid}',
arguments: {'face': data.face, 'heroTag': heroTag});

View File

@@ -35,12 +35,8 @@ class FavVideoCardH extends StatelessWidget {
return InkWell(
onTap: isSort == true
? null
: () async {
if (onTap != null) {
onTap!();
return;
}
: onTap ??
() {
if (!const [0, 16].contains(videoItem.attr)) {
Get.toNamed('/member?mid=${videoItem.owner.mid}');
return;
@@ -59,16 +55,11 @@ class FavVideoCardH extends StatelessWidget {
},
onLongPress: isSort == true
? null
: () {
if (onLongPress != null) {
onLongPress!();
} else {
imageSaveDialog(
: onLongPress ??
() => imageSaveDialog(
title: videoItem.title,
cover: videoItem.pic,
);
}
},
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: StyleString.safeSpace,

View File

@@ -173,7 +173,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
'/searchResult',
parameters: {'keyword': tagName},
),
onLongPress: (tagName) => Utils.copyText(tagName),
onLongPress: Utils.copyText,
),
)
.toList(),

View File

@@ -719,8 +719,7 @@ class _VideoInfoState extends State<VideoInfo> {
'/searchResult',
parameters: {'keyword': tagName},
),
onLongPress: (tagName) =>
Utils.copyText(tagName),
onLongPress: Utils.copyText,
),
)
.toList(),

View File

@@ -145,9 +145,9 @@ class ActionItemState extends State<ActionItem>
widget.onTap?.call();
},
onLongPress: _isThumbsUp ? null : widget.onLongPress,
onTapDown: (details) => _isThumbsUp ? _startLongPress() : null,
onTapUp: (details) => _isThumbsUp ? _cancelLongPress() : null,
onTapCancel: () => _isThumbsUp ? _cancelLongPress(true) : null,
onTapDown: _isThumbsUp ? (details) => _startLongPress() : null,
onTapUp: _isThumbsUp ? (details) => _cancelLongPress() : null,
onTapCancel: _isThumbsUp ? () => _cancelLongPress(true) : null,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [

View File

@@ -87,7 +87,8 @@ class PiliScheme {
PageUtils.viewBangumi(
seasonId: isEp ? null : id,
epId: isEp ? id : null,
progress: uri.queryParameters['start_progress']);
progress: uri.queryParameters['start_progress'],
);
return true;
}
return false;

View File

@@ -697,7 +697,7 @@ class PageUtils {
}
static Future<void> viewBangumi(
{dynamic seasonId, dynamic epId, dynamic progress}) async {
{dynamic seasonId, dynamic epId, String? progress}) async {
try {
SmartDialog.showLoading(msg: '资源获取中');
var result = await SearchHttp.bangumiInfo(seasonId: seasonId, epId: epId);