import 'request.dart';
import 'models.dart';


Future login(phone,passwrod) async{
  var response =await Http().post('app/uzer/logistics/phone_login',data:{"phone":phone,"password":passwrod});
  var loginResp =Login.fromJson(response);
  return loginResp;
}

Future getOrderList()async{
  //var response = await Http().get("query",data: {"name":"haha"});
    var resp= {
      "items":[
        {
          "id":1,
          "orderNo":1111,
          "createTime":"2019/02/11 14:23",
          "startAddress":"朝阳门大阳汽贸",
          "endAddress":"香河汽修厂",
          "itemName":"汽车轮胎",
          "itemNo":3,
          "sendPhone":"010-8788 6890",
          "sendAddress":"北京市朝阳区朝阳门外大街28号",
          "getPhone":"010-6734 3426",
          "getAddress":"河北省廊坊市香河县东大街29号院18栋"
        },
       {
          "id":2,
          "orderNo":2222,
          "createTime":"2019/02/11 14:23",
          "startAddress":"香河汽修厂",
          "endAddress":"朝阳门大阳汽贸",
          "itemName":"汽车零件",
          "itemNo":99,
          "sendPhone":"010-8788 6890",
          "sendAddress":"河北省廊坊市香河县东大街29号院18栋",
          "getPhone":"010-6734 3426",
          "getAddress":"北京市朝阳区朝阳门外大街28号"
        },
       {
          "id":2,
          "orderNo":2222,
          "createTime":"2019/02/11 14:23",
          "startAddress":"香河汽修厂",
          "endAddress":"朝阳门大阳汽贸",
          "itemName":"汽车零件",
          "itemNo":99,
          "sendPhone":"010-8788 6890",
          "sendAddress":"河北省廊坊市香河县东大街29号院18栋",
          "getPhone":"010-6734 3426",
          "getAddress":"北京市朝阳区朝阳门外大街28号"
        },{
          "id":2,
          "orderNo":2222,
          "createTime":"2019/02/11 14:23",
          "startAddress":"香河汽修厂",
          "endAddress":"朝阳门大阳汽贸",
          "itemName":"汽车零件",
          "itemNo":99,
          "sendPhone":"010-8788 6890",
          "sendAddress":"河北省廊坊市香河县东大街29号院18栋",
          "getPhone":"010-6734 3426",
          "getAddress":"北京市朝阳区朝阳门外大街28号"
        },
        ],
      "hasNextPage":true
      };
    var orderList =OrderListObj.fromJson(resp);
    print("获取了OrderList");
    return orderList;
  }