import 'request.dart';

const int limit = 5;
//登录接口
Future login(phone, passwrod) async {
  var response = await Http().post('app/uzer/logistics/phone_login', data: {
    "phone": phone,
    "password": passwrod
  });
  return response;
}

//获取接单列表
Future getOrderList(String stationId, String lineId, int page) async {
  var response = await Http().post('app/order/wait_order_list_pages', data: {
    'stationId': stationId,
    'lineId': lineId,
    'limit': limit,
    'page': page
  });
  return response;
}


//获取所有站点
Future getStationList() async {
  var response = await Http().get('app/station/station_list');
  return response;
}

//根据站点获取线路
Future getLineFromStation(String stationId) async {
  var response = await Http().get('app/station/station_line_all_list', data: {
    'stationId': stationId
  });
  return response;
}

//修改密码
Future updataPasswrod(oldPassword, newPassword) async {
  var response = await Http().post('app/uzer/logistics/update_password', data: {
    'oldPassword': oldPassword,
    'newPassword': newPassword
  });
  return response;
}

//发件(创建订单)
Future createOrder(
  int sendCompanyId,//寄件公司Id
  String sendCompanyName,//寄件公司名称 不能为空
  String sendCompanyPhone,//寄件公司电话 不能为空
  String sendCompanyCode,//寄件公司编码 不能为空
  String sendCompanyProvinceName,//寄件公司省名称 不能为空
  String sendCompanyProvinceCode,//寄件公司省编码 不能为空
  String sendCompanyCityName,//寄件公司市名称 不能为空
  String sendCompanyCityCode,//寄件公司市编码 不能为空
  String sendCompanyAreaName,//寄件公司区名称 不能为空
  String sendCompanyAreaCode,//寄件公司区编码 不能为空
  String sendCompanyAddress,//寄件公司详细地址，不能为空
  int receiptCompanyId,//收件公司id
  String receiptCompanyPhone,//收件公司电话 不能为空
  String receiptCompanyName,//收件公司名称 不能为空
  String receiptCompanyProvinceName,//收件公司省名称 不能为空
  String receiptCompanyProvinceCode,//收件公司省编码 不能为空
  String receiptCompanyCityName,//收件公司市名称 不能为空
  String receiptCompanyCityCode,//收件公市编码 不能为空
  String receiptCompanyAreaName,//收件公区名称 不能为空
  String receiptCompanyAreaCode,//收件公司区编码 不能为空
  String receiptCompanyAddress,//收件公司地址详情 不能为空
  String goods,//商品名称不能为空
  int goodsQuantity,//商品数量 不能为空
  int goodsPackingId,//商品包装ID 不能为空
  int goodsCategoryId,//商品包装类别ID 不能为空
  int goodsPaymentMethod,//付款方式
  double goodsWeight,//商品重量 不能为空
  double goodsPriceProtection,//商品保价
  double goodsAgencyFund,//商品代收款
  String memo//备注
) async{
  var response = await Http().post('app/order/logistics_order_create',data:{
    'sendCompanyId':sendCompanyId,
    'sendCompanyName':sendCompanyName,
    'sendCompanyPhone':sendCompanyPhone,
    'sendCompanyCode':sendCompanyCode,
    'sendCompanyProvinceName':sendCompanyProvinceName,
    'sendCompanyProvinceCode':sendCompanyProvinceCode,
    'sendCompanyCityName':sendCompanyCityName,
    'sendCompanyCityCode':sendCompanyCityCode,
    'sendCompanyAreaName':sendCompanyAreaName,
    'sendCompanyAreaCode':sendCompanyAreaCode,
    'sendCompanyAddress':sendCompanyAddress,
    'receiptCompanyId':receiptCompanyId,
    'receiptCompanyPhone':receiptCompanyPhone,
    'receiptCompanyName':receiptCompanyName,
    'receiptCompanyProvinceName':receiptCompanyProvinceName,
    'receiptCompanyProvinceCode':receiptCompanyProvinceCode,
    'receiptCompanyCityName':receiptCompanyCityName,
    'receiptCompanyCityCode':receiptCompanyCityCode,
    'receiptCompanyAreaName':receiptCompanyAreaName,
    'receiptCompanyAreaCode':receiptCompanyAreaCode,
    'receiptCompanyAddress':receiptCompanyAddress,
    'goods':goods,
    'goodsQuantity':goodsQuantity,
    'goodsPackingId':goodsPackingId,
    'goodsCategoryId':goodsCategoryId,
    'goodsPaymentMethod':goodsPaymentMethod,
    'goodsWeight':goodsWeight,
    'goodsPriceProtection':goodsPriceProtection,
    'goodsAgencyFund':goodsAgencyFund,
    'memo':memo
  });
  return response;
}