> For the complete documentation index, see [llms.txt](https://tyson.gitbook.io/vigamedoc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tyson.gitbook.io/vigamedoc/cn/ke-hu-duan-jie-ru/ye-wu-jie-kou/7.-hong-bao-ti-xian.md).

# 7.红包提现

【内部使用】\
回调返回的数据info为json数据，需要解析使用具体的json内容可以参看`VigameDemo`中的`真实领红包`功能。

* 回调函数参数介绍  &#x20;

  &#x20; result: 成功true；失败false  &#x20;

  &#x20; action：请求数据行为（可以不用关心）  &#x20;

  &#x20; info：返回json字符串   &#x20;

## 7.1 登录

该函数适用于第一次登录APP和卸载重装等没有了获取用户信息的userid和apiToken时需要调用该函数获取对应的userid和apiToken并本地缓存，用于其他函数，请不要重复请求该函数，该函数存在入库队列，不得频繁请求。

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashLogin(NetCashInfoCallback callFun)
```

示例：

```csharp
Wb.NetCashManager.Instance.NetCashLogin((result, action, info) =>
{
    string outStr;
    if (result)
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("登录成功", out outStr))
        {
            ShowToast(outStr, false);
        }
    }
    else
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("登录失败", out outStr))
        {
            ShowToast(outStr, true);
        }
    }
    // {"code":200,"data":{"apiToken":"xxxxx","head":"xxxxxx","isNew":"1","nickName":"xxxx","openid":"xxx","redTicket":360,"userType":"wx","userid":"xxx"},"message":"ok"} 
    responseTxt.GetComponent<Text>().text = info;
    userInfo = JsonUtility.FromJson<Root>(info);
});
```

* 参数： &#x20;

  callFun：回调

返回信息：

| 参数内容      | 说明       |
| --------- | -------- |
| redTicket | 剩余红包数值   |
| apiToken  | apiToken |
| isNew     | 是否新用户    |
| userid    | userid   |
| nickName  | 微信昵称     |
| head      | 微信头像     |
| openid    | openid   |

```javascript
{
    "code": 200,
    "data": {
        "apiToken": "7b1b75d54cbe53d849ac9f27798fceef",
        "head": "https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eo44Sc1HOzpsauMT7ibdUCia4pysiaqmcibpFLtQobN5Y3ZC9wX8YxX2FxaWjePe6Ytjhgoeq9WbwOsvg/132",
        "isNew": "0",
        "nickName": "好查了， ，了",
        "openid": "o_p9-s-FlPo-6H0xQx0uDs-mjZ-s",
        "redTicket": 11232,
        "userType": "wx",
        "userid": "1620976236846"
    },
    "message": "ok"
}
```

## 7.2 获取用户信息

该函数适用于在客户端存在userid和apiToken时（userid和apiToken由登录函数获取）使用该参数调用该函数请求获取到用户信息。

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashGetUserInfo(string userId, string apiToken, NetCashInfoCallback callFun)
```

示例：

```csharp
Wb.NetCashManager.Instance.NetCashGetUserInfo(userInfo.data.userid, userInfo.data.apiToken, (result, action, info) =>
{
    string outStr;
    if (result)
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("获取用户信息成功", out outStr))
        {
            ShowToast(outStr, false);
        }
    }
    else
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("获取用户信息失败", out outStr))
        {
            ShowToast(outStr, true);
        }
    }
    responseTxt.GetComponent<Text>().text = info;
});
```

* 参数： &#x20;

  userid：用户id &#x20;

  apiToken：用户token  &#x20;

  callFun：回调 &#x20;

返回信息：

| 参数内容      | 说明       |
| --------- | -------- |
| redTicket | 剩余红包数值   |
| apiToken  | apiToken |
| isNew     | 是否新用户    |
| userid    | userid   |
| nickName  | 微信昵称     |
| head      | 微信头像     |
| openid    | openid   |

```javascript
{
    "code": 200,
    "data": {
        "apiToken": "7b1b75d54cbe53d849ac9f27798fceef",
        "head": "https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eo44Sc1HOzpsauMT7ibdUCia4pysiaqmcibpFLtQobN5Y3ZC9wX8YxX2FxaWjePe6Ytjhgoeq9WbwOsvg/132",
        "isNew": "0",
        "nickName": "好查了， ，了",
        "openid": "o_p9-s-FlPo-6H0xQx0uDs-mjZ-s",
        "redTicket": 11232,
        "userType": "wx",
        "userid": "1620976236846"
    },
    "message": "ok"
}
```

## 7.3 绑定微信

提交微信登录的信息参数，把微信的信息跟用户id进行绑定。用于标记用户已经登陆过。 每个用户id只能绑定一个微信账号，如果openid已经与其他账号绑定，则绑定失败。

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashBindWX(string openId, string accessToken, string nickName, string head, NetCashInfoCallback callFun)
```

示例：

```csharp
Wb.SocialManager.Instance.Login(type, (result) =>
{
    if (result)
    {
        //获取用户信息异步操作
        GetUserInfo(type);
    }
    else
    {
        string outStr1;
        if (LanguageManagers.Instance.languageDic.TryGetValue("登录失败", out outStr1))
        {
            ShowToast(outStr1, true);
        }
    }
});

private void GetUserInfo(int type)
{
  Wb.SocialManager.Instance.GetUserInfo(type, (ret, info) =>
  {
      if (ret)
      {
        Wb.NetCashManager.Instance.NetCashBindWX(info.GetOpenId(), info.GetAccessToken(), info.GetNickName(), info.GetHeadImgUrl(), (result, action, info) =>
         {
            if (result)
            {
                ShowToast("绑定成功", false);
            }
            else
            {
                ShowToast("绑定失败", true);
            }
            responseTxt.GetComponent<Text>().text = info;
         });
      }
      else
      {
        string outStr1;
        if (LanguageManagers.Instance.languageDic.TryGetValue("获取用户信息失败", out outStr1))
        {
            ShowToast(outStr1, true);
        }
      }
  });
}
```

* 参数： &#x20;

  openId：微信openId  &#x20;

  accessToken：微信accessToken  &#x20;

  nickName：微信名   &#x20;

  head：微信头像地址  &#x20;

  callFun：回调  &#x20;

返回信息：

| 参数内容        | 说明                                  |
| ----------- | ----------------------------------- |
| bindSucc    | 绑定状态。  true-成功 false-失败             |
| bindMessage | 绑定提示。eg:“绑定成功”或者“该微信已经绑定过账号1234556” |

```javascript
{
    "code"：200,
    "message":"ok",
    "data":{
        "bindSucc": true,
        "bindMessage": "绑定成功"
    }

}
```

## 7.4 获取提现配置

用户请求该函数获取自身的提现配置

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashEnterWallet(NetCashInfoCallback callFun)
```

示例：

```csharp
  Debug.Log("NetCash 获取提现配置");
  Wb.NetCashManager.Instance.NetCashEnterWallet((result, action, desc) =>
  {
      string outStr;
      if (result)
      {
          if (LanguageManagers.Instance.languageDic.TryGetValue("获取提现配置信息成功", out outStr))
          {
              ShowToast(outStr, false);
          }
      }
      else
      {
          if (LanguageManagers.Instance.languageDic.TryGetValue("获取提现配置信息失败", out outStr))
          {
              ShowToast(outStr, true);
          }
      }
      responseTxt.GetComponent<Text>().text = desc;
  });
```

* 参数：   &#x20;

  callFun：回调

返回信息：

| 参数内容            | 说明     |
| --------------- | ------ |
| redTicket       | 当前红包券  |
| redDesc         | 提现说明   |
| amountList      | 提现列表   |
| withdrawHistory | 用户提现记录 |
| exchange        | 可兑换金额  |

amountList

| 参数内容       | 说明                       |
| ---------- | ------------------------ |
| amount     | 提现金额                     |
| total\_num | 总次数                      |
| day\_num   | 每日提现次数                   |
| type       | 提现类型                     |
| desc       | 备注                       |
| isComplete | 是否完成？false还可以提现true已提现完成 |

```javascript
{
    "code": 200,
    "data": {
        "redTicket": 3883,
        "redDesc": "",
        "withdrawHistory": [
            {
                "date": "2021-06-18 18:49:29",
                "amount": "0.3元",
                "desc": "已发放"
            },
            {
                "date": "2021-06-18 18:50:25",
                "amount": "0.3元",
                "desc": "已发放"
            },
            {
                "date": "2021-06-18 18:57:49",
                "amount": "0.5元",
                "desc": "已发放"
            }
        ],
        "amountList": [
            {
                "amount": "0.3",
                "total_num": 8,
                "day_num": 5,
                "type": 1,
                "desc": "",
                "isComplete": false
            },
            {
                "amount": "0.5",
                "total_num": 1,
                "day_num": 1,
                "type": 2,
                "desc": "",
                "isComplete": false
            },
            {
                "amount": "1.0",
                "total_num": 1,
                "day_num": 1,
                "type": 3,
                "desc": "",
                "isComplete": false
            },
            {
                "amount": "3.0",
                "total_num": 2,
                "day_num": 3,
                "type": 4,
                "desc": "",
                "isComplete": false
            }
        ],
        "exchange": 0.39
    },
    "message": "ok"
}
```

