This repository has been archived by the owner on Nov 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,21 @@ export function postTransform(data) { | |
validateStatus: s => s === 201 | ||
}); | ||
} | ||
|
||
/** | ||
* 发起提现请求 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {Object} data | ||
* @param {string} data.type 充值方式 | ||
* @param {number} data.amount 充值金额(单位:RMB分) | ||
* @param {number} data.from 来自哪个端 h5固定为2 | ||
* @returns | ||
*/ | ||
export function postWalletRecharge(data) { | ||
return api.post( | ||
"/walletRecharge/orders", | ||
{ ...data, from: 2 }, | ||
{ validateStatus: s => s === 201 } | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,16 @@ const actions = { | |
data: { labels: items, ratio, rule, recharge_type: type } | ||
} = await api.getWalletInfo(); | ||
commit(TYPES.UPDATE_WALLET, { items, type, ratio, rule }); | ||
}, | ||
|
||
/** | ||
* 发起充值请求 | ||
* @author mutoe <[email protected]> | ||
* @returns {Promise<string>} url | ||
*/ | ||
async requestRecharge(state, payload) { | ||
const { data = "" } = await api.postWalletRecharge(payload); | ||
return data; | ||
} | ||
}; | ||
|
||
|