Browse Source

feat(discover): 更新直播间组件显示年龄信息并移除积分不足提示

- 在RtcChannelModel模型中添加age字段用于存储年龄信息
- 修改live_item_widget.dart中的UI逻辑,将频道名称和年龄信息合并显示
- 移除直播间控制器中的积分不足toast提示信息
- 优化直播间成员信息展示格式,支持年龄信息动态显示
master
Jolie 2 months ago
parent
commit
20fd31efed
3 changed files with 4 additions and 18 deletions
  1. 1
      lib/controller/discover/room_controller.dart
  2. 3
      lib/model/discover/rtc_channel_model.dart
  3. 18
      lib/pages/discover/live_item_widget.dart

1
lib/controller/discover/room_controller.dart

@ -272,7 +272,6 @@ class RoomController extends GetxController with WidgetsBindingObserver {
return;
}
if (!response.data.data['success']) {
SmartDialog.showToast('积分不足');
return;
}
currentRole = role;

3
lib/model/discover/rtc_channel_model.dart

@ -3,11 +3,13 @@ class RtcChannelModel {
final String channelId;
final String channelPic;
final String channelName;
final int age;
RtcChannelModel({
required this.channelId,
required this.channelPic,
required this.channelName,
required this.age,
});
factory RtcChannelModel.fromJson(Map<String, dynamic> json) {
@ -15,6 +17,7 @@ class RtcChannelModel {
channelId: json['channelId']?.toString() ?? '',
channelPic: json['channelPic']?.toString() ?? '',
channelName: json['channelName']?.toString() ?? '',
age: json['age'] ?? 0,
);
}

18
lib/pages/discover/live_item_widget.dart

@ -187,27 +187,11 @@ class _LiveItemWidgetState extends State<LiveItemWidget> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 64.w,
child: Text(
widget.channel != null && widget.channel!.channelName.isNotEmpty
? widget.channel!.channelName
: "一直一直在等你一直一直在等你......",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 8.w,
color: Colors.white,
fontWeight: FontWeight.w500,
),
),
),
SizedBox(height: 2.w),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"福州 | 28岁",
widget.channel?.age != 0 && widget.channel?.age != null ? "${widget.channel?.channelName} | ${widget.channel?.age}" : widget.channel?.channelName ?? '',
style: TextStyle(
fontSize: 11.w,
color: Colors.white,

Loading…
Cancel
Save