## 7.5 直接领奖

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashQuickAward(int ecpm, string scene, NetCashInfoCallback callFun)
```

示例：

```csharp
Debug.Log("NetCash 直接领奖");
string outStr;
if (LanguageManagers.Instance.languageDic.TryGetValue("直接领奖", out outStr))
{
    HomeManager._homeManager.showInputExDialog(outStr, "ecpm:", "场景参数值:", "10", "common", (inputValue1, inputValue2) =>
   {
       int value;
       bool ret = int.TryParse(inputValue1, out value);
       if (ret && value > 0)
       {
           Wb.NetCashManager.Instance.NetCashQuickAward(value, inputValue2, (result, action, desc) =>
           {
               string outStr1;
               if (result)
               {
                   if (LanguageManagers.Instance.languageDic.TryGetValue("获取成功", out outStr1))
                   {
                       ShowToast(outStr1, false);
                   }
               }
               else
               {
                   if (LanguageManagers.Instance.languageDic.TryGetValue("获取失败", out outStr1))
                   {
                       ShowToast(outStr1, true);
                   }
               }
               responseTxt.GetComponent<Text>().text = desc;
           });
       }
       else
       {
           if (LanguageManagers.Instance.languageDic.TryGetValue("只能为正整数！", out outStr))
           {
               ShowToast(outStr, true);
           }
       }
   });
}
```

* 参数：  &#x20;

  ecpm：ecpm值用来计算红包数值   &#x20;

  scene：场景值：new 新手红包、common 普通红包、piggly 有存钱罐的类型、lottery 转盘类型，红包值\*0.2   &#x20;

  callFun：回调      &#x20;

返回信息：

| 参数内容      | 说明       |
| --------- | -------- |
| awardType | 奖励类型     |
| award     | 本次获得的红包券 |
| redTicket | 当前拥有的红包券 |
| redDesc   | 说明       |

```javascript
{
    "code"：200,
    "message":"ok",
    "data":{
       "awardType": "redTicket",
       "award": "100",
       "redTicket": "1100",
       "redDesc": "还差xx红包券可提现"
    }
}
```

## 7.6 提现

提现分为直接提现和审核提现，小于1元无需审核直接提现，大于等于1元提交审核。

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashWithdraw(int drawType, float amount, NetCashInfoCallback callFun)
```

示例：

```csharp
Wb.NetCashManager.Instance.NetCashWithdraw(drawType ,coin, (result, action, desc) =>
{
    if (result)
    {
        responseTxt.GetComponent<Text>().text = desc;
        string outStr1;
        if (LanguageManagers.Instance.languageDic.TryGetValue("发起提现成功", out outStr1))
        {
            ShowToast(outStr1, false);
        }
    }
    else
    {
        responseTxt.GetComponent<Text>().text = desc;
        string outStr1;
        if (LanguageManagers.Instance.languageDic.TryGetValue("发起提现失败", out outStr1))
        {
            ShowToast(outStr1, true);
        }
    }
});
```

* 参数： &#x20;

  drawType：提现类型   &#x20;

  amount：提现金额   &#x20;

  callFun：回调  &#x20;

返回信息：

| 参数内容            | 说明                       |
| --------------- | ------------------------ |
| withdrawSucc    | 是否已提现，true-已提现 false-未提现 |
| withdrawMessage | 提现信息                     |
| redTicket       | 当前拥有的红包券                 |
| withdrawHistory | 提现记录                     |
| amountList      | 提现列表                     |

