|
|
@ -3,6 +3,7 @@ import 'dart:convert'; |
|
|
import 'package:agora_rtc_engine/agora_rtc_engine.dart'; |
|
|
import 'package:agora_rtc_engine/agora_rtc_engine.dart'; |
|
|
import 'package:dating_touchme_app/controller/global.dart'; |
|
|
import 'package:dating_touchme_app/controller/global.dart'; |
|
|
import 'package:dating_touchme_app/model/live/gift_product_model.dart'; |
|
|
import 'package:dating_touchme_app/model/live/gift_product_model.dart'; |
|
|
|
|
|
import 'package:dating_touchme_app/model/rtc/link_mic_card_model.dart'; |
|
|
import 'package:dating_touchme_app/model/rtc/rtc_channel_data.dart'; |
|
|
import 'package:dating_touchme_app/model/rtc/rtc_channel_data.dart'; |
|
|
import 'package:dating_touchme_app/model/rtc/rtc_channel_detail.dart'; |
|
|
import 'package:dating_touchme_app/model/rtc/rtc_channel_detail.dart'; |
|
|
import 'package:dating_touchme_app/network/network_service.dart'; |
|
|
import 'package:dating_touchme_app/network/network_service.dart'; |
|
|
@ -49,6 +50,12 @@ class RoomController extends GetxController with WidgetsBindingObserver { |
|
|
/// 礼物产品列表 |
|
|
/// 礼物产品列表 |
|
|
final RxList<GiftProductModel> giftProducts = <GiftProductModel>[].obs; |
|
|
final RxList<GiftProductModel> giftProducts = <GiftProductModel>[].obs; |
|
|
|
|
|
|
|
|
|
|
|
/// 连麦卡片信息 |
|
|
|
|
|
final Rxn<LinkMicCardModel> linkMicCard = Rxn<LinkMicCardModel>(); |
|
|
|
|
|
|
|
|
|
|
|
/// 玫瑰数量 |
|
|
|
|
|
final RxInt roseCount = 0.obs; |
|
|
|
|
|
|
|
|
/// 消息服务实例 |
|
|
/// 消息服务实例 |
|
|
final LiveChatMessageService _messageService = |
|
|
final LiveChatMessageService _messageService = |
|
|
LiveChatMessageService.instance; |
|
|
LiveChatMessageService.instance; |
|
|
@ -631,4 +638,40 @@ class RoomController extends GetxController with WidgetsBindingObserver { |
|
|
SmartDialog.showToast('踢出用户失败'); |
|
|
SmartDialog.showToast('踢出用户失败'); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// 获取用户道具连麦卡片 |
|
|
|
|
|
Future<void> getUserPropLinkMicCard() async { |
|
|
|
|
|
try { |
|
|
|
|
|
final response = await _networkService.rtcApi.getUserPropLinkMicCard(); |
|
|
|
|
|
final base = response.data; |
|
|
|
|
|
if (base.isSuccess && base.data != null) { |
|
|
|
|
|
linkMicCard.value = base.data; |
|
|
|
|
|
print('✅ 获取连麦卡片成功: type=${base.data!.type}, num=${base.data!.num}, unitSellingPrice=${base.data!.unitSellingPrice}'); |
|
|
|
|
|
} else { |
|
|
|
|
|
linkMicCard.value = null; |
|
|
|
|
|
print('❌ 获取连麦卡片失败: ${base.message}'); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
linkMicCard.value = null; |
|
|
|
|
|
print('❌ 获取连麦卡片异常: $e'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// 获取虚拟账户(玫瑰数量) |
|
|
|
|
|
Future<void> getVirtualAccount() async { |
|
|
|
|
|
try { |
|
|
|
|
|
final response = await _networkService.userApi.getVirtualAccount({}); |
|
|
|
|
|
final base = response.data; |
|
|
|
|
|
if (base.isSuccess && base.data != null) { |
|
|
|
|
|
roseCount.value = base.data!.balance ?? 0; |
|
|
|
|
|
print('✅ 获取玫瑰数量成功: ${roseCount.value}'); |
|
|
|
|
|
} else { |
|
|
|
|
|
roseCount.value = 0; |
|
|
|
|
|
print('❌ 获取玫瑰数量失败: ${base.message}'); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
roseCount.value = 0; |
|
|
|
|
|
print('❌ 获取玫瑰数量异常: $e'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |