mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: failed to view reposted dynamic on dynamic detail page
This commit is contained in:
@@ -70,33 +70,44 @@ class DynamicsController extends GetxController
|
|||||||
initialValue.value = value;
|
initialValue.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toDupNamed(
|
||||||
|
String page, {
|
||||||
|
dynamic arguments,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
}) {
|
||||||
|
Get.toNamed(
|
||||||
|
page,
|
||||||
|
arguments: arguments,
|
||||||
|
parameters: parameters,
|
||||||
|
preventDuplicates: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
pushDetail(item, floor, {action = 'all'}) async {
|
pushDetail(item, floor, {action = 'all'}) async {
|
||||||
feedBack();
|
feedBack();
|
||||||
|
|
||||||
/// 点击评论action 直接查看评论
|
/// 点击评论action 直接查看评论
|
||||||
if (action == 'comment') {
|
if (action == 'comment') {
|
||||||
Get.toNamed('/dynamicDetail',
|
toDupNamed('/dynamicDetail',
|
||||||
arguments: {'item': item, 'floor': floor, 'action': action});
|
arguments: {'item': item, 'floor': floor, 'action': action});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
switch (item!.type) {
|
switch (item!.type) {
|
||||||
/// 转发的动态
|
/// 转发的动态
|
||||||
case 'DYNAMIC_TYPE_FORWARD':
|
case 'DYNAMIC_TYPE_FORWARD':
|
||||||
Get.toNamed('/dynamicDetail',
|
toDupNamed('/dynamicDetail', arguments: {'item': item, 'floor': floor});
|
||||||
arguments: {'item': item, 'floor': floor});
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/// 图文动态查看
|
/// 图文动态查看
|
||||||
case 'DYNAMIC_TYPE_DRAW':
|
case 'DYNAMIC_TYPE_DRAW':
|
||||||
Get.toNamed('/dynamicDetail',
|
toDupNamed('/dynamicDetail', arguments: {'item': item, 'floor': floor});
|
||||||
arguments: {'item': item, 'floor': floor});
|
|
||||||
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;
|
||||||
String cover = item.modules.moduleDynamic.major.archive.cover;
|
String cover = item.modules.moduleDynamic.major.archive.cover;
|
||||||
try {
|
try {
|
||||||
int cid = await SearchHttp.ab2c(bvid: bvid);
|
int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||||
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
toDupNamed('/video?bvid=$bvid&cid=$cid',
|
||||||
arguments: {'pic': cover, 'heroTag': bvid});
|
arguments: {'pic': cover, 'heroTag': bvid});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
SmartDialog.showToast(err.toString());
|
SmartDialog.showToast(err.toString());
|
||||||
@@ -114,14 +125,14 @@ class DynamicsController extends GetxController
|
|||||||
if (url.contains('read')) {
|
if (url.contains('read')) {
|
||||||
number = 'cv$number';
|
number = 'cv$number';
|
||||||
}
|
}
|
||||||
Get.toNamed('/htmlRender', parameters: {
|
toDupNamed('/htmlRender', parameters: {
|
||||||
'url': url.startsWith('//') ? url.split('//').last : url,
|
'url': url.startsWith('//') ? url.split('//').last : url,
|
||||||
'title': title,
|
'title': title,
|
||||||
'id': number,
|
'id': number,
|
||||||
'dynamicType': url.split('//').last.split('/')[1]
|
'dynamicType': url.split('//').last.split('/')[1]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(
|
toDupNamed(
|
||||||
'/webviewnew',
|
'/webviewnew',
|
||||||
parameters: {
|
parameters: {
|
||||||
'url': 'https:$url',
|
'url': 'https:$url',
|
||||||
@@ -140,8 +151,7 @@ class DynamicsController extends GetxController
|
|||||||
/// 纯文字动态查看
|
/// 纯文字动态查看
|
||||||
case 'DYNAMIC_TYPE_WORD':
|
case 'DYNAMIC_TYPE_WORD':
|
||||||
print('纯文本');
|
print('纯文本');
|
||||||
Get.toNamed('/dynamicDetail',
|
toDupNamed('/dynamicDetail', arguments: {'item': item, 'floor': floor});
|
||||||
arguments: {'item': item, 'floor': floor});
|
|
||||||
break;
|
break;
|
||||||
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
||||||
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
||||||
@@ -155,7 +165,7 @@ class DynamicsController extends GetxController
|
|||||||
'roomid': liveRcmd.roomId,
|
'roomid': liveRcmd.roomId,
|
||||||
'watched_show': liveRcmd.watchedShow,
|
'watched_show': liveRcmd.watchedShow,
|
||||||
});
|
});
|
||||||
Get.toNamed('/liveRoom?roomid=${liveItem.roomId}', arguments: {
|
toDupNamed('/liveRoom?roomid=${liveItem.roomId}', arguments: {
|
||||||
'liveItem': liveItem,
|
'liveItem': liveItem,
|
||||||
'heroTag': liveItem.roomId.toString()
|
'heroTag': liveItem.roomId.toString()
|
||||||
});
|
});
|
||||||
@@ -169,7 +179,7 @@ class DynamicsController extends GetxController
|
|||||||
String bvid = IdUtils.av2bv(aid);
|
String bvid = IdUtils.av2bv(aid);
|
||||||
String cover = ugcSeason.cover!;
|
String cover = ugcSeason.cover!;
|
||||||
int cid = await SearchHttp.ab2c(bvid: bvid);
|
int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||||
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
toDupNamed('/video?bvid=$bvid&cid=$cid',
|
||||||
arguments: {'pic': cover, 'heroTag': bvid});
|
arguments: {'pic': cover, 'heroTag': bvid});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -198,7 +208,7 @@ class DynamicsController extends GetxController
|
|||||||
int cid = episode.cid!;
|
int cid = episode.cid!;
|
||||||
String pic = episode.cover!;
|
String pic = episode.cover!;
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
String heroTag = Utils.makeHeroTag(cid);
|
||||||
Get.toNamed(
|
toDupNamed(
|
||||||
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epid=$epId',
|
'/video?bvid=$bvid&cid=$cid&seasonId=${res['data'].seasonId}&epid=$epId',
|
||||||
arguments: {
|
arguments: {
|
||||||
'pic': pic,
|
'pic': pic,
|
||||||
|
|||||||
Reference in New Issue
Block a user