Browse Source

红娘申请

ios
ZHR007 3 months ago
parent
commit
06e1b7d2e5
6 changed files with 48 additions and 4 deletions
  1. 1
      lib/controller/mine/auth_controller.dart
  2. 8
      lib/controller/setting/spread_controller.dart
  3. 2
      lib/model/mine/user_data.dart
  4. 2
      lib/network/api_urls.dart
  5. 5
      lib/network/user_api.dart
  6. 34
      lib/network/user_api.g.dart

1
lib/controller/mine/auth_controller.dart

@ -110,6 +110,7 @@ class AuthController extends GetxController {
// //
if (response.data.isSuccess) { if (response.data.isSuccess) {
GlobalData().userData!.identityCard = idcard.value; GlobalData().userData!.identityCard = idcard.value;
GlobalData().userData!.name = name.value;
SmartDialog.showToast('认证成功'); SmartDialog.showToast('认证成功');
if(type == 1){ if(type == 1){
// ; // ;

8
lib/controller/setting/spread_controller.dart

@ -5,9 +5,6 @@ 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 'package:get_storage/get_storage.dart';
import '../../generated/assets.dart';
class SpreadController extends GetxController with WidgetsBindingObserver { class SpreadController extends GetxController with WidgetsBindingObserver {
@ -182,6 +179,11 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
} else { } else {
matchmakerOrderType = 3; matchmakerOrderType = 3;
} }
} else {
await _userApi.applyMatchmaker({
"phone": GlobalData().userData!.phone,
"name": GlobalData().userData!.name
});
} }
final response = await _userApi.submitMatchmakerOrder({ final response = await _userApi.submitMatchmakerOrder({
"productSpecId": roseList[activePay.value].productSpecId, "productSpecId": roseList[activePay.value].productSpecId,

2
lib/model/mine/user_data.dart

@ -4,7 +4,7 @@ import 'package:dating_touchme_app/model/home/marriage_data.dart';
class UserData { class UserData {
String? id; String? id;
String? nickName; String? nickName;
final String? name;
String? name;
String? profilePhoto; String? profilePhoto;
String? identityCard; String? identityCard;
int? genderCode; int? genderCode;

2
lib/network/api_urls.dart

@ -108,4 +108,6 @@ class ApiUrls {
static const String submitMatchmakerOrder = 'dating-agency-mall/user/submit/matchmaker-order'; static const String submitMatchmakerOrder = 'dating-agency-mall/user/submit/matchmaker-order';
static const String kickingRtcChannelUser = static const String kickingRtcChannelUser =
'dating-agency-chat-audio/user/kicking/rtc-channel-user'; 'dating-agency-chat-audio/user/kicking/rtc-channel-user';
static const String applyMatchmaker =
'dating-agency-uec/user/apply/matchmaker';
} }

5
lib/network/user_api.dart

@ -218,4 +218,9 @@ abstract class UserApi {
@Query('pageSize') required int pageSize, @Query('pageSize') required int pageSize,
} }
); );
@POST(ApiUrls.applyMatchmaker)
Future<HttpResponse<BaseResponse<dynamic>>> applyMatchmaker(
@Body() Map<String, dynamic> data,
);
} }

34
lib/network/user_api.g.dart

@ -1340,6 +1340,40 @@ class _UserApi implements UserApi {
return httpResponse; return httpResponse;
} }
@override
Future<HttpResponse<BaseResponse<dynamic>>> applyMatchmaker(
Map<String, dynamic> data,
) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(data);
final _options = _setStreamType<HttpResponse<BaseResponse<dynamic>>>(
Options(method: 'POST', headers: _headers, extra: _extra)
.compose(
_dio.options,
'dating-agency-uec/user/apply/matchmaker',
queryParameters: queryParameters,
data: _data,
)
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
);
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late BaseResponse<dynamic> _value;
try {
_value = BaseResponse<dynamic>.fromJson(
_result.data!,
(json) => json as dynamic,
);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
final httpResponse = HttpResponse(_value, _result);
return httpResponse;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) { RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic && if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes || !(requestOptions.responseType == ResponseType.bytes ||

Loading…
Cancel
Save