|
|
@ -17,21 +17,18 @@ class _ApiService implements ApiService { |
|
|
|
String baseUrl; |
|
|
|
String baseUrl; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Future<BaseData<UploadResult>> upload(data, folderId,bool isVideo) async { |
|
|
|
Future<BaseData<UploadResult>> upload(data, folderId, bool isVideo) async { |
|
|
|
ArgumentError.checkNotNull(data, 'data'); |
|
|
|
ArgumentError.checkNotNull(data, 'data'); |
|
|
|
ArgumentError.checkNotNull(folderId, 'folderId'); |
|
|
|
ArgumentError.checkNotNull(folderId, 'folderId'); |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = FormData(); |
|
|
|
final _data = FormData(); |
|
|
|
String fileName = data.path.split(Platform.pathSeparator).last; |
|
|
|
String fileName = data.path.split(Platform.pathSeparator).last; |
|
|
|
if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png")) |
|
|
|
if (!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png")) |
|
|
|
fileName += ".jpeg"; |
|
|
|
fileName += ".jpeg"; |
|
|
|
else if(isVideo && !fileName.contains(".mp4")) |
|
|
|
else if (isVideo && !fileName.contains(".mp4")) fileName += ".mp4"; |
|
|
|
fileName += ".mp4"; |
|
|
|
|
|
|
|
_data.files.add(MapEntry( |
|
|
|
_data.files.add(MapEntry( |
|
|
|
'file', |
|
|
|
'file', MultipartFile.fromFileSync(data.path, filename: fileName))); |
|
|
|
MultipartFile.fromFileSync(data.path, |
|
|
|
|
|
|
|
filename: fileName))); |
|
|
|
|
|
|
|
print("filename:$fileName"); |
|
|
|
print("filename:$fileName"); |
|
|
|
if (folderId != null) { |
|
|
|
if (folderId != null) { |
|
|
|
_data.fields.add(MapEntry('folderId', folderId.toString())); |
|
|
|
_data.fields.add(MapEntry('folderId', folderId.toString())); |
|
|
@ -93,7 +90,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData.fromJson( |
|
|
|
final value = BaseData.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json==null?null:json, |
|
|
|
(json) => json == null ? null : json, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -114,13 +111,13 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<ChannelsList>.fromJson( |
|
|
|
final value = BaseData<ChannelsList>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => ChannelsList.fromJson(json), |
|
|
|
(json) => ChannelsList.fromJson(json), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async { |
|
|
|
Future<BaseData<dynamic>> sendVerify(areaCode, mobile) async { |
|
|
|
ArgumentError.checkNotNull(mobile, 'mobile'); |
|
|
|
ArgumentError.checkNotNull(mobile, 'mobile'); |
|
|
|
ArgumentError.checkNotNull(areaCode, 'areaCode'); |
|
|
|
ArgumentError.checkNotNull(areaCode, 'areaCode'); |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
@ -337,7 +334,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<RechargeActLists>.fromJson( |
|
|
|
final value = BaseData<RechargeActLists>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => RechargeActLists.fromJson(json), |
|
|
|
(json) => RechargeActLists.fromJson(json), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -359,7 +356,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json == null ? null :json as dynamic, |
|
|
|
(json) => json == null ? null : json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -592,9 +589,11 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<List<Store>>.fromJson( |
|
|
|
final value = BaseData<List<Store>>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => ((json??"") == "")?null:(json as List<dynamic>) |
|
|
|
(json) => ((json ?? "") == "") |
|
|
|
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>)) |
|
|
|
? null |
|
|
|
.toList()); |
|
|
|
: (json as List<dynamic>) |
|
|
|
|
|
|
|
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
|
|
|
.toList()); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -885,10 +884,12 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<PageInfo<OrderInfo>>.fromJson( |
|
|
|
final value = BaseData<PageInfo<OrderInfo>>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => ((json??"") == "")?null:PageInfo<OrderInfo>.fromJson( |
|
|
|
(json) => ((json ?? "") == "") |
|
|
|
json, |
|
|
|
? null |
|
|
|
(json) => OrderInfo.fromJson(json), |
|
|
|
: PageInfo<OrderInfo>.fromJson( |
|
|
|
), |
|
|
|
json, |
|
|
|
|
|
|
|
(json) => OrderInfo.fromJson(json), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -1272,7 +1273,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<String>.fromJson( |
|
|
|
final value = BaseData<String>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json==null?null:(json as String), |
|
|
|
(json) => json == null ? null : (json as String), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -1295,7 +1296,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<bool>.fromJson( |
|
|
|
final value = BaseData<bool>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => (json??"")=="" ? null :(json as bool), |
|
|
|
(json) => (json ?? "") == "" ? null : (json as bool), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -1881,7 +1882,8 @@ class _ApiService implements ApiService { |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('coupon/detail/$memberCouponId', |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
|
|
|
'coupon/detail/$memberCouponId', |
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'GET', |
|
|
|
method: 'GET', |
|
|
@ -2018,7 +2020,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<HomeRank>.fromJson( |
|
|
|
final value = BaseData<HomeRank>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => HomeRank.fromJson(json), |
|
|
|
(json) => HomeRank.fromJson(json), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2039,7 +2041,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2051,7 +2053,8 @@ class _ApiService implements ApiService { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/member/updatePayPwd', |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
|
|
|
'/member/updatePayPwd', |
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
@ -2061,7 +2064,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2073,7 +2076,8 @@ class _ApiService implements ApiService { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/member/verifyByUpdatePayPwd', |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
|
|
|
'/member/verifyByUpdatePayPwd', |
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
@ -2083,7 +2087,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2093,8 +2097,7 @@ class _ApiService implements ApiService { |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/index', |
|
|
|
'/vipCard/index', |
|
|
|
|
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'GET', |
|
|
|
method: 'GET', |
|
|
@ -2104,7 +2107,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<VipCardHome>.fromJson( |
|
|
|
final value = BaseData<VipCardHome>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => VipCardHome.fromJson(json), |
|
|
|
(json) => VipCardHome.fromJson(json), |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2114,18 +2117,14 @@ class _ApiService implements ApiService { |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
final _result = await _dio.request<List<int>>('/ipJson.jsp', |
|
|
|
'/ip/', |
|
|
|
|
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions(method: 'GET', extra: _extra, baseUrl: baseUrl,responseType: ResponseType.bytes), |
|
|
|
method: 'GET', |
|
|
|
|
|
|
|
headers: <String, dynamic>{}, |
|
|
|
|
|
|
|
extra: _extra, |
|
|
|
|
|
|
|
baseUrl: baseUrl), |
|
|
|
|
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = IpData.fromJson( |
|
|
|
var ts = gbk.decode(_result.data); |
|
|
|
_result.data, |
|
|
|
final value = IpData.fromJson(jsonDecode(ts |
|
|
|
); |
|
|
|
.substring(ts.indexOf("{\"ip\":\"")) |
|
|
|
|
|
|
|
.replaceAll(");}", ""))); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2136,7 +2135,8 @@ class _ApiService implements ApiService { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/orderVip', |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
|
|
|
'/vipCard/orderVip', |
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
@ -2146,7 +2146,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2156,8 +2156,7 @@ class _ApiService implements ApiService { |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/raise/products', |
|
|
|
'/raise/products', |
|
|
|
|
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'GET', |
|
|
|
method: 'GET', |
|
|
@ -2167,7 +2166,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<List<FarmersList>>.fromJson( |
|
|
|
final value = BaseData<List<FarmersList>>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
.map<FarmersList>( |
|
|
|
.map<FarmersList>( |
|
|
|
(i) => FarmersList.fromJson(i as Map<String, dynamic>)) |
|
|
|
(i) => FarmersList.fromJson(i as Map<String, dynamic>)) |
|
|
|
.toList()); |
|
|
|
.toList()); |
|
|
@ -2181,7 +2180,8 @@ class _ApiService implements ApiService { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/auth/changePhone', |
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
|
|
|
'/auth/changePhone', |
|
|
|
queryParameters: queryParameters, |
|
|
|
queryParameters: queryParameters, |
|
|
|
options: RequestOptions( |
|
|
|
options: RequestOptions( |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
@ -2191,7 +2191,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2213,7 +2213,7 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => json as dynamic, |
|
|
|
); |
|
|
|
); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
@ -2235,9 +2235,8 @@ class _ApiService implements ApiService { |
|
|
|
data: _data); |
|
|
|
data: _data); |
|
|
|
final value = BaseData<List<Store>>.fromJson( |
|
|
|
final value = BaseData<List<Store>>.fromJson( |
|
|
|
_result.data, |
|
|
|
_result.data, |
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
.map<Store>( |
|
|
|
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>)) |
|
|
|
(i) => Store.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
|
|
|
.toList()); |
|
|
|
.toList()); |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|