Commit 3a75e8e1 authored by wykolor's avatar wykolor

feat: 收支明细调节

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