```javascript
{
    "code": 200,
    "data": {
        "redTicket": 3883,
        "withdrawHistory": [
            {
                "date": "2021-06-18 18:50:25",
                "amount": "0.3元",
                "desc": "已发放"
            },
            {
                "date": "2021-06-18 18:57:28",
                "amount": "0.3元",
                "desc": "已发放"
            },
            {
                "date": "2021-06-18 18:57:49",
                "amount": "0.5元",
                "desc": "已发放"
            }
        ],
        "withdrawSucc": false,
        "amountList": [
            {
                "amount": "0.3",
                "total_num": 8,
                "day_num": 5,
                "type": 1,
                "desc": "",
                "isComplete": false
            },
            {
                "amount": "0.5",
                "total_num": 1,
                "day_num": 1,
                "type": 2,
                "desc": "",
                "isComplete": false
            },
            {
                "amount": "1.0",
                "total_num": 1,
                "day_num": 1,
                "type": 3,
                "desc": "",
                "isComplete": false
            },
            {
                "amount": "3.0",
                "total_num": 2,
                "day_num": 3,
                "type": 4,
                "desc": "",
                "isComplete": false
            }
        ],
        "withdrawMessage": "提现已申请,请等待审核"
    },
    "message": "ok"
}
```

## 7.7 使用微信登录

该函数适用于第一次微信登录APP，没有userid和apitoken的时候调用。

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashWXLogin(string openid, string accessToken, string nickName, string head, NetCashInfoCallback callFun)
```

示例：

```csharp
Debug.Log("NetCash 使用微信登录");
Wb.SocialManager.Instance.Login(type, (result) =>
{
    if (result)
    {
        //获取用户信息异步操作
        UseWeChatLogin(type);
    }
    else
    {
        string outStr1;
        if (LanguageManagers.Instance.languageDic.TryGetValue("登录失败", out outStr1))
        {
            ShowToast(outStr1, true);
        }
    }
});

private void UseWeChatLogin(int type)
{
    Wb.SocialManager.Instance.GetUserInfo(type, (ret, info) =>
    {
        if (ret)
        {
            Wb.NetCashManager.Instance.NetCashWXLogin(info.GetOpenId(), info.GetAccessToken(), info.GetNickName(), info.GetHeadImgUrl(), (result, action, desc) =>
             {
                if (result)
                {
                    ShowToast("登录成功", false);
                }
                else
                {
                    ShowToast("登录失败", true);
                }
                responseTxt.GetComponent<Text>().text = desc;
             });
        }
        else
        {
            string outStr1;
            if (LanguageManagers.Instance.languageDic.TryGetValue("获取用户信息失败", out outStr1))
            {
                ShowToast(outStr1, true);
            }
        }
    });
}
```

* 参数：   &#x20;

  openId：微信openId  &#x20;

  accessToken：微信accessToken  &#x20;

  nickName：微信名  &#x20;

  head：微信头像地址   &#x20;

  callFun：回调  &#x20;

返回信息：

| 参数内容      | 说明       |
| --------- | -------- |
| redTicket | 剩余红包数值   |
| apiToken  | apiToken |
| isNew     | userid   |
| userid    | 提现记录     |
| nickName  | 微信昵称     |
| head      | 微信头像     |
| openid    | openid   |

```javascript
{
    "code": 200,
    "data": {
        "apiToken": "7b1b75d54cbe53d849ac9f27798fceef",
        "head": "https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eo44Sc1HOzpsauMT7ibdUCia4pysiaqmcibpFLtQobN5Y3ZC9wX8YxX2FxaWjePe6Ytjhgoeq9WbwOsvg/132",
        "isNew": "0",
        "nickName": "好查了， ，了",
        "openid": "o_p9-s-FlPo-6H0xQx0uDs-mjZ-s",
        "redTicket": 11232,
        "userType": "wx",
        "userid": "1620976236846"
    },
    "message": "ok"
}
```

## 7.8 获取存钱罐信息

用户点击查看明日存钱罐中的金额，如果is\_receive字段为true,先弹出今日可领的存钱罐，领取或者不领取后才查看明日存钱罐

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashGetPigglyInfo(NetCashInfoCallback callFun)
```

示例：

```csharp
Debug.Log("NetCash 获取存钱罐信息");
Wb.NetCashManager.Instance.NetCashGetPigglyInfo((result, action, desc) =>
{
    string outStr;
    if (result)
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("获取存钱罐信息成功", out outStr))
        {
            ShowToast(outStr, false);
        }
    }
    else
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("获取存钱罐信息失败", out outStr))
        {
            ShowToast(outStr, true);
        }
    }
    responseTxt.GetComponent<Text>().text = desc;
});
```

