[TOC]
## 查看合同
* 请求地址: `/user_contract/read`
* 请求方式: get
* 请求参数:
| 字段名 | 字段类型 | 字段长度 | 必填 | 字段说明 |
| --- | --- | --- | --- | --- |
| `id` | int | 11 | `是` | 房源id |
* 成功返回:
```json
{
"code": 0,
"data": {
"entrust": {//原本房源相关信息
"id": 3,
"h_address": "树海",//房源详细地址
"is_settle": 0,//水电气是否结清
"water": "100",//水初始值
"electric": "200",//电初始值
"gas": "90",//气初始值
"s_phone": "13725554033",//监督电话
"facility": {//配套设施相关
"p_r": 1,//产权类型 0 住宅 1 商用
"area": 34,//房源面积
"cost": [//水电气
{
"card": "123456",//卡号
"cost": 0,//费用
"name": "水",//名字
"initial": 100,//初始值
"is_settle": 0//是否结清
},
{
"card": "123456",
"cost": 0,
"name": "电",
"initial": 200,
"is_settle": 0
},
{
"card": "123456",
"cost": 0,
"name": "气",
"initial": 90,
"is_settle": 0
}
],
"empty": 34,//空客天数
"p_r_n": "123456",//产权编号
"deduct": 50000,//抽取金
"facility": [//房间设施
{
"cd": "完好",
"id": 2,
"num": 1,
"name": "洗衣机"
}
],
"net_cost": [//物管费和网费
{
"cost": 0,
"name": "物管费",
"is_settle": 0
},
{
"cost": 10000,
"name": "网费",
"is_settle": 1
}
],
"bank_name": "中国人民银行",//开户行名
"lock_cost": 12000,//智能锁费用
"long_rent": 0,//长租租金
"short_rent": 40000,//短租租金
"manage_type": 1,//委托方式
"delivery_time": "1511798400"//交房时间
},
"other": ""//其他说明
},
"sale": {
"name": "测试账号袁",//经办人姓名
"phone": "13725554033",//经办人手机号
"title": "内光华门店",//经办人门店名
"store_name": "王大锤",//门店负责人姓名
"store_phone": "15181474781"//门店负责人手机号
},
"house": {
"h_l_rent": 100//房源或者房间租金
}
}
}
```
* 失败返回:
```json
{
"code": -1,
"msg": "参数错误!"
}
```
## 完善合同(长租下单)
* 请求地址: `/user_contract/save`
* 请求方式: post
* 请求参数:
| 字段名 | 字段类型 | 字段长度 | 必填 | 字段说明 |
| --- | --- | --- | --- | --- |
| `t_name` | string | 2-16 | `是` | 租户姓名 |
| `t_phone` | string | 11 | `是` | 租户手机号 |
| `t_id_card` | string | 18 | `是` | 租户身份证号码 |
| `h_address` | string | 2-160 | `是` | 房源详细地址 |
| `r_s_time` | date | 0 | `是` | 入住时间 |
| `r_e_time` | date | 0 | `是` | 到期时间 |
| `p_time` | json | 0 | `是` | 付款时间段 |
| `is_pay` | int | 11 | `是` | 是否代付 |
| `is_settle` | int | 11 | `是` | 是否结清 |
| `life` | json | 0 | `是` | 生活数据 水、电、气 |
| `s_phone` | string | 11 | `是` | 监督电话 |
| `facility` | json | 11 | `是` | 房间设施 |
| `h_i_id` | int | 11 | `是` | 房源id |
| `r_id` | int | 11 | 是 | 房间id |
| `mode` | int | 11 | `是` | 租住方式 |
| `h_l_p_m` | int | 11 | `是` | 长租支付方式id |
| `m_name` | string | 2-16 | `是` | 经办人姓名 |
| `m_phone` | string | 11 | `是` | 经办人手机号 |
| `m_s_phone` | sring | 11 | `是` | 经办人门店电话 |
| `m_store` | string | 2-64 | `是` | 经办人门店名 |
| `other` | string | 255 | 否 | 其他说明 |
>[info] 租房方式 0 短租合租 1 短租整租 2 长租合租 3 长租整租
> 是否代缴水电气 0 愿意 1 不愿意
> 水电是否结清 0 已结清 1 未结清
> 房间id选填
* 成功返回:
```json
{
"code":0,
"data":[]
}
```
* 失败返回:
```json
{
"code": -1,
"msg": "参数错误!"
}
```
## 查询完善后的合同
* 请求地址: `/user_contract/getContract`
* 请求方式: get
* 请求参数:
| 字段名 | 字段类型 | 字段长度 | 必填 | 字段说明 |
| --- | --- | --- | --- | --- |
| `id` | int | 11 | `是` | 订单id |
* 成功返回:
```json
{
"code": 0,
"data": {
"data": {
"id": 1,
"t_name": "hhhhh",//租房人姓名
"t_phone": "15982057698",//租房人手机号
"t_id_card": "123456799012345678",//租房人身份证号码
"h_address": "树海",//房源详细地址
"r_s_time": "2017-12-02 00:00:00",//入住时间
"r_e_time": "2018-03-02 00:00:00",//到期时间
"p_time": {//付款时间段
"h_l_rent": 3600,
"r_s_time": "2017-12-02"
},
"rent": 90000,//租金
"deposit": 90000,//押金
"is_pay": 0,//是否代缴水电气
"is_settle": 0,//是否结清
"life": [//水电气初始数据
{
"card": "123456",//卡号
"cost": 0,//费用
"name": "水",//名字
"initial": 100,//初始值
"is_settle": 0//是否结清
},
{
"card": "123456",
"cost": 0,
"name": "电",
"initial": 80,
"is_settle": 0
},
{
"card": "123456",
"cost": 0,
"name": "气",
"initial": 90,
"is_settle": 0
}
],
"s_phone": "13725554033",//监督电话
"facility": [//房间设施
{
"cd": "完好",
"id": 8,
"num": 1,
"name": "电视"
}
],
"m_name": "测试账号袁",//经办人电话
"m_phone": "13725554033",//经办人手机号
"m_s_phone": "15181474781",//经办人店长电话
"m_store": "内光华门店",//经办人门店
"other": "123456799012345678",//其他说明
"sign_mode": 0,//签订方式
"img": null,//线下合同图片
"firm": null,//公司账户信息
"costs": null,//其他费用
"create_time": "2017-12-01 11:28:22"//签订时间
}
}
}
```
* 失败返回:
```json
{
"code": -1,
"msg": "参数错误!"
}
```