Browse Source

no message

ios
ZHR007 3 months ago
parent
commit
6e19704153
2 changed files with 16 additions and 21 deletions
  1. 35
      lib/controller/setting/spread_controller.dart
  2. 2
      lib/model/mine/chat_static_data.dart

35
lib/controller/setting/spread_controller.dart

@ -87,8 +87,7 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
if(GlobalData().userData!.matchmakerFlag != null && GlobalData().userData!.matchmakerFlag!){ if(GlobalData().userData!.matchmakerFlag != null && GlobalData().userData!.matchmakerFlag!){
matchmakerFlag.value = true; matchmakerFlag.value = true;
} }
getRoseList();
getChatInfo();
initDataList();
} }
@override @override
@ -131,9 +130,14 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
super.onClose(); super.onClose();
} }
getChatInfo() async {
initDataList() async {
try{ try{
final result = await _userApi.getMatchmakerFee();
if (result.data.isSuccess && result.data.data != null) {
roseList.value = result.data.data!.records;
}
final response = await _userApi.getChatStaticsInfo(); final response = await _userApi.getChatStaticsInfo();
print('canApply: 137');
if (response.data.isSuccess && response.data.data != null) { if (response.data.isSuccess && response.data.data != null) {
final data = response.data.data!; final data = response.data.data!;
if(roseList[activePay.value].liveDurationHours != null){ if(roseList[activePay.value].liveDurationHours != null){
@ -143,25 +147,16 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
} }
} }
} }
} catch (e) {
print('spread: $e');
}
}
getRoseList() async {
try{
final response = await _userApi.getMatchmakerFee();
if (response.data.isSuccess && response.data.data != null) {
final data = response.data.data!.records;
roseList.addAll(data.toList());
if(matchmakerFlag.value){
final index = roseList.indexWhere((item) => item.subCategory == GlobalData().userData!.matchmakerType!);
enableIndex.value = index >= 0 ? index : 0;
changePayActive(enableIndex.value);
}
print('canApply: $canApply');
if(matchmakerFlag.value){
final index = roseList.indexWhere((item) => item.subCategory == GlobalData().userData!.matchmakerType!);
enableIndex.value = index >= 0 ? index : 0;
changePayActive(enableIndex.value);
} else {
changePayActive(0);
} }
} catch (e) { } catch (e) {
print('玫瑰列表获取失败: $e');
print('spread: $e');
} }
} }

2
lib/model/mine/chat_static_data.dart

@ -1,6 +1,6 @@
// //
class ChatStaticData { class ChatStaticData {
final String id;
final int id;
final int liveDurationMins; final int liveDurationMins;
final int todayCrossMicCount; final int todayCrossMicCount;

Loading…
Cancel
Save