王子贤 3 months ago
parent
commit
5e7d53a8f1
1 changed files with 26 additions and 15 deletions
  1. 41
      lib/controller/setting/spread_controller.dart

41
lib/controller/setting/spread_controller.dart

@ -22,6 +22,7 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
final matchmakerFlag = false.obs; final matchmakerFlag = false.obs;
final button = '去相亲'.obs; final button = '去相亲'.obs;
bool canApply = false; bool canApply = false;
String paymentOrderId = '';
final revenue = [ final revenue = [
{'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'}, {'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'},
{'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'},
@ -37,6 +38,8 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
if(matchmakerFlag.value){ if(matchmakerFlag.value){
if(activePay.value > enableIndex.value){ if(activePay.value > enableIndex.value){
button.value = '立即升级'; button.value = '立即升级';
} else if(activePay.value == 0){
button.value = '去直播';
} else { } else {
button.value = '立即续费'; button.value = '立即续费';
} }
@ -102,23 +105,30 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
// //
void startCountdown() async { void startCountdown() async {
try{ try{
final response = await _userApi.getAuditMatchmaker();
if (response.data.isSuccess && response.data.data != null) {
bool audit = response.data.data['needAudit'];
if(audit){
Future.delayed(const Duration(milliseconds: 300), () {
if (countdownSeconds.value > 0) {
countdownSeconds.value--;
startCountdown();
}
});
} else {
countdownSeconds.value = 0;
GlobalData().userData!.matchmakerFlag = true;
GlobalData().userData!.matchmakerType = roseList[activePay.value].subCategory;
Get.back(result: 1);
bool audit = false;
if(matchmakerFlag.value){
//
} else {
//
final response = await _userApi.getAuditMatchmaker();
if (response.data.isSuccess && response.data.data != null) {
audit = response.data.data['needAudit'];
} }
} }
if(audit){
Future.delayed(const Duration(milliseconds: 300), () {
if (countdownSeconds.value > 0) {
countdownSeconds.value--;
startCountdown();
}
});
} else {
countdownSeconds.value = 0;
GlobalData().userData!.matchmakerFlag = true;
GlobalData().userData!.matchmakerType = roseList[activePay.value].subCategory;
Get.back(result: 1);
}
} catch (e) { } catch (e) {
print('87$e'); print('87$e');
} }
@ -191,6 +201,7 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
GlobalData().userData!.matchmakerType = roseList[activePay.value].subCategory; GlobalData().userData!.matchmakerType = roseList[activePay.value].subCategory;
Get.back(result: 1); Get.back(result: 1);
} else { } else {
paymentOrderId = data.paymentOrderId!;
fluwx.open(target: MiniProgram( fluwx.open(target: MiniProgram(
username: 'gh_9ea8d46add6f', username: 'gh_9ea8d46add6f',
path: "pages/index/index?amount=${roseList[activePay.value].unitSellingPrice}&paymentOrderId=${data.paymentOrderId}&url=match-fee", path: "pages/index/index?amount=${roseList[activePay.value].unitSellingPrice}&paymentOrderId=${data.paymentOrderId}&url=match-fee",

Loading…
Cancel
Save