fix: 直播详情页传参

This commit is contained in:
guozhigq
2023-07-19 19:55:39 +08:00
parent 5abb483b2b
commit 04c90830bb
5 changed files with 15 additions and 7 deletions

View File

@ -71,6 +71,7 @@ class LiveRoom {
this.cover,
this.roomId,
this.roundStatus,
this.watchedShow,
});
int? roomStatus;
@ -80,6 +81,7 @@ class LiveRoom {
String? cover;
int? roomId;
int? roundStatus;
Map? watchedShow;
LiveRoom.fromJson(Map<String, dynamic> json) {
roomStatus = json['roomStatus'];
@ -89,5 +91,6 @@ class LiveRoom {
cover = json['cover'];
roomId = json['roomid'];
roundStatus = json['roundStatus'];
watchedShow = json['watched_show'];
}
}

View File

@ -57,9 +57,9 @@ class DynamicsController extends GetxController {
);
if (res['status']) {
if (type == 'init') {
dynamicsList!.value = res['data'].items;
dynamicsList.value = res['data'].items;
} else {
dynamicsList!.addAll(res['data'].items);
dynamicsList.addAll(res['data'].items);
}
offset = res['data'].offset;
page++;
@ -69,7 +69,7 @@ class DynamicsController extends GetxController {
onSelectType(value) async {
dynamicsType.value = filterTypeList[value - 1]['value'];
dynamicsList!.value = [DynamicItemModel()];
dynamicsList.value = [DynamicItemModel()];
page = 1;
initialValue.value = value;
await queryFollowDynamic();
@ -128,6 +128,7 @@ class DynamicsController extends GetxController {
'mid': author.mid,
'face': author.face,
'roomid': liveRcmd.roomId,
'watched_show': liveRcmd.watchedShow,
});
Get.toNamed('/liveRoom?roomid=${liveItem.roomId}', arguments: {
'liveItem': liveItem,
@ -151,7 +152,7 @@ class DynamicsController extends GetxController {
onSelectUp(mid) async {
dynamicsType.value = DynamicsType.values[0];
dynamicsList!.value = [DynamicItemModel()];
dynamicsList.value = [DynamicItemModel()];
page = 1;
queryFollowDynamic();
}

View File

@ -234,7 +234,7 @@ class _DynamicsPageState extends State<DynamicsPage>
Map data = snapshot.data;
if (data['status']) {
List<DynamicItemModel> list =
_dynamicsController.dynamicsList!;
_dynamicsController.dynamicsList;
return Obx(
() => list.length == 1
? skeleton()

View File

@ -70,7 +70,10 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
style: const TextStyle(fontSize: 14),
),
const SizedBox(height: 1),
Text(_liveRoomController.liveItem.watchedShow['text_large'],
if (_liveRoomController.liveItem.watchedShow != null)
Text(
_liveRoomController.liveItem.watchedShow['text_large'] ??
'',
style: const TextStyle(fontSize: 12)),
],
),

View File

@ -303,6 +303,7 @@ class _MemberPageState extends State<MemberPage>
'uname': memberInfo.name,
'face': memberInfo.face,
'roomid': memberInfo.liveRoom.roomId,
'watched_show': memberInfo.liveRoom.watchedShow,
});
Get.toNamed(
'/liveRoom?roomid=${memberInfo.liveRoom.roomId}',