* 参数：   &#x20;

  callFun：回调

返回信息：

| 参数内容           | 说明          |
| -------------- | ----------- |
| is\_receive    | 是否弹出今日可领存钱罐 |
| todayPiggly    | 今日可领存钱罐     |
| tomorrowPiggly | 明日可领存钱罐     |

```javascript
{
    "code": 200,
    "data": {
        "is_receive": false,
        "todayPiggly": 0,
        "tomorrowPiggly": 4442
    },
    "message": "ok"
}
```

## 7.9 获取存钱罐奖励

用户点击领取今日可领的存钱罐后获取到对应的存钱罐信息并返回领取的红包值和当前的红包值

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashGetPiggly(NetCashInfoCallback callFun)
```

示例：

```csharp
Debug.Log("NetCash 领取存钱罐奖励");
Wb.NetCashManager.Instance.NetCashGetPiggly((result, action, desc) =>
{
    string outStr;
    if (result)
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("领取存钱罐奖励成功", out outStr))
        {
            ShowToast(outStr, false);
        }
    }
    else
    {
        if (LanguageManagers.Instance.languageDic.TryGetValue("领取存钱罐奖励失败", out outStr))
        {
            ShowToast(outStr, true);
        }
    }
    responseTxt.GetComponent<Text>().text = desc;
});
```

* 参数：  &#x20;

  callFun：回调

返回信息：

| 参数内容          | 说明       |
| ------------- | -------- |
| pigglySucc    | 领取成功true |
| pigglyMessage | 返回信息     |
| award         | 领取的红包值   |
| redTicket     | 当前红包值    |

```javascript
{
    "code": 200,
    "data": {
        "pigglySucc": true,
        "pigglyMessage": "领取成功",
        "award": 4442，
        "redTicket":14442
    },
    "message": "ok"
}
```

## 7.10 上报累计条件次数

客户端判断用户是否完成莫一个可以累计次数的操作，请求服务端记录该类型次数，如果类型为签到：sign，服务端会根据上次签到时间来判断是否累加

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashRecordRequire(string requireType, NetCashInfoCallback callFun)
```

示例：

```csharp
public void onClickRecordRequire()
{
    HomeManager._homeManager.showInputDialogWithPreValue("请填写条件类型", "sign", inputValue =>
    {
        Wb.NetCashManager.Instance.NetCashRecordRequire(inputValue, (result, action, desc) => {
            if (result)
            {
                ShowToast("上报成功", false);
            }
            else
            {
                ShowToast("上报失败", true);
            }
            responseTxt.GetComponent<Text>().text = desc;
        });
    });
}
```

* 参数：   &#x20;

  requireType：条件类型:sign签到、video视频、pass过关、lottery转盘、redpass过关红包   &#x20;

  callFun：回调  &#x20;

返回信息：

| 参数内容 | 说明                     |
| ---- | ---------------------- |
| data | 提现配置：同下发提现配置amountList |

```javascript
{
    "code": 200,
    "data": {
        "conditionList": [
            {
                "amount": "0.30",
                "grade": 1,
                "total_num": 0,
                "isWithdraw": false,
                "day_num": 0,
                "id": 6,
                "type": "condition",
                "isActive": true,
                "mark": "签到一天",
                "desc": "签到1天可领取",
                "requires": [
                    {
                        "txt": "签到一天",
                        "need": 1,
                        "name": "签到",
                        "real": 1,
                        "type": "sign"
                    }
                ]
            },
            {
                "amount": "0.30",
                "grade": 2,
                "total_num": 1,
                "isWithdraw": true,
                "day_num": 1,
                "id": 10,
                "type": "condition",
                "isActive": true,
                "mark": "10个视频",
                "desc": "看10个视频",
                "requires": [
                    {
                        "txt": "看10个视频",
                        "need": 10,
                        "name": "视频",
                        "real": 10,
                        "type": "video"
                    }
                ]
            },
            {
                "amount": "0.30",
                "grade": 3,
                "total_num": 1,
                "isWithdraw": false,
                "day_num": 1,
                "id": 11,
                "type": "condition",
                "isActive": false,
                "mark": "视频20次",
                "desc": "看视频20次解锁开",
                "requires": [
                    {
                        "txt": "视频20次",
                        "need": 20,
                        "name": "视频",
                        "real": 0,
                        "type": "video"
                    }
                ]
            }
        ],
        "sevenList": [
            {
                "amount": "0.30",
                "grade": 1,
                "total_num": 1,
                "isWithdraw": true,
                "day_num": 1,
                "id": 8,
                "type": "seven",
                "isActive": true,
                "mark": "5个视频",
                "desc": "看5个视频即可提现",
                "requires": [
                    {
                        "txt": "看视频5次",
                        "need": 5,
                        "name": "视频",
                        "real": 5,
                        "type": "video"
                    }
                ]
            },
            {
                "amount": "0.50",
                "grade": 2,
                "total_num": 1,
                "isWithdraw": false,
                "day_num": 1,
                "id": 9,
                "type": "seven",
                "isActive": false,
                "mark": "10个视频",
                "desc": "看10个视频",
                "requires": [
                    {
                        "txt": "看视频10次",
                        "need": 10,
                        "name": "视频",
                        "real": 0,
                        "type": "video"
                    }
                ]
            }
        ],
        "lucklyList": [
            {
                "amount": "0.30",
                "grade": 1,
                "total_num": 1,
                "isWithdraw": false,
                "day_num": 1,
                "id": 7,
                "type": "luckly",
                "isActive": true,
                "mark": "过关10关",
                "desc": "过关10关",
                "requires": [
                    {
                        "txt": "过关10次",
                        "need": 10,
                        "name": "过关",
                        "real": 0,
                        "type": "pass"
                    }
                ]
            }
        ]
    },
    "message": "ok"
}
```

