|
|
@ -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'); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|