Browse Source

郑家动态/投诉接口

remove_uniapp
w-R 3 years ago
parent
commit
885dbf1b8e
  1. 10
      lib/retrofit/retrofit_api.dart
  2. 64
      lib/retrofit/retrofit_api.g.dart
  3. 17
      lib/setting/help_feedback_page.dart

10
lib/retrofit/retrofit_api.dart

@ -380,9 +380,9 @@ abstract class ApiService {
@Path("shipperCode") String shipperCode,
@Path("logisticCode") String logisticCode);
///
@POST("/other/report")
Future<BaseData<dynamic>> report(@Body() Map<String, String> map);
// ///
// @POST("/other/report")
// Future<BaseData<dynamic>> report(@Body() Map<String, String> map);
///
@GET("/order/cancel/{id}")
@ -512,4 +512,8 @@ abstract class ApiService {
@GET("/member/deleteMine")
Future<BaseData> deleteMine();
////
@POST("/information/complaint")
Future<BaseData> complaint(@Body() Map<String, dynamic> param);
}

64
lib/retrofit/retrofit_api.g.dart

@ -1166,27 +1166,27 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<dynamic>> report(map) async {
ArgumentError.checkNotNull(map, 'map');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(map ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/other/report',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as bool,
);
return value;
}
// @override
// Future<BaseData<dynamic>> report(map) async {
// ArgumentError.checkNotNull(map, 'map');
// const _extra = <String, dynamic>{};
// final queryParameters = <String, dynamic>{};
// final _data = <String, dynamic>{};
// _data.addAll(map ?? <String, dynamic>{});
// final _result = await _dio.request<Map<String, dynamic>>('/other/report',
// queryParameters: queryParameters,
// options: RequestOptions(
// method: 'POST',
// headers: <String, dynamic>{},
// extra: _extra,
// baseUrl: baseUrl),
// data: _data);
// final value = BaseData<dynamic>.fromJson(
// _result.data,
// (json) => json as bool,
// );
// return value;
// }
@override
Future<BaseData<dynamic>> orderCancel(id) async {
@ -1915,4 +1915,26 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<dynamic>> complaint(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/information/complaint',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
}

17
lib/setting/help_feedback_page.dart

@ -166,16 +166,23 @@ class _HelpFeedbackPage extends State<HelpFeedbackPage> {
}
report() async {
BaseData baseData = await apiService.report({
"mobile": phoneController.text,
"reportContent": editingController.text,
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.complaint({
"content": phoneController.text,
"informationId":0,
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("反馈成功");
Navigator.of(context).pop();
} else {
SmartDialog.showToast("反馈成功");
Navigator.of(context).pop();
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}

Loading…
Cancel
Save