diff --git a/assets/images/login_logo.png b/assets/images/login_logo.png index 8c2e9d6..085b04c 100644 Binary files a/assets/images/login_logo.png and b/assets/images/login_logo.png differ diff --git a/assets/images/rtc_empty.png b/assets/images/rtc_empty.png new file mode 100644 index 0000000..3ab6e85 Binary files /dev/null and b/assets/images/rtc_empty.png differ diff --git a/lib/controller/discover/room_controller.dart b/lib/controller/discover/room_controller.dart index d8b3fb9..7be37ee 100644 --- a/lib/controller/discover/room_controller.dart +++ b/lib/controller/discover/room_controller.dart @@ -429,24 +429,20 @@ class RoomController extends GetxController with WidgetsBindingObserver { // 在公屏显示赠送礼物消息 final senderNickName = GlobalData().userData?.nickName ?? '用户'; String targetNickName = '用户'; - final targetUserIdStr = targetUserId.toString(); // 从频道详情中查找目标用户昵称 final channelDetail = rtcChannelDetail.value; if (channelDetail != null) { // 检查是否是主持人 - if (channelDetail.anchorInfo?.userId == targetUserIdStr || - channelDetail.anchorInfo?.miId == targetUserIdStr) { + if (channelDetail.anchorInfo?.uid == targetUserId) { targetNickName = channelDetail.anchorInfo?.nickName ?? '用户'; } // 检查是否是男嘉宾 - else if (channelDetail.maleInfo?.userId == targetUserIdStr || - channelDetail.maleInfo?.miId == targetUserIdStr) { + else if (channelDetail.maleInfo?.uid == targetUserId) { targetNickName = channelDetail.maleInfo?.nickName ?? '用户'; } // 检查是否是女嘉宾 - else if (channelDetail.femaleInfo?.userId == targetUserIdStr || - channelDetail.femaleInfo?.miId == targetUserIdStr) { + else if (channelDetail.femaleInfo?.uid == targetUserId) { targetNickName = channelDetail.femaleInfo?.nickName ?? '用户'; } } diff --git a/lib/controller/mine/mine_controller.dart b/lib/controller/mine/mine_controller.dart index 2b4bc24..59a2cb6 100644 --- a/lib/controller/mine/mine_controller.dart +++ b/lib/controller/mine/mine_controller.dart @@ -7,6 +7,7 @@ import 'package:dating_touchme_app/pages/mine/rose_page.dart'; import 'package:dating_touchme_app/pages/mine/user_help_center_page.dart'; import 'package:get/get.dart'; +import '../../pages/setting/match_spread_page.dart'; import '../../pages/setting/setting_page.dart'; class MineController extends GetxController { @@ -24,7 +25,7 @@ class MineController extends GetxController { {"icon": Assets.imagesWallet, "title": "我的钱包", "subTitle": "提现无门槛", "path": () => MyWalletPage()}, {"icon": Assets.imagesShop, "title": "商城中心", "subTitle": "不定期更新商品", "path": () => Null}, {"icon": Assets.imagesCert, "title": "认证中心", "subTitle": GlobalData().userData?.identityCard == null || GlobalData().userData?.profilePhoto == null ? "未认证" : "已认证", "path": () => AuthCenterPage()}, - {"icon": Assets.imagesMatchmaker, "title": "红娘等级", "subTitle": "实习红娘", "path": () => MatchmakerUpdatePage()}, + {"icon": Assets.imagesMatchmaker, "title": "红娘等级", "subTitle": "实习红娘", "path": () => MatchSpreadPage()}, ].obs; List settingList = [ diff --git a/lib/controller/setting/spread_controller.dart b/lib/controller/setting/spread_controller.dart index 8ec2346..f4ff470 100644 --- a/lib/controller/setting/spread_controller.dart +++ b/lib/controller/setting/spread_controller.dart @@ -7,6 +7,8 @@ import 'package:fluwx/fluwx.dart'; import 'package:get/get.dart'; import 'package:get_storage/get_storage.dart'; +import '../../generated/assets.dart'; + class SpreadController extends GetxController with WidgetsBindingObserver { // UserApi实例 @@ -23,6 +25,13 @@ class SpreadController extends GetxController with WidgetsBindingObserver { final matchmakerFlag = false.obs; final button = '去相亲'.obs; + final revenue = [ + {'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'}, + {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, + {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, + {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, + ].obs; + changePayActive(int index){ if(index < enableIndex.value && enableIndex.value >= 0){ return; @@ -39,19 +48,37 @@ class SpreadController extends GetxController with WidgetsBindingObserver { } else { button.value = '立即加入'; } - } - - List list2 = [ - {'title': '邀请注册', 'unit': '10%', 'desc': '分佣', 'enable': 1, 'value': 111, 'icon': 'icon-right1'}, - {'title': '发布悬赏', 'unit': '10%', 'desc': '分佣', 'enable': 1, 'value': 112, 'icon': 'icon-right2'}, - {'title': '匹配悬赏', 'unit': '10%', 'desc': '分佣', 'enable': 0, 'value': 113, 'icon': 'icon-right41'}, - {'title': '推荐红娘', 'unit': '10%', 'desc': '分佣', 'enable': 1, 'value': 114, 'icon': 'icon-right3'}, - {'title': '免费升级', 'desc': '门店合伙人', 'enable': 0, 'value': 0, 'icon': 'icon-right51'}, - {'title': '资源共享', 'desc': '所有资料', 'enable': 1, 'value': 0, 'icon': 'icon-right6'}, - {'title': '业绩奖励', 'unit': '5%', 'desc': '奖励', 'enable': 1, 'value': 0, 'icon': 'icon-right71'}, - {'title': '次年续签', 'unit': '90%', 'desc': '减免', 'enable': 1, 'value': 0, 'icon': 'icon-right8'} - ].obs; + // 实习红娘 + if(roseList[activePay.value].subCategory == 88804){ + revenue.value = [ + {'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'}, + {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, + {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, + {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, + ]; + } else if(roseList[activePay.value].subCategory == 88803){ + revenue.value = [ + {'icon': '1', 'desc': '礼物收益范围30%-40%,嘉宾消费的分成6%;'}, + {'icon': '2', 'desc': '每天前5人连麦的礼物收益30%,第6-10人连麦的礼物收益35%,第11人以上连麦的礼物收益40%;'}, + {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, + {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, + ]; + } else if(roseList[activePay.value].subCategory == 88802){ + revenue.value = [ + {'icon': '1', 'desc': '礼物收益固定40%,邀请嘉宾,嘉宾消费的分成10%'}, + {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, + {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, + ]; + } else if(roseList[activePay.value].subCategory == 88801){ + revenue.value = [ + {'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'}, + {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, + {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, + {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, + ]; + } + } // 倒计时秒数 final countdownSeconds = 0.obs; diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index 0e6b11c..fb0608c 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -166,6 +166,7 @@ class Assets { static const String imagesRoseBanner = 'assets/images/rose_banner.png'; static const String imagesRoseGift = 'assets/images/rose_gift.png'; static const String imagesRoseWhite = 'assets/images/rose_white.png'; + static const String imagesRtcEmpty = 'assets/images/rtc_empty.png'; static const String imagesSearch = 'assets/images/search.png'; static const String imagesSeat = 'assets/images/seat.png'; static const String imagesSendCall = 'assets/images/send_call.png'; diff --git a/lib/im/im_manager.dart b/lib/im/im_manager.dart index a448fea..803cb06 100644 --- a/lib/im/im_manager.dart +++ b/lib/im/im_manager.dart @@ -442,9 +442,14 @@ class IMManager { return await EMClient.getInstance.chatManager.sendMessage(customMsg); } + /// 获取所有联系人 + Future> getAllContacts() async { + return await EMClient.getInstance.contactManager.fetchAllContacts(); + } + /// 获取会话列表 Future> getConversations() async { - return EMClient.getInstance.chatManager.loadAllConversations(); + return await EMClient.getInstance.chatManager.loadAllConversations(); } /// 获取用户信息(单个用户) diff --git a/lib/model/mine/rose_data.dart b/lib/model/mine/rose_data.dart index 0410a90..1e0cf62 100644 --- a/lib/model/mine/rose_data.dart +++ b/lib/model/mine/rose_data.dart @@ -10,6 +10,7 @@ class RoseData { num? unitSellingPrice; String? purchaseTimeValue; String? validityPeriodDays; + String? liveDurationHours; RoseData( {this.productId, @@ -22,7 +23,8 @@ class RoseData { this.unitOriginalPrice, this.unitSellingPrice, this.purchaseTimeValue, - this.validityPeriodDays + this.validityPeriodDays, + this.liveDurationHours }); RoseData.fromJson(Map json) { @@ -37,6 +39,7 @@ class RoseData { unitSellingPrice = json['unitSellingPrice']; purchaseTimeValue = json['purchaseTimeValue']; validityPeriodDays = json['validityPeriodDays']; + liveDurationHours = json['liveDurationHours']; } Map toJson() { @@ -52,6 +55,7 @@ class RoseData { data['unitSellingPrice'] = this.unitSellingPrice; data['purchaseTimeValue'] = this.purchaseTimeValue; data['validityPeriodDays'] = this.validityPeriodDays; + data['liveDurationHours'] = this.liveDurationHours; return data; } } diff --git a/lib/pages/discover/dating_page.dart b/lib/pages/discover/dating_page.dart index 66dc723..23847ae 100644 --- a/lib/pages/discover/dating_page.dart +++ b/lib/pages/discover/dating_page.dart @@ -8,6 +8,7 @@ import 'package:get/get.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart'; import '../../controller/discover/room_controller.dart'; +import '../../generated/assets.dart'; /// 相亲页面 class DatingPage extends StatefulWidget { @@ -113,12 +114,15 @@ class _DatingPageState extends State } if (discoverController.rtcChannelList.isEmpty) { return Center( - child: Text( - '暂无直播频道,点击刷新', - style: TextStyle( - fontSize: 14.w, - color: Colors.black38, - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset(Assets.imagesRtcEmpty, width: 332.w, height: 222.w), + const SizedBox(height: 24), + Text('暂无直播频道,点击刷新', style: TextStyle(fontSize: 14.w, color: Colors.black38)), + const SizedBox(height: 64), + ], ), ).onTap((){ discoverController.loadRtcChannelPage(); diff --git a/lib/pages/discover/live_room_page.dart b/lib/pages/discover/live_room_page.dart index 16a7d01..9c4cc4c 100644 --- a/lib/pages/discover/live_room_page.dart +++ b/lib/pages/discover/live_room_page.dart @@ -73,6 +73,8 @@ class _LiveRoomPageState extends State { } void _showGiftPopup() { + // 隐藏键盘 + FocusScope.of(context).unfocus(); SmartDialog.show( alignment: Alignment.bottomCenter, maskColor: TDTheme.of(context).fontGyColor2, @@ -92,6 +94,8 @@ class _LiveRoomPageState extends State { } void _showRechargePopup() { + // 隐藏键盘 + FocusScope.of(context).unfocus(); SmartDialog.show( alignment: Alignment.bottomCenter, maskColor: TDTheme.of(context).fontGyColor2, diff --git a/lib/pages/home/user_information_page.dart b/lib/pages/home/user_information_page.dart index 0ed8dc7..ddb1520 100644 --- a/lib/pages/home/user_information_page.dart +++ b/lib/pages/home/user_information_page.dart @@ -233,7 +233,7 @@ class UserInformationPage extends StatelessWidget { ), ), Text( - "动我ID:${userId}", + "趣恋恋ID:${userId}", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) diff --git a/lib/pages/message/friend_tab.dart b/lib/pages/message/friend_tab.dart index c26ecd1..39a7259 100644 --- a/lib/pages/message/friend_tab.dart +++ b/lib/pages/message/friend_tab.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; import 'package:dating_touchme_app/generated/assets.dart'; +import 'package:get/get.dart'; +import 'package:dating_touchme_app/controller/message/friend_controller.dart'; +import 'package:im_flutter_sdk/im_flutter_sdk.dart'; class FriendTab extends StatefulWidget { const FriendTab({super.key}); @@ -45,45 +48,45 @@ class _FriendTabState extends State with TickerProviderStateMixin { }, ]; - // 模拟数据 - 好友列表 - final List> _friendList = [ - { - "id": 1, - "name": "林园园", - "avatar": Assets.imagesAvatarsExample, - "isOnline": true, - }, - { - "id": 2, - "name": "李晖", - "avatar": Assets.imagesAvatarsExample, - "isOnline": false, - }, - { - "id": 3, - "name": "李哲", - "avatar": Assets.imagesAvatarsExample, - "isOnline": false, - }, - { - "id": 4, - "name": "李夏", - "avatar": Assets.imagesAvatarsExample, - "isOnline": true, - }, - { - "id": 5, - "name": "张雪", - "avatar": Assets.imagesAvatarsExample, - "isOnline": false, - }, - { - "id": 6, - "name": "王强", - "avatar": Assets.imagesAvatarsExample, - "isOnline": true, - }, - ]; + // 模拟数据 - 好友列表(已废弃,现在使用 FriendController 从 IM 获取) + // final List> _friendList = [ + // { + // "id": 1, + // "name": "林园园", + // "avatar": Assets.imagesAvatarsExample, + // "isOnline": true, + // }, + // { + // "id": 2, + // "name": "李晖", + // "avatar": Assets.imagesAvatarsExample, + // "isOnline": false, + // }, + // { + // "id": 3, + // "name": "李哲", + // "avatar": Assets.imagesAvatarsExample, + // "isOnline": false, + // }, + // { + // "id": 4, + // "name": "李夏", + // "avatar": Assets.imagesAvatarsExample, + // "isOnline": true, + // }, + // { + // "id": 5, + // "name": "张雪", + // "avatar": Assets.imagesAvatarsExample, + // "isOnline": false, + // }, + // { + // "id": 6, + // "name": "王强", + // "avatar": Assets.imagesAvatarsExample, + // "isOnline": true, + // }, + // ]; // 模拟数据 - 粉丝列表 final List> _fansList = [ @@ -301,17 +304,56 @@ class _FriendTabState extends State with TickerProviderStateMixin { // 构建好友列表 Widget _buildFriendList() { - return ListView.builder( - padding: const EdgeInsets.only(top: 8), - itemCount: _friendList.length, - itemBuilder: (context, index) { - final friend = _friendList[index]; - return _buildFriendItem(friend); + return GetX( + init: FriendController(), + builder: (controller) { + if (controller.isLoading.value) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (controller.errorMessage.value.isNotEmpty) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + controller.errorMessage.value, + style: const TextStyle(color: Colors.grey), + ), + const SizedBox(height: 16), + ElevatedButton( + onPressed: () => controller.refreshFriends(), + child: const Text('重试'), + ), + ], + ), + ); + } + + if (controller.friendList.isEmpty) { + return const Center( + child: Text( + '暂无好友', + style: TextStyle(color: Colors.grey), + ), + ); + } + + return ListView.builder( + padding: const EdgeInsets.only(top: 8), + itemCount: controller.friendList.length, + itemBuilder: (context, index) { + final contact = controller.friendList[index]; + return _buildFriendItemFromContact(contact); + }, + ); }, ); } - // 构建好友项 + // 构建好友项(从 Map 数据,保留用于兼容) Widget _buildFriendItem(Map friend) { return Container( margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), @@ -387,6 +429,68 @@ class _FriendTabState extends State with TickerProviderStateMixin { ); } + // 构建好友项(从 EMContact 数据) + Widget _buildFriendItemFromContact(EMContact contact) { + // EMContact 只有 userId,需要通过其他方式获取详细信息 + // 这里先显示 userId,后续可以通过 getUserInfo 获取详细信息 + final userId = contact.userId; + + return Container( + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + // 头像 + Container( + width: 50, + height: 50, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(25), + child: const Icon(Icons.person, size: 30), + ), + ), + + // 信息 + Expanded( + child: Container( + margin: const EdgeInsets.only(left: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + userId, + style: const TextStyle( + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 4), + Text( + "ID: $userId", + style: const TextStyle( + color: Colors.grey, + fontSize: 12, + ), + ), + ], + ), + ), + ), + + // 箭头图标 + const Icon(Icons.arrow_forward_ios, size: 16, color: Colors.grey), + ], + ), + ); + } + // 构建粉丝列表 Widget _buildFansList() { return ListView.builder( diff --git a/lib/pages/mine/edit_info_page.dart b/lib/pages/mine/edit_info_page.dart index 084a9d3..c3a9821 100644 --- a/lib/pages/mine/edit_info_page.dart +++ b/lib/pages/mine/edit_info_page.dart @@ -1061,7 +1061,7 @@ class _EditInfoPageState extends State { ), ), Text( - "动我ID:${controller.userData.value?.id}", + "趣恋恋ID:${controller.userData.value?.id}", style: TextStyle( fontSize: 9.w, color: const Color.fromRGBO(144, 144, 144, 1) diff --git a/lib/pages/mine/login_page.dart b/lib/pages/mine/login_page.dart index 5d1e44b..7ff89ab 100644 --- a/lib/pages/mine/login_page.dart +++ b/lib/pages/mine/login_page.dart @@ -184,7 +184,7 @@ class LoginPage extends StatelessWidget { // 跳转到用户协议页面 }, child: const Text( - '《动我用户协议》', + '《趣恋恋用户协议》', style: TextStyle( fontSize: 11, color: Color.fromRGBO(74, 99, 235, 1), diff --git a/lib/pages/mine/rose_page.dart b/lib/pages/mine/rose_page.dart index 0be78a8..165bcfd 100644 --- a/lib/pages/mine/rose_page.dart +++ b/lib/pages/mine/rose_page.dart @@ -178,7 +178,7 @@ class RosePage extends StatelessWidget { ) ), TextSpan( - text: "《动我充值协议》", + text: "《趣恋恋充值协议》", style: TextStyle( color: Color.fromRGBO(71, 123, 255, 1) ) diff --git a/lib/pages/mine/vip_page.dart b/lib/pages/mine/vip_page.dart index 16af040..50d4774 100644 --- a/lib/pages/mine/vip_page.dart +++ b/lib/pages/mine/vip_page.dart @@ -145,7 +145,7 @@ class _VipPageState extends State { ), SizedBox(height: 29.w,), Text( - "开通 动我vip 畅享尊贵特权~", + "开通 趣恋恋vip 畅享尊贵特权~", style: TextStyle( fontSize: 11.w, color: const Color.fromRGBO(144, 144, 144, 1 ) diff --git a/lib/pages/setting/match_spread_page.dart b/lib/pages/setting/match_spread_page.dart index 292fe84..5e6586f 100644 --- a/lib/pages/setting/match_spread_page.dart +++ b/lib/pages/setting/match_spread_page.dart @@ -70,132 +70,27 @@ class MatchSpreadPage extends StatelessWidget { SizedBox(height: 24.w), Row( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('新红娘入驻权益', style: TextStyle(fontSize: 22, color: Color(0xFF333333))), - SizedBox(width: 4.w), - Container( - padding: EdgeInsets.symmetric(vertical: 2.w, horizontal: 4.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(4.w)), - gradient: LinearGradient( - begin: Alignment.topLeft, // 0%:左边开始 - end: Alignment.bottomRight, // 100%:右边结束 - colors: [ - Color(0xFFF8C18E), // 紫色 - Color(0xFFF9DFC3),// 右侧深蓝 - ], - stops: [0.0, 1.0], // 对应 CSS 百分比:0%、77.53%、100% - ), + Text( + "新红娘入驻权益", + style: TextStyle( + fontSize: 22.w, + color: const Color.fromRGBO(48, 48, 48, 1), + fontWeight: FontWeight.w500 ), - child: Text('限时', style: TextStyle(fontSize: 12, color: Color(0xFF894A0D))), + ), + SizedBox(width: 4.w,), + Image.asset( + Assets.imagesLimitTime, + width: 30.w, + height: 16.w, ) ], ), SizedBox(height: 16.w,), - Container( - padding: EdgeInsets.symmetric( - vertical: 12.w, - horizontal: 18.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: const Color.fromRGBO(117, 98, 249, .1) - ), - child: Row( - children: [ - Image.asset( - Assets.imagesVipGift, - width: 34.w, - ), - SizedBox(width: 16.w,), - Expanded( - child: Text( - '礼物收益范围15%-30%,嘉宾消费的分成3%;', - style: TextStyle(color: Color(0xFF333333)), - ), - ) - ], - ), - ), - SizedBox(height: 12.w,), - Container( - padding: EdgeInsets.symmetric( - vertical: 12.w, - horizontal: 18.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: const Color.fromRGBO(117, 98, 249, .1) - ), - child: Row( - children: [ - Image.asset( - Assets.imagesMatchmakerIcon2, - width: 34.w, - ), - SizedBox(width: 16.w,), - Expanded( - child: Text( - '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;', - style: TextStyle(color: Color(0xFF333333)), - ), - ) - ], - ), - ), - SizedBox(height: 12.w,), - Container( - padding: EdgeInsets.symmetric( - vertical: 12.w, - horizontal: 18.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: const Color.fromRGBO(117, 98, 249, .1) - ), - child: Row( - children: [ - Image.asset( - Assets.imagesMatchmakerIcon3, - width: 34.w, - ), - SizedBox(width: 16.w,), - Expanded( - child: Text( - '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;', - style: TextStyle(color: Color(0xFF333333)), - ), - ) - ], - ), - ), - SizedBox(height: 12.w,), - Container( - padding: EdgeInsets.symmetric( - vertical: 18.w, - horizontal: 18.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: const Color.fromRGBO(117, 98, 249, .1) - ), - child: Row( - children: [ - Image.asset( - Assets.imagesMatchmakerIcon4, - width: 34.w, - ), - SizedBox(width: 16.w,), - Expanded( - child: Text( - '新徒弟首月收益的10%(平台奖励)', - style: TextStyle(color: Color(0xFF333333)), - ), - ) - ], - ), - ), + ...controller.revenue.map((entry){ + return RevenueItem(item: entry); + }), ], ), ), @@ -298,7 +193,7 @@ class _PayItemState extends State { color: Color(0xFF333333), fontWeight: FontWeight.bold ), - ) : Text('+10小时视频相亲', + ) : Text('+${widget.item.liveDurationHours ?? '10'}小时视频相亲', style: TextStyle( fontSize: 12.w, color: Color(0xFF999999), @@ -331,4 +226,60 @@ class _PayItemState extends State { widget.changeActive(widget.index); }); } +} + + +class RevenueItem extends StatefulWidget { + final dynamic item; + const RevenueItem({super.key, required this.item}); + + @override + State createState() => _RevenueItemState(); +} + +class _RevenueItemState extends State { + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(17.w), + margin: EdgeInsets.only(bottom: 8.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(16.w)), + color: const Color.fromRGBO(117, 98, 249, .1) + ), + child: Row( + children: [ + Image.asset( + _getButtonImage(widget.item['icon']), + width: 26.w, + height: 26.w, + ), + SizedBox(width: 14.w,), + Expanded( + child: Text( + widget.item['desc'], + style: TextStyle( + fontSize: 12.w, + color: Color(0xFF999999) + ), + ), + ) + ], + ), + ); + } + + String _getButtonImage(String icon) { + if(icon == '1'){ + return Assets.imagesMatchmakerIcon1; + } + if(icon == '2'){ + return Assets.imagesMatchmakerIcon2; + } + if(icon == '3'){ + return Assets.imagesMatchmakerIcon3; + } + return Assets.imagesMatchmakerIcon4; // 直播显示直播间按钮(放在HI位置) + } } \ No newline at end of file diff --git a/lib/service/live_chat_message_service.dart b/lib/service/live_chat_message_service.dart index 6946158..4dedf1f 100644 --- a/lib/service/live_chat_message_service.dart +++ b/lib/service/live_chat_message_service.dart @@ -69,6 +69,8 @@ class LiveChatMessageService { // 处理结束直播消息 if (messageData['type'] == 'end_live') { + RoomController controller = Get.find(); + await controller.leaveChannel(); _handleEndLiveMessage(); return; } diff --git a/lib/widget/live/live_recharge_popup.dart b/lib/widget/live/live_recharge_popup.dart index 966a580..a8fa362 100644 --- a/lib/widget/live/live_recharge_popup.dart +++ b/lib/widget/live/live_recharge_popup.dart @@ -277,7 +277,7 @@ class LiveRechargePopup extends StatelessWidget { print('打开充值协议'); }, child: Text( - "《动我充值协议》", + "《趣恋恋充值协议》", style: TextStyle( fontSize: 11.w, color: const Color.fromRGBO(71, 123, 255, 1),