Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
feat(wallet): #456 提现明细
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jul 27, 2018
1 parent c4962c9 commit 4459180
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
16 changes: 16 additions & 0 deletions src/api/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,19 @@ export function postWalletRecharge(data) {
export function postWalletWithdraw(data) {
return api.post("/plus-pay/cash", data, { validateStatus: s => s === 201 });
}

/**
* 获取提现列表
* @author mutoe <[email protected]>
* @export
* @param {Object} params
* @param {number} params.limit
* @param {number} params.after
* @returns
*/
export function getWithdrawList(params) {
return api.get("/plus-pay/cashes", {
params,
validateStatus: s => s === 200
});
}
7 changes: 2 additions & 5 deletions src/page/wallet/WalletWithdrawDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ export default {
this.$router.push({ path: "/wallet/detail", params: { id } });
},
async onRefresh() {
const data = await this.$store.dispatch("wallet/getWalletOrders", {
action: this.currAction
});
const data = await this.$store.dispatch("wallet/fetchWithdrawList");
if (data.length > 0) this.list = _.unionBy([...data, ...this.list], "id");
this.$refs.loadmore.topEnd(!(data.length < 15));
},
async onLoadMore() {
const data = await this.$store.dispatch("wallet/getWalletOrders", {
action: this.currAction,
const data = await this.$store.dispatch("wallet/fetchWithdrawList", {
after: this.after
});
Expand Down
10 changes: 10 additions & 0 deletions src/stores/module/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ const actions = {
async requestWithdraw(state, payload) {
const { data } = await api.postWalletWithdraw(payload);
return data;
},

/**
* 获取提现列表
* @author mutoe <[email protected]>
* @returns {Promise<Object[]>}
*/
async fetchWithdrawList(state, payload) {
const { data } = await api.getWithdrawList(payload);
return data;
}
};

Expand Down

0 comments on commit 4459180

Please sign in to comment.