# tradeChoose

选择交易 

## API 调用

### QN.app.invoke({api:'tradeChoose', query})

#### API 调用入参

参数名             | 类型       | 是否可选 | 默认值 | 含义
:-------------- | :------- | :--- | :-- | :-----------------------------------------------------------------------------------------------------------------------
`query`         | `Object` |      |     |
`query.buyerNick`  | `string` |  可选    |  {"domainCode":"cntaobao","nick":"xxx"} | 买家nick，请求为json object
`query.tradeStatus`  | `enum` |  可选    |  WAIT_SELLER_SEND_GOODS | 交易状态，默认查询所有交易状态的数据，除了默认值外每次只能查询一种状态。 可选值： WAIT_BUYER_PAY(等待买家付款) WAIT_SELLER_SEND_GOODS(等待卖家发货,即:买家已付款) WAIT_BUYER_CONFIRM_GOODS(等待买家确认收货,即:卖家已发货) TRADE_FINISHED(交易成功) TRADE_CLOSED(交易关闭) TRADE_REFUND(退款中)
`query.startCreated`  | `string` |  可选    |  2000-01-01 00:00:00 | 查询起始时间
`query.endCreated`  | `string` |  可选    |  2001-01-01 00:00:00 | 查询结束时间
`query.fields`  | `string` |  可选    |  示例值 | 参考TOP交易API fields 定义


#### API 响应结果

参数名      | 类型  | 示例 | 含义
:------- | :-- | :----- | :---
`result` | `*` |        | 请求响应
`query.choose`  | `object []` |  <need>    |  <default> | 用户选择的交易对象
`query.=== tid`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== title`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_name`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_state`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_city`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_district`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_address`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_phone`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_mobile`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== receiver_zip`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.=== orders`  | `object []` |  <need>    |  <default> | 参考TOP的交易对象
`query.====== oid`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.====== num_iid`  | `string` |  <need>    |  <default> | 参考TOP的交易对象
`query.====== num`  | `number` |  <need>    |  <default> | 参考TOP的交易对象


#### 调用示例

```javascript
QN.app.invoke({
      api:'tradeChoose',
      query:{
                buyerNick : '{"domainCode":"cntaobao","nick":"xxx"}'  ,
                    tradeStatus : 'WAIT_SELLER_SEND_GOODS'  ,
                    startCreated : '2000-01-01 00:00:00'  ,
                    endCreated : '2001-01-01 00:00:00'  ,
                    fields : '示例值'  
            
      }
}).then(result => {
    console.log(result);
}, error => {
    console.log(error);
});
    
```
