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/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/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/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