api.dart 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import 'request.dart';
  2. const int limit = 5;
  3. //登录接口
  4. Future login(phone, passwrod) async {
  5. var response = await Http().post('app/uzer/logistics/phone_login', data: {
  6. "phone": phone,
  7. "password": passwrod
  8. });
  9. return response;
  10. }
  11. //获取接单列表
  12. Future getOrderList(String stationId, String lineId, int page) async {
  13. var response = await Http().post('app/order/wait_order_list_pages', data: {
  14. 'stationId': stationId,
  15. 'lineId': lineId,
  16. 'limit': limit,
  17. 'page': page
  18. });
  19. return response;
  20. }
  21. //获取所有站点
  22. Future getStationList() async {
  23. var response = await Http().get('app/station/station_list');
  24. return response;
  25. }
  26. //根据站点获取线路
  27. Future getLineFromStation(String stationId) async {
  28. var response = await Http().get('app/station/station_line_all_list', data: {
  29. 'stationId': stationId
  30. });
  31. return response;
  32. }
  33. //修改密码
  34. Future updataPasswrod(oldPassword, newPassword) async {
  35. var response = await Http().post('app/uzer/logistics/update_password', data: {
  36. 'oldPassword': oldPassword,
  37. 'newPassword': newPassword
  38. });
  39. return response;
  40. }
  41. //发件(创建订单)
  42. Future createOrder(
  43. int sendCompanyId,//寄件公司Id
  44. String sendCompanyName,//寄件公司名称 不能为空
  45. String sendCompanyPhone,//寄件公司电话 不能为空
  46. String sendCompanyCode,//寄件公司编码 不能为空
  47. String sendCompanyProvinceName,//寄件公司省名称 不能为空
  48. String sendCompanyProvinceCode,//寄件公司省编码 不能为空
  49. String sendCompanyCityName,//寄件公司市名称 不能为空
  50. String sendCompanyCityCode,//寄件公司市编码 不能为空
  51. String sendCompanyAreaName,//寄件公司区名称 不能为空
  52. String sendCompanyAreaCode,//寄件公司区编码 不能为空
  53. String sendCompanyAddress,//寄件公司详细地址,不能为空
  54. int receiptCompanyId,//收件公司id
  55. String receiptCompanyPhone,//收件公司电话 不能为空
  56. String receiptCompanyName,//收件公司名称 不能为空
  57. String receiptCompanyProvinceName,//收件公司省名称 不能为空
  58. String receiptCompanyProvinceCode,//收件公司省编码 不能为空
  59. String receiptCompanyCityName,//收件公司市名称 不能为空
  60. String receiptCompanyCityCode,//收件公市编码 不能为空
  61. String receiptCompanyAreaName,//收件公区名称 不能为空
  62. String receiptCompanyAreaCode,//收件公司区编码 不能为空
  63. String receiptCompanyAddress,//收件公司地址详情 不能为空
  64. String goods,//商品名称不能为空
  65. int goodsQuantity,//商品数量 不能为空
  66. int goodsPackingId,//商品包装ID 不能为空
  67. int goodsCategoryId,//商品类别ID 不能为空
  68. int goodsPaymentMethod,//付款方式
  69. double goodsWeight,//商品重量 不能为空
  70. double goodsPriceProtection,//商品保价
  71. double goodsAgencyFund,//商品代收款
  72. double goodsFreight,//运费
  73. String memo//备注
  74. ) async{
  75. var response = await Http().post('app/order/logistics_order_create',data:{
  76. 'sendCompanyId':sendCompanyId,
  77. 'sendCompanyName':sendCompanyName,
  78. 'sendCompanyPhone':sendCompanyPhone,
  79. 'sendCompanyCode':sendCompanyCode,
  80. 'sendCompanyProvinceName':sendCompanyProvinceName,
  81. 'sendCompanyProvinceCode':sendCompanyProvinceCode,
  82. 'sendCompanyCityName':sendCompanyCityName,
  83. 'sendCompanyCityCode':sendCompanyCityCode,
  84. 'sendCompanyAreaName':sendCompanyAreaName,
  85. 'sendCompanyAreaCode':sendCompanyAreaCode,
  86. 'sendCompanyAddress':sendCompanyAddress,
  87. 'receiptCompanyId':receiptCompanyId,
  88. 'receiptCompanyPhone':receiptCompanyPhone,
  89. 'receiptCompanyName':receiptCompanyName,
  90. 'receiptCompanyProvinceName':receiptCompanyProvinceName,
  91. 'receiptCompanyProvinceCode':receiptCompanyProvinceCode,
  92. 'receiptCompanyCityName':receiptCompanyCityName,
  93. 'receiptCompanyCityCode':receiptCompanyCityCode,
  94. 'receiptCompanyAreaName':receiptCompanyAreaName,
  95. 'receiptCompanyAreaCode':receiptCompanyAreaCode,
  96. 'receiptCompanyAddress':receiptCompanyAddress,
  97. 'goods':goods,
  98. 'goodsQuantity':goodsQuantity,
  99. 'goodsPackingId':goodsPackingId,
  100. 'goodsCategoryId':goodsCategoryId,
  101. 'goodsPaymentMethod':goodsPaymentMethod,
  102. 'goodsWeight':goodsWeight,
  103. 'goodsPriceProtection':goodsPriceProtection,
  104. 'goodsAgencyFund':goodsAgencyFund,
  105. 'goodsFreight':goodsFreight,
  106. 'memo':memo
  107. });
  108. return response;
  109. }
  110. //模糊匹配手机号
  111. Future likePhone(String phone){
  112. var response =Http().get('app/uzer_company/uzer_company_like',data:{'phone':phone});
  113. return response;
  114. }