## 7.11 下发提现条件金额配置

根据用户当前满足的条件判断下发配置

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashWithDrawConfig(NetCashInfoCallback callFun)
```

示例：

```csharp
public void onClickGetWithDrawConfig()
{
    Wb.NetCashManager.Instance.NetCashWithDrawConfig((result, action, desc) => {
        if (result)
        {
            ShowToast("获取成功", false);
        }
        else
        {
            ShowToast("获取失败", true);
        }
        responseTxt.GetComponent<Text>().text = desc;
    });
}
```

* 参数：   &#x20;

  callFun：回调

返回信息：

| 参数内容            | 说明     |
| --------------- | ------ |
| withDrawConfig  | 提现列表   |
| withdrawHistory | 用户提现记录 |

amountList

| 参数内容          | 说明     |
| ------------- | ------ |
| conditionList | 条件提现列表 |
| sevenList     | 七日提现列表 |
| lucklyList    | 幸运提现列表 |

提现列表基础参数

| 参数内容       | 说明                  |
| ---------- | ------------------- |
| amount     | 提现金额                |
| total\_num | 总次数                 |
| day\_num   | 每日提现次数              |
| type       | 提现类型                |
| desc       | 提现说明                |
| isWithdraw | 是否可以提现？true是 false否 |
| grade      | 提现等级                |
| mark       | 角标                  |
| id         | 提现id                |
| requires   | 提现条件列表              |
| isActive   | 是否激活                |

提现条件列表

| 参数内容 | 说明      |
| ---- | ------- |
| need | 条件需求次数  |
| real | 实际次数    |
| type | 提现条件类型  |
| name | 提现条件中文名 |
| txt  | 提现说明    |

```javascript
{
    "code": 200,
    "data": {
        "withdrawHistory": [],
        "withDrawConfig": {
            "conditionList": [
                {
                    "amount": "0.30",
                    "grade": 1,
                    "total_num": 0,
                    "isWithdraw": false,
                    "day_num": 0,
                    "id": 6,
                    "type": "condition",
                    "isActive": true,
                    "mark": "签到一天",
                    "desc": "签到1天可领取",
                    "requires": [
                        {
                            "txt": "签到一天",
                            "need": 1,
                            "name": "签到",
                            "real": 1,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "0.30",
                    "grade": 2,
                    "total_num": 1,
                    "isWithdraw": true,
                    "day_num": 1,
                    "id": 10,
                    "type": "condition",
                    "isActive": true,
                    "mark": "10个视频",
                    "desc": "看10个视频",
                    "requires": [
                        {
                            "txt": "看10个视频",
                            "need": 10,
                            "name": "视频",
                            "real": 10,
                            "type": "video"
                        }
                    ]
                },
                {
                    "amount": "0.30",
                    "grade": 3,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 11,
                    "type": "condition",
                    "isActive": false,
                    "mark": "视频20次",
                    "desc": "看视频20次解锁开",
                    "requires": [
                        {
                            "txt": "视频20次",
                            "need": 20,
                            "name": "视频",
                            "real": 0,
                            "type": "video"
                        }
                    ]
                }
            ],
            "sevenList": [
                {
                    "amount": "0.30",
                    "grade": 1,
                    "total_num": 1,
                    "isWithdraw": true,
                    "day_num": 1,
                    "id": 8,
                    "type": "seven",
                    "isActive": true,
                    "mark": "5个视频",
                    "desc": "看5个视频即可提现",
                    "requires": [
                        {
                            "txt": "看视频5次",
                            "need": 5,
                            "name": "视频",
                            "real": 5,
                            "type": "video"
                        }
                    ]
                },
                {
                    "amount": "0.50",
                    "grade": 2,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 9,
                    "type": "seven",
                    "isActive": false,
                    "mark": "10个视频",
                    "desc": "看10个视频",
                    "requires": [
                        {
                            "txt": "看视频10次",
                            "need": 10,
                            "name": "视频",
                            "real": 0,
                            "type": "video"
                        }
                    ]
                }
            ],
            "lucklyList": [
                {
                    "amount": "0.30",
                    "grade": 1,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 7,
                    "type": "luckly",
                    "isActive": true,
                    "mark": "过关10关",
                    "desc": "过关10关",
                    "requires": [
                        {
                            "txt": "过关10次",
                            "need": 10,
                            "name": "过关",
                            "real": 0,
                            "type": "pass"
                        }
                    ]
                }
            ]
        }
    },
    "message": "ok"
}
```

## 7.12 条件提现

需要传提现id，用户选择可以提现的请求提现，返回code:510为特殊弹窗标识\
条件提现：必须先提现上一个提现才会解锁下一个\
七日提现：必须先提现上一个提现并且今日未提现过七日提现才会解锁下一个\
幸运提现：每日提现

### Unity

```csharp
Wb.NetCashManager.Instance.NetCashRequireWithDraw(string drawId, string userType, float amount, NetCashInfoCallback callFun)
```

示例：

```csharp
public void onClickRequireWithDraw()
{
    HomeManager._homeManager.showInputExDialog("根据id提现", "提现id:", "提现金额:", "1", "3", (inputValue1, inputValue2) => {
        float coin = 0;
        float.TryParse(inputValue2, out coin);
        Wb.NetCashManager.Instance.NetCashRequireWithDraw(inputValue1, "wx", coin, (result, action, desc) => {
            if (result)
            {
                ShowToast("提现成功", false);
            }
            else
            {
                ShowToast("提现失败", true);
            }
            responseTxt.GetComponent<Text>().text = desc;
        });
    });
}
```

* 参数：\
  drawId：提现id `7.12中获取的配置id`\
  userType: 提现类型 `wx`\
  amount：提现金额\
  callFun：回调

  返回信息：

| 参数内容            | 说明                       |
| --------------- | ------------------------ |
| withdrawSucc    | 是否已提现，true-已提现 false-未提现 |
| withdrawMessage | 提现信息                     |
| withdrawHistory | 提现记录                     |
| withDrawConfig  | 同7.11                    |

```javascript
{
    "code": 200,
    "data": {
        "withdrawHistory": [
            {
                "date": "2021-07-06 16:34:44",
                "amount": "0.30元",
                "desc": "已发放"
            }

        ],
        "withdrawSucc": true,
        "withdrawMessage": "您已发起微信提现，即将到账！",
         "withDrawConfig": {
            "conditionList": [
                {
                    "amount": "0.30",
                    "grade": 1,
                    "total_num": 0,
                    "isWithdraw": false,
                    "day_num": 0,
                    "id": 5,
                    "type": "condition",
                    "isActive": true,
                    "mark": "过10关",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "通过10关即可提现",
                            "need": 10,
                            "name": "过关",
                            "real": 10,
                            "type": "pass"
                        }
                    ]
                },
                {
                    "amount": "0.32",
                    "grade": 2,
                    "total_num": 0,
                    "isWithdraw": false,
                    "day_num": 0,
                    "id": 6,
                    "type": "condition",
                    "isActive": true,
                    "mark": "过12关",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "通过12关即可提现",
                            "need": 12,
                            "name": "过关",
                            "real": 12,
                            "type": "pass"
                        }
                    ]
                },
                {
                    "amount": "0.35",
                    "grade": 3,
                    "total_num": 0,
                    "isWithdraw": false,
                    "day_num": 0,
                    "id": 7,
                    "type": "condition",
                    "isActive": true,
                    "mark": "过15关",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "通过15关即可提现",
                            "need": 15,
                            "name": "过关",
                            "real": 15,
                            "type": "pass"
                        }
                    ]
                },
                {
                    "amount": "0.38",
                    "grade": 4,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 8,
                    "type": "condition",
                    "isActive": true,
                    "mark": "签到1天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "签到1天即可提现",
                            "need": 1,
                            "name": "签到",
                            "real": 1,
                            "type": "sign"
                        },
                        {
                            "txt": "通过10关即可提现",
                            "need": 10,
                            "name": "过关",
                            "real": 0,
                            "type": "pass"
                        }
                    ]
                },
                {
                    "amount": "0.40",
                    "grade": 5,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 9,
                    "type": "condition",
                    "isActive": false,
                    "mark": "5次转盘",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "通过10关即可提现",
                            "need": 10,
                            "name": "过关",
                            "real": 0,
                            "type": "pass"
                        },
                        {
                            "txt": "玩5次转盘即可提现",
                            "need": 5,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                },
                {
                    "amount": "1.00",
                    "grade": 6,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 10,
                    "type": "condition",
                    "isActive": false,
                    "mark": "过30关",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "通过30关即可提现",
                            "need": 30,
                            "name": "过关",
                            "real": 0,
                            "type": "pass"
                        },
                        {
                            "txt": "玩10次转盘即可提现",
                            "need": 10,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                },
                {
                    "amount": "2.00",
                    "grade": 7,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 11,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到10天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到10天即可提现",
                            "need": 10,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "5.00",
                    "grade": 8,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 12,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到20天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到20天即可提现",
                            "need": 20,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "10.00",
                    "grade": 9,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 13,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到30天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到30天即可提现",
                            "need": 30,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "20.00",
                    "grade": 10,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 14,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到50天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到50天即可提现",
                            "need": 50,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "50.00",
                    "grade": 11,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 15,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到60天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到60天即可提现",
                            "need": 60,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "100.00",
                    "grade": 12,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 16,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到70天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到70天即可提现",
                            "need": 70,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "200.00",
                    "grade": 13,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 17,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到90天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到90天即可提现",
                            "need": 90,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "300.00",
                    "grade": 14,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 18,
                    "type": "condition",
                    "isActive": false,
                    "mark": "签到99天",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "连续签到99天即可提现",
                            "need": 99,
                            "name": "签到",
                            "real": 0,
                            "type": "sign"
                        }
                    ]
                }
            ],
            "sevenList": [
                {
                    "amount": "0.30",
                    "grade": 1,
                    "total_num": 1,
                    "isWithdraw": true,
                    "day_num": 1,
                    "id": 19,
                    "type": "seven",
                    "isActive": true,
                    "mark": "",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "签到1天即可提现",
                            "need": 1,
                            "name": "签到",
                            "real": 1,
                            "type": "sign"
                        }
                    ]
                },
                {
                    "amount": "0.30",
                    "grade": 2,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 20,
                    "type": "seven",
                    "isActive": false,
                    "mark": "",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "玩3次转盘即可提现",
                            "need": 3,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                },
                {
                    "amount": "0.30",
                    "grade": 3,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 21,
                    "type": "seven",
                    "isActive": false,
                    "mark": "",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "玩5次转盘即可提现",
                            "need": 5,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                },
                {
                    "amount": "0.50",
                    "grade": 4,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 22,
                    "type": "seven",
                    "isActive": false,
                    "mark": "",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "玩7次转盘即可提现",
                            "need": 7,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                },
                {
                    "amount": "0.50",
                    "grade": 5,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 23,
                    "type": "seven",
                    "isActive": false,
                    "mark": "",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "玩10次转盘即可提现",
                            "need": 10,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                },
                {
                    "amount": "0.50",
                    "grade": 6,
                    "total_num": 1,
                    "isWithdraw": false,
                    "day_num": 1,
                    "id": 24,
                    "type": "seven",
                    "isActive": false,
                    "mark": "",
                    "desc": "",
                    "requires": [
                        {
                            "txt": "玩15次转盘即可提现",
                            "need": 15,
                            "name": "转盘",
                            "real": 0,
                            "type": "lottery"
                        }
                    ]
                }
            ],
            "lucklyList": []
        }
    },
    "message": "ok"
}
```
