Commit 3a75e8e1 authored by wykolor's avatar wykolor

feat: 收支明细调节

parent 88b4c613
......@@ -2,7 +2,7 @@
* @Author: wykolor
* @Date: 2021-03-23 11:44:35
* @Last Modified by: mikey.zhaopeng
* @Last Modified time: 2021-04-06 19:01:39
* @Last Modified time: 2021-04-07 17:24:47
*/
export interface PageParams {
......@@ -86,3 +86,12 @@ export interface WithdrawResponse {
withdrawApplyTime: string;
expectedPayTime: string;
}
export interface WithdrawRiskResponse {
withdrawable: boolean;
systemDailyWithdrawLimit: number;
studentDailyWithdrawLimit: number;
studentWithdrawLimit: number;
userDailyWithdrawLimit: number;
userWithdrawLimit: number;
}
......@@ -7,7 +7,8 @@ import {
WithdrawListParams,
WithdrawListResponse,
WithdrawParams,
WithdrawResponse
WithdrawResponse,
WithdrawRiskResponse
} from "@/model/bonus";
import { get, post } from "../../request";
......@@ -43,3 +44,8 @@ export const withdraw = (params: WithdrawParams) => {
export const bindWeiChat = (params: { code: string}) => {
return post("/api-jksxb-app/v1/withdraw/bind/wx/parent", params)
}
// 获取用户风控值
export const getWithdrawRisk = (studentId: string) => {
return get<WithdrawRiskResponse>("/api-jksxb-app/v1/risk/getWithdrawRisk", { studentId })
}
......@@ -15,6 +15,7 @@
v-model:error="error"
:finished="finished"
finished-text="~暂无更多数据~"
:immediate-check="false"
@load="onLoad"
>
<van-tab name="REDUCE" title="支出" class="bonus-detail-pay-list">
......@@ -168,29 +169,9 @@ const BonusDetail = defineComponent({
state.finished = pageAdd.finished;
pageAdd.pageNum++;
}
console.log(bonusList.reduceList, bonusList.addList);
} catch {
state.finished = true;
}
// bonusModel.getBonusList(params).then(res => {
// const { list, total } = res.data;
// if (total === 0) {
// state.finished = true;
// return;
// }
// state.loading = false;
// if (state.active === FlowType.REDUCE) {
// bonusList.reduceList = bonusList.reduceList.concat(list);
// pageReduce.finished = bonusList.reduceList.length === total;
// state.finished = pageReduce.finished;
// pageReduce.pageNum++;
// } else {
// bonusList.addList = bonusList.addList.concat(list);
// pageAdd.finished = bonusList.addList.length === total;
// state.finished = pageAdd.finished;
// pageAdd.pageNum++;
// }
// });
};
const onRefresh = () => {
// 清空列表数据
......@@ -214,6 +195,7 @@ const BonusDetail = defineComponent({
type: "title",
data: "奖励金明细"
});
onLoad();
});
return {
...toRefs(state),
......
......@@ -29,7 +29,7 @@
<p class="bonus-withdraw-input-valid">今日可提现金额¥{{ withdrawableTotal }}元</p>
<p class="bonus-withdraw-input-tip">
<i class="iconfont icon-wenhao"></i>
<span>单日累计提现不超过500元!</span>
<span>单日累计提现不超过{{ studentDailyWithdrawLimit }}元!</span>
</p>
</div>
<van-cell class="van-cell-tip" title="提现至" size="large" :border="false">
......@@ -131,13 +131,13 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const TencentCaptcha: any;
import { computed, defineComponent, onMounted, reactive, ref, toRefs } from "vue";
import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
import { Button, Cell, Dialog, Field, Toast } from "vant";
import { useRoute } from "vue-router";
import { useStore } from "vuex";
import { useNativeBridge } from "@/util/use-native-bridge";
import { countDown } from "../../../util/timer";
import { checkCaptcha, withdraw } from "@/server/api/bonus";
import { checkCaptcha, withdraw, getWithdrawRisk } from "@/server/api/bonus";
import { WithdrawResponse } from "@/model/bonus";
interface TencentCaptchaResponse {
ret: number;
......@@ -174,7 +174,8 @@ const Withdraw = defineComponent({
showWithdrawSuccess: false,
mobileTip: "",
withdrawAccount: "",
withdrawResponse: {}
withdrawResponse: {},
studentDailyWithdrawLimit: 0 // 学生单日提现上限
});
const { withdrawableTotal, withdrawAccount } = route.params;
state.withdrawableTotal = Number(withdrawableTotal);
......@@ -199,6 +200,7 @@ const Withdraw = defineComponent({
state.showWithdraw = true;
};
// 获取验证码
const getSmsVerifyCode = () => {
const captcha1 = new TencentCaptcha(
"2087826974",
......@@ -219,6 +221,7 @@ const Withdraw = defineComponent({
captcha1.show();
};
// 提现
const withdrawReal = async () => {
if (!state.smsVerifyCode) {
Toast("请输入验证码");
......@@ -239,12 +242,21 @@ const Withdraw = defineComponent({
// state.showWithdrawSuccess = true;
};
// 获取风控值
const getWithdrawRiskReq = async () => {
const {
data: { studentDailyWithdrawLimit }
} = await getWithdrawRisk(bonusStoreState.value.studentId);
state.studentDailyWithdrawLimit = studentDailyWithdrawLimit;
};
onMounted(() => {
const message = {
type: "title",
data: "提现"
};
sendNativeMessage(message);
getWithdrawRiskReq();
});
return {
...toRefs(state),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment