Merge branch 'main' into fix

This commit is contained in:
guozhigq
2024-12-10 19:35:53 +08:00
4 changed files with 52 additions and 60 deletions

View File

@ -194,26 +194,31 @@ class _LivePageState extends State<LivePage>
), ),
), ),
), ),
InkWell( Obx(
onTap: () { () => Visibility(
Get.toNamed('/liveFollowing'); visible: _liveController.liveFollowingCount.value > 0,
}, child: InkWell(
highlightColor: Colors.transparent, onTap: () {
splashColor: Colors.transparent, Get.toNamed('/liveFollowing');
child: Row( },
children: [ highlightColor: Colors.transparent,
Text( splashColor: Colors.transparent,
'查看更多', child: Row(
style: TextStyle( children: [
fontSize: 14, Text(
color: Theme.of(context).colorScheme.outline, '查看更多',
), style: TextStyle(
fontSize: 14,
color: Theme.of(context).colorScheme.outline,
),
),
Icon(
Icons.chevron_right,
color: Theme.of(context).colorScheme.outline,
),
],
), ),
Icon( ),
Icons.chevron_right,
color: Theme.of(context).colorScheme.outline,
),
],
), ),
), ),
], ],
@ -222,19 +227,18 @@ class _LivePageState extends State<LivePage>
future: _futureBuilderFuture2, future: _futureBuilderFuture2,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data == null) {
return const SizedBox();
}
Map? data = snapshot.data; Map? data = snapshot.data;
if (data?['status']) { if (data != null && data['status']) {
RxList list = _liveController.liveFollowingList; RxList list = _liveController.liveFollowingList;
return LiveFollowingListView(list: list); return list.isNotEmpty
? LiveFollowingListView(list: list)
: const Center(child: Text('没有人在直播'));
} else { } else {
return SizedBox( return SizedBox(
height: 80, height: 80,
child: Center( child: Center(
child: Text( child: Text(
data?['msg'] ?? '', data?['msg'] ?? '请求异常',
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
fontSize: 12, fontSize: 12,
@ -283,6 +287,15 @@ class LiveFollowingListView extends StatelessWidget {
}, },
); );
}, },
onLongPress: () {
Get.toNamed(
'/member?mid=${list[index].uid}',
arguments: {
'face': list[index].face,
'heroTag': list[index].uid.toString(),
},
);
},
child: Container( child: Container(
width: 54, width: 54,
height: 54, height: 54,

View File

@ -9,7 +9,7 @@ class LiveFollowController extends GetxController {
RxInt crossAxisCount = 2.obs; RxInt crossAxisCount = 2.obs;
Box setting = GStorage.setting; Box setting = GStorage.setting;
int _currentPage = 1; int _currentPage = 1;
RxInt liveFollowingCount = 0.obs; RxString liveFollowingCount = '- '.obs;
RxList<LiveFollowingItemModel> liveFollowingList = RxList<LiveFollowingItemModel> liveFollowingList =
<LiveFollowingItemModel>[].obs; <LiveFollowingItemModel>[].obs;
@ -28,10 +28,11 @@ class LiveFollowController extends GetxController {
if (res['status']) { if (res['status']) {
if (type == 'init') { if (type == 'init') {
liveFollowingList.value = res['data'].list; liveFollowingList.value = res['data'].list;
liveFollowingCount.value = res['data'].liveCount; liveFollowingCount.value = res['data'].liveCount.toString();
} else if (type == 'onLoad') { } else if (type == 'onLoad') {
liveFollowingList.addAll(res['data'].list); liveFollowingList.addAll(res['data'].list);
} }
liveFollowingList.removeWhere((e) => e.liveStatus != 1);
_currentPage += 1; _currentPage += 1;
} else { } else {
SmartDialog.showToast(res['msg']); SmartDialog.showToast(res['msg']);

View File

@ -1080,10 +1080,7 @@ class _HeaderControlState extends State<HeaderControl> {
if (videoIntroController.isShowOnlineTotal) if (videoIntroController.isShowOnlineTotal)
Text( Text(
'${videoIntroController.total.value}人正在看', '${videoIntroController.total.value}人正在看',
style: const TextStyle( style: textStyle,
color: Colors.white,
fontSize: 12,
),
), ),
const Spacer(), const Spacer(),
Expanded( Expanded(
@ -1094,18 +1091,12 @@ class _HeaderControlState extends State<HeaderControl> {
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
String currentTime = _formatTime(snapshot.data!); String currentTime = _formatTime(snapshot.data!);
return Text( return Text(currentTime, style: textStyle);
currentTime,
style: const TextStyle(fontSize: 12),
);
} else if (snapshot.connectionState == } else if (snapshot.connectionState ==
ConnectionState.waiting) { ConnectionState.waiting) {
// 如果Stream还未发出数据先显示初始获取的时间 // 如果Stream还未发出数据先显示初始获取的时间
String currentTime = _formatTime(initialTime); String currentTime = _formatTime(initialTime);
return Text( return Text(currentTime, style: textStyle);
currentTime,
style: const TextStyle(fontSize: 12),
);
} else { } else {
return const SizedBox(); return const SizedBox();
} }
@ -1156,7 +1147,8 @@ class _HeaderControlState extends State<HeaderControl> {
() => Marquee( () => Marquee(
text: videoIntroController.videoDetail.value.title ?? text: videoIntroController.videoDetail.value.title ??
'', '',
style: const TextStyle(fontSize: 16), style: const TextStyle(
fontSize: 16, color: Colors.white),
scrollAxis: Axis.horizontal, scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: constraints.maxWidth, blankSpace: constraints.maxWidth,

View File

@ -292,10 +292,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
style: ButtonStyle( style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero), padding: MaterialStateProperty.all(EdgeInsets.zero),
), ),
child: const Text( child: const Text('选集', style: textStyle),
'选集',
style: TextStyle(color: Colors.white, fontSize: 13),
),
), ),
), ),
@ -310,14 +307,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
padding: MaterialStateProperty.all(EdgeInsets.zero), padding: MaterialStateProperty.all(EdgeInsets.zero),
), ),
child: Obx( child: Obx(
() => Text( () => Text(_.videoFitDEsc.value, style: textStyle),
_.videoFitDEsc.value,
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
), ),
), ),
), ),
@ -339,10 +329,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
height: 40, height: 40,
padding: const EdgeInsets.only(left: 20), padding: const EdgeInsets.only(left: 20),
value: speed, value: speed,
child: Text( child: Text('${speed}x', style: textStyle),
'${speed}x',
style: textStyle.copyWith(fontWeight: FontWeight.bold),
),
); );
}).toList(); }).toList();
}, },
@ -352,10 +339,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
alignment: Alignment.center, alignment: Alignment.center,
margin: const EdgeInsets.only(right: 4), margin: const EdgeInsets.only(right: 4),
child: Obx( child: Obx(
() => Text( () => Text('${_.playbackSpeed.toString()}x', style: textStyle),
'${_.playbackSpeed.toString()}x',
style: textStyle.copyWith(fontWeight: FontWeight.bold),
),
), ),
), ),
), ),
@ -734,6 +718,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
lastFullScreenToggleTime = DateTime.now(); lastFullScreenToggleTime = DateTime.now();
// 下滑退出全屏 // 下滑退出全屏
await widget.controller.triggerFullScreen(status: flag); await widget.controller.triggerFullScreen(status: flag);
widget.fullScreenCb?.call(flag);
} }
_distance.value = 0.0; _distance.value = 0.0;
} else if (dy < _distance.value && } else if (dy < _distance.value &&
@ -743,6 +728,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
lastFullScreenToggleTime = DateTime.now(); lastFullScreenToggleTime = DateTime.now();
// 上滑进入全屏 // 上滑进入全屏
await widget.controller.triggerFullScreen(status: !flag); await widget.controller.triggerFullScreen(status: !flag);
widget.fullScreenCb?.call(!flag);
} }
_distance.value = 0.0; _distance.value = 0.0;
} }