王子贤 2 months ago
parent
commit
a9fad9a0c7
10 changed files with 60 additions and 36 deletions
  1. 1
      lib/controller/discover/room_controller.dart
  2. 6
      lib/controller/message/call_controller.dart
  3. 11
      lib/controller/mine/rose_controller.dart
  4. 8
      lib/controller/setting/spread_controller.dart
  5. 2
      lib/im/im_manager.dart
  6. 3
      lib/model/discover/rtc_channel_model.dart
  7. 18
      lib/pages/discover/live_item_widget.dart
  8. 32
      lib/pages/message/chat_page.dart
  9. 13
      lib/widget/message/chat_input_bar.dart
  10. 2
      lib/widget/message/video_call_invite_dialog.dart

1
lib/controller/discover/room_controller.dart

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

6
lib/controller/message/call_controller.dart

@ -57,6 +57,12 @@ class CallSession {
final end = endTime ?? DateTime.now(); final end = endTime ?? DateTime.now();
return end.difference(startTime).inSeconds; return end.difference(startTime).inSeconds;
} }
@override
String toString() {
return '{callType: $callType, status: $status, isInitiator: $isInitiator}';
}
} }
/// ///

11
lib/controller/mine/rose_controller.dart

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart'; import 'package:fluwx/fluwx.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../discover/room_controller.dart';
class RoseController extends GetxController with WidgetsBindingObserver { class RoseController extends GetxController with WidgetsBindingObserver {
@ -96,6 +97,16 @@ class RoseController extends GetxController with WidgetsBindingObserver {
launchWX.value = false; launchWX.value = false;
count.value = 0; count.value = 0;
getRoseNum(); getRoseNum();
// RoomController
if (Get.isRegistered<RoomController>()) {
try {
final roomController = Get.find<RoomController>();
await roomController.getVirtualAccount();
print('✅ 已刷新 RoomController 的玫瑰余额');
} catch (e) {
print('⚠️ 刷新 RoomController 余额失败: $e');
}
}
} else { } else {
count.value += 1; count.value += 1;
if(count.value < 3){ if(count.value < 3){

8
lib/controller/setting/spread_controller.dart

@ -65,15 +65,15 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
]; ];
} else if(roseList[activePay.value].subCategory == 88802){ } else if(roseList[activePay.value].subCategory == 88802){
revenue.value = [ revenue.value = [
{'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'},
{'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'},
{'icon': '1', 'desc': '礼物收益范围40%,嘉宾消费的分成10%;'},
// {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'},
{'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'},
{'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'},
]; ];
} else if(roseList[activePay.value].subCategory == 88801){ } else if(roseList[activePay.value].subCategory == 88801){
revenue.value = [ revenue.value = [
{'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'},
{'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'},
{'icon': '1', 'desc': '礼物收益范围40%,嘉宾消费的分成10%;'},
// {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'},
{'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'},
{'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'},
]; ];

2
lib/im/im_manager.dart

@ -1902,7 +1902,6 @@ class IMManager {
return; return;
} }
RTMManager.instance.subscribe(channelId ?? '');
// //
Map<String, dynamic>? attributes; Map<String, dynamic>? attributes;
try { try {
@ -1953,6 +1952,7 @@ class IMManager {
tag: 'video_call_invite_dialog', tag: 'video_call_invite_dialog',
builder: (context) { builder: (context) {
return VideoCallInviteDialog( return VideoCallInviteDialog(
callType: callType,
avatarUrl: finalAvatarUrl, avatarUrl: finalAvatarUrl,
nickName: finalNickName, nickName: finalNickName,
onTap: () async { onTap: () async {

3
lib/model/discover/rtc_channel_model.dart

@ -3,11 +3,13 @@ class RtcChannelModel {
final String channelId; final String channelId;
final String channelPic; final String channelPic;
final String channelName; final String channelName;
final int age;
RtcChannelModel({ RtcChannelModel({
required this.channelId, required this.channelId,
required this.channelPic, required this.channelPic,
required this.channelName, required this.channelName,
required this.age,
}); });
factory RtcChannelModel.fromJson(Map<String, dynamic> json) { factory RtcChannelModel.fromJson(Map<String, dynamic> json) {
@ -15,6 +17,7 @@ class RtcChannelModel {
channelId: json['channelId']?.toString() ?? '', channelId: json['channelId']?.toString() ?? '',
channelPic: json['channelPic']?.toString() ?? '', channelPic: json['channelPic']?.toString() ?? '',
channelName: json['channelName']?.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( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
"福州 | 28岁",
widget.channel?.age != 0 && widget.channel?.age != null ? "${widget.channel?.channelName} | ${widget.channel?.age}" : widget.channel?.channelName ?? '',
style: TextStyle( style: TextStyle(
fontSize: 11.w, fontSize: 11.w,
color: Colors.white, color: Colors.white,

32
lib/pages/message/chat_page.dart

@ -62,6 +62,9 @@ class _ChatPageState extends State<ChatPage> {
// //
final activeGift = ValueNotifier<int?>(null); final activeGift = ValueNotifier<int?>(null);
final giftNum = ValueNotifier<int>(1); final giftNum = ValueNotifier<int>(1);
// ChatInputBar GlobalKey
final GlobalKey<State<ChatInputBar>> _chatInputBarKey = GlobalKey<State<ChatInputBar>>();
@override @override
void initState() { void initState() {
@ -305,18 +308,20 @@ class _ChatPageState extends State<ChatPage> {
}, },
), ),
), ),
body: Column(
children: [
//
Expanded(
child: Container(
color: Color(0xffF5F5F5),
child: GestureDetector(
onTap: () {
//
FocusManager.instance.primaryFocus?.unfocus();
},
behavior: HitTestBehavior.opaque,
body: GestureDetector(
onTap: () {
//
FocusManager.instance.primaryFocus?.unfocus();
//
ChatInputBar.closePanels(_chatInputBarKey);
},
behavior: HitTestBehavior.opaque,
child: Column(
children: [
//
Expanded(
child: Container(
color: Color(0xffF5F5F5),
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
reverse: false, reverse: false,
@ -375,9 +380,9 @@ class _ChatPageState extends State<ChatPage> {
), ),
), ),
), ),
),
// 使 // 使
ChatInputBar( ChatInputBar(
key: _chatInputBarKey,
onSendMessage: (message) async { onSendMessage: (message) async {
await controller.sendMessage(message); await controller.sendMessage(message);
}, },
@ -404,6 +409,7 @@ class _ChatPageState extends State<ChatPage> {
}, },
), ),
], ],
),
), ),
), ),
); );

13
lib/widget/message/chat_input_bar.dart

@ -31,6 +31,14 @@ class ChatInputBar extends StatefulWidget {
@override @override
State<ChatInputBar> createState() => _ChatInputBarState(); State<ChatInputBar> createState() => _ChatInputBarState();
// key
static void closePanels(GlobalKey? key) {
final state = key?.currentState;
if (state != null && state is _ChatInputBarState) {
state.closeAllPanels();
}
}
} }
class _ChatInputBarState extends State<ChatInputBar> { class _ChatInputBarState extends State<ChatInputBar> {
@ -109,6 +117,11 @@ class _ChatInputBarState extends State<ChatInputBar> {
} }
} }
//
void closeAllPanels() {
_closeAllPanels();
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();

2
lib/widget/message/video_call_invite_dialog.dart

@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/generated/assets.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
/// ///
class VideoCallInviteDialog extends StatelessWidget { class VideoCallInviteDialog extends StatelessWidget {
@ -26,6 +27,7 @@ class VideoCallInviteDialog extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.log('VideoCallInviteDialog$callType');
return GestureDetector( return GestureDetector(
onTap: onTap, onTap: onTap,
child: Container( child: Container(

Loading…
Cancel
Save