| | |
| | | DialogUtil.showDialog(context, LoadingDialog("")); |
| | | } |
| | | |
| | | _dismissDialog(BuildContext context) { |
| | | dismissDialog(BuildContext context) { |
| | | Navigator.pop(context); |
| | | } |
| | | |
| | |
| | | params["device"] = _iosInfo!.identifierForVendor; |
| | | } |
| | | |
| | | if (Global.channel != null) { |
| | | params["channel"] = Global.channel; |
| | | } |
| | | |
| | | params["sign"] = _getSign(params); |
| | | |
| | | return params; |
| | |
| | | httpClient.connectionTimeout = const Duration(seconds: 20); |
| | | var uri = Uri( |
| | | scheme: "http", |
| | | host: "192.168.3.122", |
| | | host: "api.location.izzql.com", |
| | | path: api, |
| | | port: 8082, |
| | | port: 8090, |
| | | queryParameters: params); |
| | | |
| | | // var uri = Uri( |
| | | // scheme: "http", |
| | | // host: "192.168.3.122", |
| | | // path: api, |
| | | // port: 8082, |
| | | // queryParameters: params); |
| | | |
| | | print("uri:$uri"); |
| | | |
| | | if (onStart != null) { |
| | |
| | | await HttpUtil.baseRequest("/api/v1/sms/sendSMS", {"phone": phone}, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | await HttpUtil.baseRequest("/api/v1/user/loginPhone", params, () { |
| | | showLoading(context); |
| | | }, notifyError: true); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | class LocationApiUtil { |
| | | ///上传位置 |
| | | static Future<Map<String, dynamic>?> uploadLocation( |
| | | BaiduLocation location) async { |
| | | SimpleLocation location) async { |
| | | var uid = await UserUtil.getUid(); |
| | | var result = await HttpUtil.baseRequest( |
| | | "/api/v1/location/uploadLocation", |
| | |
| | | "latitude": location.latitude.toString(), |
| | | "longitude": location.longitude.toString(), |
| | | "address": location.address, |
| | | "addressDetail": location.locationDetail, |
| | | "addressDetail": location.addressDetail, |
| | | "uid": uid.toString() |
| | | }, |
| | | () {}); |
| | |
| | | showLoading(context); |
| | | }); |
| | | |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | "/api/v1/location/updateLocationUser", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | "/api/v1/location/deleteLocationUser", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //拒绝定位邀请 |
| | | static Future<Map<String, dynamic>?> searchNearBy( |
| | | String kw, double lat, double lon) async { |
| | | var params = {"kw": kw, "lat": lat.toString(), "lon": lon.toString()}; |
| | | var result = await HttpUtil.baseRequest( |
| | | "/api/v1/location/searchNearBy", params, () {}); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | ///地理位置编码 |
| | | static Future<Map<String, dynamic>?> geoCode(double lat, double lon) async { |
| | | var params = {"lat": lat.toString(), "lon": lon.toString()}; |
| | | var result = |
| | | await HttpUtil.baseRequest("/api/v1/location/geoCode", params, () {}); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | class SOSApiUtil { |
| | |
| | | "/api/v1/sos/addEmergencyContacts", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | "/api/v1/sos/deleteEmergencyContacts", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | "/api/v1/sos/updateEmergencyContacts", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | params["latitude"] = location.latitude.toString(); |
| | | params["longitude"] = location.longitude.toString(); |
| | | params["address"] = location.address.toString(); |
| | | params["addressDetail"] = location.addressDetail.toString(); |
| | | params["addressDetail"] = |
| | | location.addressDetail == null ? "" : location.addressDetail.toString(); |
| | | |
| | | var result = |
| | | await HttpUtil.baseRequest("/api/v1/sos/addSOSRecord", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | await HttpUtil.baseRequest("/api/v1/sos/clearSOSRecord", params, () { |
| | | showLoading(context); |
| | | }); |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |
| | |
| | | showLoading(context); |
| | | }, notifyError: true); |
| | | |
| | | _dismissDialog(context); |
| | | dismissDialog(context); |
| | | if (result.success) { |
| | | return result.data; |
| | | } |