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("shipperCode") String shipperCode,
@Path("logisticCode") String logisticCode); @Path("logisticCode") String logisticCode);
/// // ///
@POST("/other/report") // @POST("/other/report")
Future<BaseData<dynamic>> report(@Body() Map<String, String> map); // Future<BaseData<dynamic>> report(@Body() Map<String, String> map);
/// ///
@GET("/order/cancel/{id}") @GET("/order/cancel/{id}")
@ -512,4 +512,8 @@ abstract class ApiService {
@GET("/member/deleteMine") @GET("/member/deleteMine")
Future<BaseData> 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; return value;
} }
@override // @override
Future<BaseData<dynamic>> report(map) async { // Future<BaseData<dynamic>> report(map) async {
ArgumentError.checkNotNull(map, 'map'); // ArgumentError.checkNotNull(map, 'map');
const _extra = <String, dynamic>{}; // const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; // final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; // final _data = <String, dynamic>{};
_data.addAll(map ?? <String, dynamic>{}); // _data.addAll(map ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/other/report', // final _result = await _dio.request<Map<String, dynamic>>('/other/report',
queryParameters: queryParameters, // queryParameters: queryParameters,
options: RequestOptions( // options: RequestOptions(
method: 'POST', // method: 'POST',
headers: <String, dynamic>{}, // headers: <String, dynamic>{},
extra: _extra, // extra: _extra,
baseUrl: baseUrl), // baseUrl: baseUrl),
data: _data); // data: _data);
final value = BaseData<dynamic>.fromJson( // final value = BaseData<dynamic>.fromJson(
_result.data, // _result.data,
(json) => json as bool, // (json) => json as bool,
); // );
return value; // return value;
} // }
@override @override
Future<BaseData<dynamic>> orderCancel(id) async { Future<BaseData<dynamic>> orderCancel(id) async {
@ -1915,4 +1915,26 @@ class _ApiService implements ApiService {
return value; 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 { report() async {
BaseData baseData = await apiService.report({ if (apiService == null) {
"mobile": phoneController.text, SharedPreferences value = await SharedPreferences.getInstance();
"reportContent": editingController.text, apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.complaint({
"content": phoneController.text,
"informationId":0,
}).catchError((onError) {}); }).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("反馈成功"); SmartDialog.showToast("反馈成功");
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
SmartDialog.showToast("反馈成功"); SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
Navigator.of(context).pop();
} }
} }

Loading…
Cancel
Save