Commit e8c57a91 authored by wykolor's avatar wykolor

Merge branch 'feature/2021_03_12_bonus' of dev.jiuaoedu.com:wykolor/mall-webview…

Merge branch 'feature/2021_03_12_bonus' of dev.jiuaoedu.com:wykolor/mall-webview into feature/2021_03_12_bonus
parents 57fbbc9e 7a97e6f2
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="format-detection" content="telephone=yes"> <meta name="format-detection" content="telephone=yes">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="//at.alicdn.com/t/font_2425189_lvk0clvlo2.css"> <link rel="stylesheet" href="//at.alicdn.com/t/font_2425189_lvk0clvlo2.css">
<title>我的奖励金</title> <title>我的奖励金</title>
<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script> <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
<% if (String(VUE_APP_DEPLOY_MODE) === 'test') { %> <!-- <% if (String(VUE_APP_DEPLOY_MODE) === 'test') { %>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vConsole/3.4.1/vconsole.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vConsole/3.4.1/vconsole.min.js"></script>
<script>new window.VConsole({});</script> <script>new window.VConsole({});</script>
<% } %> <% } %> -->
<script> <script>
(function flexible (window, document) { (function flexible (window, document) {
var docEl = document.documentElement var docEl = document.documentElement
......
...@@ -5,10 +5,10 @@ import router from "./router"; ...@@ -5,10 +5,10 @@ import router from "./router";
import store from "./store"; import store from "./store";
import "./assets/style/normalize.css"; import "./assets/style/normalize.css";
// if (process.env.VUE_APP_DEPLOY_MODE === "test") { if (process.env.VUE_APP_DEPLOY_MODE === "test") {
// const VConsole = require("vconsole"); const VConsole = require("vconsole");
// new VConsole(); new VConsole();
// } }
createApp(App) createApp(App)
.use(store) .use(store)
......
...@@ -26,7 +26,7 @@ export enum BonusAccountStatus { ...@@ -26,7 +26,7 @@ export enum BonusAccountStatus {
FREEZE = "FREEZE" // 冻结 FREEZE = "FREEZE" // 冻结
} }
// 奖励金预提现错误状态 // 奖励金预提现错误状态
export enum ErrCode { export enum ErrCode {
NOT_BIND = "NOT_BIND", // 未绑定微信 NOT_BIND = "NOT_BIND", // 未绑定微信
USER_FREEZE = "USER_FREEZE", // 用户冻结 USER_FREEZE = "USER_FREEZE", // 用户冻结
...@@ -34,7 +34,7 @@ export enum ErrCode { ...@@ -34,7 +34,7 @@ export enum ErrCode {
USER_UP_LIMIT = "USER_UP_LIMIT", // 用户上限 USER_UP_LIMIT = "USER_UP_LIMIT", // 用户上限
SYSTEM_UP_LIMIT = "SYSTEM_UP_LIMIT", // 系统上限 SYSTEM_UP_LIMIT = "SYSTEM_UP_LIMIT", // 系统上限
STUDENT_WITHDRAWING = "STUDENT_WITHDRAWING", // 学生提现中 STUDENT_WITHDRAWING = "STUDENT_WITHDRAWING", // 学生提现中
BALANCE_NOT_ENOUGH = "BALANCE_NOT_ENOUGH", // 余额不足 BALANCE_NOT_ENOUGH = "BALANCE_NOT_ENOUGH" // 余额不足
} }
// 提现记录状态 // 提现记录状态
...@@ -43,4 +43,4 @@ export enum WithdrawStatus { ...@@ -43,4 +43,4 @@ export enum WithdrawStatus {
WITHDRAWING = "WITHDRAWING", WITHDRAWING = "WITHDRAWING",
RECEIVED = "RECEIVED", RECEIVED = "RECEIVED",
FAILED = "FAILED" FAILED = "FAILED"
} }
\ No newline at end of file
...@@ -17,11 +17,13 @@ export interface BaseResponse<T = object> { ...@@ -17,11 +17,13 @@ export interface BaseResponse<T = object> {
} }
export interface Paging<T = object> { export interface Paging<T = object> {
total: number; list: T[];
pageNum: number; isLoad: boolean;
pageSize: number; loading: boolean;
refreshing: boolean;
hasNextPage: boolean; hasNextPage: boolean;
list: Array<T>; error: null | string;
total: number;
} }
export interface BonusListResponse { export interface BonusListResponse {
...@@ -38,8 +40,8 @@ export interface BonusListResponse { ...@@ -38,8 +40,8 @@ export interface BonusListResponse {
} }
export interface BonusListParams extends PageParams { export interface BonusListParams extends PageParams {
studentId: number; studentId?: number;
flowType: string; flowType?: string;
} }
export interface BonusAccountResponse { export interface BonusAccountResponse {
...@@ -49,6 +51,7 @@ export interface BonusAccountResponse { ...@@ -49,6 +51,7 @@ export interface BonusAccountResponse {
addTotal: number; addTotal: number;
withdrawedTotal: number; withdrawedTotal: number;
withdrawAccount: string; withdrawAccount: string;
withdrawAccountId: string;
withdrawableTotal: number; withdrawableTotal: number;
errCode: string; errCode: string;
} }
......
import { import {
BonusAccountResponse, BonusAccountResponse,
BonusListParams, BonusListParams,
BonusListResponse, BonusListResponse,
CheckCaptchaParams, CheckCaptchaParams,
Paging, Paging,
WithdrawListParams, WithdrawListParams,
WithdrawListResponse, WithdrawListResponse,
WithdrawParams, WithdrawParams,
WithdrawResponse, WithdrawResponse,
WithdrawRiskResponse WithdrawRiskResponse
} from "@/model/bonus"; } from "@/model/bonus";
import { get, post } from "../request";
import { get, post } from "../request";
// 奖励金收支列表
export const getBonusList = (params: BonusListParams) => { // 奖励金收支列表
return get<Paging<BonusListResponse>>( export const getBonusList = async (params: Partial<BonusListParams>) => {
`/api-jksxb-app/v1/marketingAccount/bonus/flow/list`, return await get<Paging<BonusListResponse>>(
params `/api-jksxb-app/v1/marketingAccount/bonus/flow/list`,
); params
}; );
};
// 奖励金账户信息
export const getBonusAccount = (studentId: string) => { // 奖励金账户信息
return get<BonusAccountResponse>(`/api-jksxb-app/v1/marketingAccount/bonus/count`, { studentId }); export const getBonusAccount = (studentId: string) => {
}; return get<BonusAccountResponse>(`/api-jksxb-app/v1/marketingAccount/bonus/count`, { studentId });
};
// 提现记录列表
export const getWithdrawList = (params: WithdrawListParams) => { // 提现记录列表
return get<Paging<WithdrawListResponse>>(`/api-jksxb-app/v1/withdraw/query`, params); export const getWithdrawList = (params: WithdrawListParams) => {
}; return get<Paging<WithdrawListResponse>>(`/api-jksxb-app/v1/withdraw/query`, params);
};
// 检验图形验证码
export const checkCaptcha = (params: CheckCaptchaParams) => { // 检验图形验证码
return post<string>(`/api-jksxb-app/v1/withdraw/checkCaptcha`, params); export const checkCaptcha = (params: CheckCaptchaParams) => {
}; return post<string>(`/api-jksxb-app/v1/withdraw/checkCaptcha`, params);
};
// 提现
export const withdraw = (params: WithdrawParams) => { // 提现
return post<WithdrawResponse>("/api-jksxb-app/v1/withdraw", params); export const withdraw = (params: WithdrawParams) => {
}; return post<WithdrawResponse>("/api-jksxb-app/v1/withdraw", params);
};
// 绑定微信
export const bindWeiChat = (params: { code: string}) => { // 绑定微信
return post("/api-jksxb-app/v1/withdraw/bind/wx/parent", params) 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 }) export const getWithdrawRisk = (studentId: string) => {
} return get<WithdrawRiskResponse>("/api-jksxb-app/v1/risk/getWithdrawRisk", { studentId });
};
\ No newline at end of file
import axios, { AxiosRequestConfig } from "axios"; import axios, { AxiosRequestConfig } from "axios";
import Cookies from 'js-cookie'; import Cookies from "js-cookie";
import { unref } from "vue"; import { unref } from "vue";
import router from "../router"; import router from "../router";
const instance = axios.create({ const instance = axios.create({
headers: { headers: {
'content-type': 'application/json;charset=UTF-8', "content-type": "application/json;charset=UTF-8",
'Authorization': `Bearer ${Cookies.get('token')}` Authorization: `Bearer ${Cookies.get("token")}`
}, },
baseURL: "", baseURL: "",
timeout: 10000, timeout: 10000,
......
...@@ -6,7 +6,9 @@ import axios from "./http"; ...@@ -6,7 +6,9 @@ import axios from "./http";
* @returns * @returns
*/ */
export function get<T>(url: string, params?: object) { export function get<T>(url: string, params?: object) {
return axios.get<T>(url, { params }); return axios
.get<T>(url, { params })
.then(res => res.data);
} }
/** /**
...@@ -16,5 +18,5 @@ export function get<T>(url: string, params?: object) { ...@@ -16,5 +18,5 @@ export function get<T>(url: string, params?: object) {
* @returns * @returns
*/ */
export function post<T>(url: string, data?: object) { export function post<T>(url: string, data?: object) {
return axios.post<T>(url, data); return axios.post<T>(url, data).then(res => res.data);
} }
import { ErrCode } from "@/model/bonus/constant"; import { ErrCode } from "@/model/bonus/constant";
export function formatBonusTipTxt(errCode: string): string { export function formatBonusTipTxt(errCode: string): string {
let tip = ''; let tip = "";
switch (errCode) { switch (errCode) {
case ErrCode.NOT_BIND: case ErrCode.NOT_BIND:
tip = '绑定微信后,才可进行提现!'; tip = "绑定微信后,才可进行提现!";
break; break;
case ErrCode.USER_FREEZE: case ErrCode.USER_FREEZE:
case ErrCode.ACCOUNT_FREEZE: case ErrCode.ACCOUNT_FREEZE:
tip = '当前账号存在风险,无法进行提现操作!如需帮助请联系:400-8777389'; tip = "当前账号存在风险,无法进行提现操作!如需帮助请联系:400-8777389";
break; break;
case ErrCode.USER_UP_LIMIT: case ErrCode.USER_UP_LIMIT:
case ErrCode.SYSTEM_UP_LIMIT: case ErrCode.SYSTEM_UP_LIMIT:
tip = '今日已达到提现次数/提现金额上限,无法进行提现操作,请明日进行提现操作!如需帮助请联系:400-8777389'; tip =
break; "今日已达到提现次数/提现金额上限,无法进行提现操作,请明日进行提现操作!如需帮助请联系:400-8777389";
case ErrCode.STUDENT_WITHDRAWING: break;
tip = '您当前有一笔资金处于提现中,待该笔资金完成提现后,再进行提现操作!如需帮助请联系:400-8777389'; case ErrCode.STUDENT_WITHDRAWING:
break; tip =
case ErrCode.BALANCE_NOT_ENOUGH: "您当前有一笔资金处于提现中,待该笔资金完成提现后,再进行提现操作!如需帮助请联系:400-8777389";
tip = '提现金额至少为:1.00元。今日可提现金额不足,烦请明日再来提现!如需帮助请联系:400-8777389'; break;
break; case ErrCode.BALANCE_NOT_ENOUGH:
default: tip = "提现金额至少为:1.00元。当前可提现金额不足!如需帮助请联系:400-8777389!";
tip = '' break;
} default:
return tip; tip = "";
} }
\ No newline at end of file return tip;
}
/* eslint-disable @typescript-eslint/camelcase */ /* eslint-disable @typescript-eslint/camelcase */
import { App } from "vue"; import { App } from "vue";
import mitt from "./mitt"; import mitt from "./mitt";
const isiOS = () => { const isiOS = () => {
const u = navigator.userAgent; const u = navigator.userAgent;
const iOs = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); const iOs = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
return iOs; return iOs;
}; };
const isAndroid = () => { const isAndroid = () => {
const u = navigator.userAgent; const u = navigator.userAgent;
const android = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; const android = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1;
return android; return android;
}; };
const postMessage = data => { const postMessage = data => {
if (isAndroid()) { if (isAndroid()) {
window.ReactNativeWebView && window.ReactNativeWebView &&
window.ReactNativeWebView.onMessage && window.ReactNativeWebView.onMessage &&
window.ReactNativeWebView.onMessage(JSON.stringify(data)); window.ReactNativeWebView.onMessage(JSON.stringify(data));
} }
window.ReactNativeWebView && window.ReactNativeWebView &&
window.ReactNativeWebView.postMessage && window.ReactNativeWebView.postMessage &&
window.ReactNativeWebView.postMessage(JSON.stringify(data)); window.ReactNativeWebView.postMessage(JSON.stringify(data));
}; };
if (isiOS() || isAndroid()) { if (isiOS() || isAndroid()) {
// const debugLog = console.log // const debugLog = console.log
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
// console.log = function (...args) { // console.log = function (...args) {
// postMessage({ // postMessage({
// type: 'log', // type: 'log',
// data: args // data: args
// }) // })
// debugLog(...args) // debugLog(...args)
// } // }
} }
function install(Vue: App) { function install(Vue: App) {
const GEEK_NATVIE_NAME = "GEEK_NATVIE_NAME"; const GEEK_NATVIE_NAME = "GEEK_NATVIE_NAME";
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const event_bus = mitt(); const event_bus = mitt();
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
window.$geek_excuteJS = function (args) { window.$geek_excuteJS = function(args) {
try { try {
const params = JSON.parse(args); const params = JSON.parse(args);
event_bus.emit(GEEK_NATVIE_NAME, params); event_bus.emit(GEEK_NATVIE_NAME, params);
} catch (error) { } catch (error) {
event_bus.emit(GEEK_NATVIE_NAME, args); event_bus.emit(GEEK_NATVIE_NAME, args);
} }
}; };
Vue.mixin({ Vue.mixin({
methods: { methods: {
listenNativeMessage(arg) { listenNativeMessage(arg) {
const { method, data } = arg; const { method, data } = arg;
if (method) { if (method) {
this[method] && this[method](data); this[method] && this[method](data);
} }
}, },
$nativeTitle(title) { $nativeTitle(title) {
const message = { const message = {
type: "title", type: "title",
data: title data: title
}; };
postMessage(message); postMessage(message);
}, },
$shareImg(base64Img, timeline = false) { $shareImg(base64Img, timeline = false) {
const message = { const message = {
type: timeline ? "shareTimeline" : "share", type: timeline ? "shareTimeline" : "share",
data: { data: {
type: "img", type: "img",
img: base64Img img: base64Img
} }
}; };
postMessage(message); postMessage(message);
}, },
$shareText(txt, timeline = false) { $shareText(txt, timeline = false) {
const message = { const message = {
type: timeline ? "shareTimeline" : "share", type: timeline ? "shareTimeline" : "share",
data: { data: {
type: "text", type: "text",
description: txt description: txt
} }
}; };
postMessage(message); postMessage(message);
}, },
$shareNews({ title, url, description }, timeline = false) { $shareNews({ title, url, description }, timeline = false) {
const message = { const message = {
type: timeline ? "shareTimeline" : "share", type: timeline ? "shareTimeline" : "share",
data: { data: {
type: "news", type: "news",
description, description,
webpageUrl: url, webpageUrl: url,
title title
} }
}; };
postMessage(message); postMessage(message);
}, },
$playVieo(url) { $playVieo(url) {
const message = { const message = {
type: "video", type: "video",
data: { data: {
url url
} }
}; };
postMessage(message); postMessage(message);
}, },
$postMessage(message) { $postMessage(message) {
postMessage(message); postMessage(message);
}, },
$exitWebView(data) { $exitWebView(data) {
this.$postMessage({ this.$postMessage({
type: "exitWebview", type: "exitWebview",
data data
}); });
}, },
$shareReport(params) { $shareReport(params) {
this.$postMessage({ this.$postMessage({
type: "reportShare", type: "reportShare",
params params
}); });
} }
}, },
created() { created() {
event_bus.on(GEEK_NATVIE_NAME, this.listenNativeMessage); event_bus.on(GEEK_NATVIE_NAME, this.listenNativeMessage);
}, },
beforeUnmount() { beforeUnmount() {
event_bus.off(GEEK_NATVIE_NAME, this.listenNativeMessage); event_bus.off(GEEK_NATVIE_NAME, this.listenNativeMessage);
} }
}); });
} }
export default install; export default install;
...@@ -24,12 +24,11 @@ window.$geek_excuteJS = function (args) { ...@@ -24,12 +24,11 @@ window.$geek_excuteJS = function (args) {
const params = JSON.parse(args); const params = JSON.parse(args);
eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, params); eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, params);
} catch (error) { } catch (error) {
eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, args); eventBus.emit<NativeInvokeFuncParams>(GEEK_NATIVE_NAME, args);
} }
}; };
const sendNativeMessage = (data: { type: string; data?: any; __callback__?: string }) => { export const sendNativeMessage = (data: { type: string; data?: any; __callback__?: string }) => {
if (isAndroid()) { if (isAndroid()) {
window.ReactNativeWebView && window.ReactNativeWebView &&
window.ReactNativeWebView.onMessage && window.ReactNativeWebView.onMessage &&
......
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { reactive, UnwrapRef } from "vue"; import { reactive, UnwrapRef, computed, ComputedRef } from "vue";
type PagingFuncRet<T = object> = { type PagingFuncRet<T = object> = {
list: T[] | null; list: T[] | null;
...@@ -26,10 +26,20 @@ export type PagingFunc<T = object, P = any> = ( ...@@ -26,10 +26,20 @@ export type PagingFunc<T = object, P = any> = (
arg: Partial<P> & BasePagingParams arg: Partial<P> & BasePagingParams
) => Promise<PagingFuncRet<T>>; ) => Promise<PagingFuncRet<T>>;
export type UsePagingRet<T, P> = [
UnwrapRef<Paging<T>>,
(arg?: Partial<P>) => void,
(arg?: Partial<P>) => void,
{
isFinished: ComputedRef<boolean>;
finishText: ComputedRef<string>;
}
]
function usePaging<T = object, P = any>( function usePaging<T = object, P = any>(
fn: PagingFunc<T, P>, fn: PagingFunc<T, P>,
paramsFn?: () => Partial<P> paramsFn?: () => Partial<P>
): [UnwrapRef<Paging<T>>, (arg?: Partial<P>) => void, (arg?: Partial<P>) => void] { ): UsePagingRet<T, P> {
const paging = reactive<Paging<T>>({ const paging = reactive<Paging<T>>({
list: [], list: [],
isLoad: false, isLoad: false,
...@@ -87,7 +97,22 @@ function usePaging<T = object, P = any>( ...@@ -87,7 +97,22 @@ function usePaging<T = object, P = any>(
const refresh = request(true); const refresh = request(true);
return [paging, loadMore, refresh]; const finishText = computed(() => {
const { total, isLoad, error } = paging;
if (!isLoad || error) return "";
if (total < 1) return "暂无相关数据";
if (total > 10) {
return "没有更多了";
}
return "";
});
const isFinished = computed(() => {
const { hasNextPage, error } = paging;
return !!error || !hasNextPage;
});
return [paging, loadMore, refresh, { finishText, isFinished }];
} }
export { usePaging }; export { usePaging };
<template>
<div class="tab-add">
<van-pull-refresh :modelValue="paging.refreshing" @refresh="refresh">
<van-list
:modelValue="paging.loading"
:finished="isFinished"
:finished-text="finishText"
@load="loadMore"
>
<div v-for="item in paging.list" :key="item.id" class="add-item">
<div class="flex">
<span>{{ item.bizTypeName }}</span>
</div>
<div class="flex add-item-desc-money">
<span class="gray">{{ item.creationTime }}</span>
<label>+¥{{ item.amountChange }}</label>
</div>
</div>
<van-empty key="2" image="search" v-if="paging.error" :description="paging.error" />
<van-empty v-else-if="paging.isLoad && paging.total < 1" />
<div class="list-footer">
<van-loading v-if="paging.loading" color="#1989fa" />
</div>
</van-list>
</van-pull-refresh>
</div>
</template>
<script lang="ts">
import { defineComponent, computed, onMounted } from "vue";
import { List, PullRefresh, Empty, Loading } from "vant";
import { usePaging } from "@/util/use-paging";
import { getBonusList } from "@/server/api/bonus";
import { FlowType, BizType } from "@/model/bonus/constant";
import { useStore } from "vuex";
export default defineComponent({
components: {
[List.name]: List,
[PullRefresh.name]: PullRefresh,
[Empty.name]: Empty,
[Loading.name]: Loading
},
setup() {
const store = useStore();
const bonusStoreState = computed(() => store.state.bonus);
const [paging, loadMore, refresh, helpers] = usePaging(getBonusList, () => ({
studentId: bonusStoreState.value.studentId,
flowType: "ADD"
}));
onMounted(refresh);
return { ...helpers, paging, loadMore, refresh, FlowType, BizType };
}
});
</script>
<style lang="scss" scoped>
.tab-add {
:deep(.van-pull-refresh) {
min-height: calc(100vh - 80px);
}
}
.list-footer {
display: flex;
justify-content: center;
}
// @supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) {
// .list-footer {
// padding-bottom: constant(safe-area-inset-bottom);
// padding-bottom: env(safe-area-inset-bottom);
// }
// }
.flex {
line-height: 47px;
display: flex;
justify-content: space-between;
}
.gray {
color: #bdc4d1;
font-size: 24px;
}
.add-item {
background: #fff;
margin: 26px 20px;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 10px 20px 0px rgba(221, 221, 221, 0.3);
&-desc-money {
label {
color: #f1551e;
font-size: 28px;
font-weight: 600;
}
}
}
</style>
<template>
<div class="bonus-detail">
<van-tabs
color="#027AFF"
title-active-color="#027AFF"
title-inactive-color="#4C4E4F"
line-width="150"
:sticky="true"
v-model:active="active"
@change="changeTabs"
>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model:loading="loading"
:finished="finished"
finished-text="~暂无更多数据~"
@load="onLoad"
:immediate-check="false"
>
<van-tab name="REDUCE" title="支出" class="bonus-detail-pay-list">
<template v-if="reduceList.length">
<div v-for="item in reduceList" :key="item.id" class="bonus-detail-pay-item">
<ul>
<li style="color: #000">{{ item.bizTypeName }}</li>
<li class="flex gray">
<span>{{ item.creationTime }}</span>
<label
>{{ item.bizType === BizType.WITHDRAW ? "流水号:" : "订单号:"
}}{{ item.relationNo }}</label
>
</li>
</ul>
<ul class="bonus-detail-pay-item-desc">
<li
v-if="item.bizType === BizType.WITHDRAW"
class="bonus-detail-pay-item-desc-money flex"
>
<span>申请时间:{{ item.withdrawApplyTime }}</span>
<label v-if="!item.withdrawPayTime">-¥{{ item.amountChange }}</label>
</li>
<li
v-if="item.bizType === BizType.WITHDRAW && item.withdrawPayTime"
class="bonus-detail-pay-item-desc-money flex"
>
<span>到账时间: {{ item.withdrawPayTime }}</span>
<label>-¥{{ item.amountChange }}</label>
</li>
<li v-if="item.bizType === BizType.ORDER">
<div v-for="(className, index) in item.className" :key="className + index">
{{ className }}
</div>
</li>
<li
v-if="item.bizType === BizType.ORDER"
class="bonus-detail-pay-item-desc-money flex"
>
<span>{{ item.schoolAreaName }}</span
><label v-if="item.bizType === BizType.ORDER">-¥{{ item.amountChange }}</label>
</li>
</ul>
</div>
</template>
<van-empty v-else />
</van-tab>
<van-tab name="ADD" title="收入" class="bonus-detail-income-list">
<template v-if="addList.length">
<div class="bonus-detail-income-item" v-for="item in addList" :key="item.id">
<ul>
<li class="flex ">
<span>{{ item.bizTypeName }}</span>
<label class="gray" v-if="item.bizType === BizType.ORDER_RETURN"
>订单号:{{ item.relationNo }}</label
>
</li>
<li class="flex bonus-detail-pay-item-desc-money">
<span class="gray">{{ item.creationTime }}</span>
<label>+¥{{ item.amountChange }}</label>
</li>
</ul>
</div>
</template>
<van-empty v-else />
</van-tab>
</van-list>
</van-pull-refresh>
</van-tabs>
</div>
</template>
<script lang="ts">
import { BonusListResponse } from "@/model/bonus";
import { FlowType, BizType } from "@/model/bonus/constant";
import { NavBar, Tab, Tabs, Cell, Empty, List, PullRefresh } from "vant";
import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
import { getBonusList } from "@/server/api/bonus";
import { useStore } from "vuex";
import { sendNativeMessage } from "@/util/use-native-bridge";
import { useRoute } from "vue-router";
interface BonusList {
addList: BonusListResponse[];
reduceList: BonusListResponse[];
}
const BonusDetail = defineComponent({
setup() {
const store = useStore();
const route = useRoute();
const bonusStoreState = computed(() => store.state.bonus);
const pageAdd = reactive({
pageSize: 10,
pageNum: 1,
finished: false
});
const pageReduce = reactive({
pageSize: 10,
pageNum: 1,
finished: false
});
const state = reactive({
active: route.query.active || "REDUCE",
loading: false,
finished: false,
refreshing: false,
BizType
});
const bonusList = reactive<BonusList>({
addList: [],
reduceList: []
});
const onLoad = async () => {
state.loading = true;
if (state.refreshing) {
if (state.active === FlowType.ADD) {
pageAdd.pageNum = 1;
bonusList.addList = [];
} else {
pageReduce.pageNum = 1;
bonusList.reduceList = [];
}
state.refreshing = false;
}
const params = {
studentId: route.query.studentId || bonusStoreState.value.studentId,
flowType: state.active === FlowType.ADD ? "ADD" : "REDUCE",
pageSize: state.active === FlowType.ADD ? pageAdd.pageSize : pageReduce.pageSize,
pageNum: state.active === FlowType.ADD ? pageAdd.pageNum : pageReduce.pageNum
};
try {
const { total, list } = await getBonusList(params);
if (!list || 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++;
}
} catch {
state.finished = true;
}
};
const onRefresh = () => {
// 清空列表数据
state.finished = false;
// 重新加载数据
state.loading = true;
onLoad();
};
const changeTabs = name => {
state.finished = name === FlowType.ADD ? pageAdd.finished : pageReduce.finished;
if (name === FlowType.ADD && pageAdd.pageNum === 1) {
state.loading = true;
onLoad();
} else if (name === FlowType.REDUCE && pageReduce.pageNum === 1) {
state.loading = true;
onLoad();
}
};
onMounted(() => {
sendNativeMessage({
type: "title",
data: "奖励金明细"
});
onLoad();
});
return {
...toRefs(state),
...toRefs(bonusList),
onLoad,
onRefresh,
changeTabs
};
},
components: {
[NavBar.name]: NavBar,
[Tab.name]: Tab,
[Tabs.name]: Tabs,
[Cell.name]: Cell,
[Empty.name]: Empty,
[List.name]: List,
[PullRefresh.name]: PullRefresh
}
});
export default BonusDetail;
</script>
<style lang="scss" scoped>
.bonus-detail {
.bonus-detail-pay-list,
.bonus-detail-income-list {
padding: 30px;
.bonus-detail-pay-item,
.bonus-detail-income-item {
background: #fff;
margin-bottom: 26px;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 10px 20px 0px rgba(221, 221, 221, 0.3);
ul {
li {
line-height: 47px;
}
}
.flex {
display: flex;
justify-content: space-between;
}
.gray {
color: #bdc4d1;
font-size: 24px;
}
.bonus-detail-pay-item-desc {
background: #f5faff;
padding: 20px;
color: #606263;
}
.bonus-detail-pay-item-desc-money {
label {
color: #f1551e;
font-size: 28px;
font-weight: 600;
}
}
}
}
}
</style>
<template> <template>
<div class="bonus-detail"> <van-tabs
<van-tabs color="#027AFF"
color="#027AFF" title-active-color="#027AFF"
title-active-color="#027AFF" title-inactive-color="#4C4E4F"
title-inactive-color="#4C4E4F" line-width="150"
line-width="150" :sticky="true"
:sticky="true" v-model:active="currentTab"
v-model:active="active" >
@change="changeTabs" <van-tab name="REDUCE" title="支出">
> <BonusReduceList />
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> </van-tab>
<van-list <van-tab name="ADD" title="收入">
v-model:loading="loading" <BonusAddList />
:finished="finished" </van-tab>
finished-text="~暂无更多数据~" </van-tabs>
@load="onLoad"
:immediate-check="false"
>
<van-tab name="REDUCE" title="支出" class="bonus-detail-pay-list">
<template v-if="reduceList.length">
<div v-for="item in reduceList" :key="item.id" class="bonus-detail-pay-item">
<ul>
<li style="color: #000">{{ item.bizTypeName }}</li>
<li class="flex gray">
<span>{{ item.creationTime }}</span>
<label
>{{ item.bizType === BizType.WITHDRAW ? "流水号:" : "订单号:"
}}{{ item.relationNo }}</label
>
</li>
</ul>
<ul class="bonus-detail-pay-item-desc">
<li
v-if="item.bizType === BizType.WITHDRAW"
class="bonus-detail-pay-item-desc-money flex"
>
<span>申请时间:{{ item.withdrawApplyTime }}</span>
<label v-if="!item.withdrawPayTime">-¥{{ item.amountChange }}</label>
</li>
<li
v-if="item.bizType === BizType.WITHDRAW && item.withdrawPayTime"
class="bonus-detail-pay-item-desc-money flex"
>
<span>到账时间: {{ item.withdrawPayTime }}</span>
<label>-¥{{ item.amountChange }}</label>
</li>
<li v-if="item.bizType === BizType.ORDER">
<span v-for="(className, index) in item.className" :key="className + index">{{
className
}}</span>
</li>
<li
v-if="item.bizType === BizType.ORDER"
class="bonus-detail-pay-item-desc-money flex"
>
<span>{{ item.schoolAreaName }}</span
><label v-if="item.bizType === BizType.ORDER">-¥{{ item.amountChange }}</label>
</li>
</ul>
</div>
</template>
<van-empty v-else />
</van-tab>
<van-tab name="ADD" title="收入" class="bonus-detail-income-list">
<template v-if="addList.length">
<div class="bonus-detail-income-item" v-for="item in addList" :key="item.id">
<ul>
<li class="flex ">
<span>{{ item.bizTypeName }}</span>
<label class="gray" v-if="item.bizType === BizType.ORDER_RETURN"
>订单号:{{ item.relationNo }}</label
>
</li>
<li class="flex bonus-detail-pay-item-desc-money">
<span class="gray">{{ item.creationTime }}</span>
<label>+¥{{ item.amountChange }}</label>
</li>
</ul>
</div>
</template>
<van-empty v-else />
</van-tab>
</van-list>
</van-pull-refresh>
</van-tabs>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { BonusListResponse } from "@/model/bonus"; import { defineComponent, ref } from "vue";
import { FlowType, BizType } from "@/model/bonus/constant"; import { Tab, Tabs, List, PullRefresh } from "vant";
import { NavBar, Tab, Tabs, Cell, Empty, List, PullRefresh } from "vant";
import { computed, defineComponent, onMounted, reactive, toRefs } from "vue";
import { getBonusList } from "@/server/api/bonus";
import { useStore } from "vuex";
import { useNativeBridge } from "@/util/use-native-bridge";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import BonusReduceList from "./reduce.vue";
import BonusAddList from "./add.vue";
interface BonusList { export default defineComponent({
addList: BonusListResponse[];
reduceList: BonusListResponse[];
}
const BonusDetail = defineComponent({
setup() {
const store = useStore();
const route = useRoute();
const bonusStoreState = computed(() => store.state.bonus);
const pageAdd = reactive({
pageSize: 10,
pageNum: 1,
finished: false
});
const pageReduce = reactive({
pageSize: 10,
pageNum: 1,
finished: false
});
const state = reactive({
active: route.query.active || "REDUCE",
loading: false,
finished: false,
refreshing: false,
BizType
});
const bonusList = reactive<BonusList>({
addList: [],
reduceList: []
});
const [sendNativeMessage] = useNativeBridge("test", arg => console.log(arg));
const onLoad = async () => {
state.loading = true;
if (state.refreshing) {
if (state.active === FlowType.ADD) {
pageAdd.pageNum = 1;
bonusList.addList = [];
} else {
pageReduce.pageNum = 1;
bonusList.reduceList = [];
}
state.refreshing = false;
}
const params = {
studentId: route.query.studentId || bonusStoreState.value.studentId,
flowType: state.active === FlowType.ADD ? "ADD" : "REDUCE",
pageSize: state.active === FlowType.ADD ? pageAdd.pageSize : pageReduce.pageSize,
pageNum: state.active === FlowType.ADD ? pageAdd.pageNum : pageReduce.pageNum
};
try {
const {
data: { total, list }
} = await getBonusList(params);
if (!list || 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++;
}
} catch {
state.finished = true;
}
};
const onRefresh = () => {
// 清空列表数据
state.finished = false;
// 重新加载数据
state.loading = true;
onLoad();
};
const changeTabs = name => {
state.finished = name === FlowType.ADD ? pageAdd.finished : pageReduce.finished;
if (name === FlowType.ADD && pageAdd.pageNum === 1) {
state.loading = true;
onLoad();
} else if (name === FlowType.REDUCE && pageReduce.pageNum === 1) {
state.loading = true;
onLoad();
}
};
onMounted(() => {
sendNativeMessage({
type: "title",
data: "奖励金明细"
});
onLoad();
});
return {
...toRefs(state),
...toRefs(bonusList),
onLoad,
onRefresh,
changeTabs
};
},
components: { components: {
[NavBar.name]: NavBar,
[Tab.name]: Tab, [Tab.name]: Tab,
[Tabs.name]: Tabs, [Tabs.name]: Tabs,
[Cell.name]: Cell,
[Empty.name]: Empty,
[List.name]: List, [List.name]: List,
[PullRefresh.name]: PullRefresh [PullRefresh.name]: PullRefresh,
BonusAddList,
BonusReduceList
},
setup() {
const route = useRoute();
const currentTab = ref(route.query.active || "REDUCE");
return { currentTab };
} }
}); });
export default BonusDetail;
</script> </script>
<style lang="scss" scoped>
.bonus-detail {
.bonus-detail-pay-list,
.bonus-detail-income-list {
padding: 30px;
.bonus-detail-pay-item,
.bonus-detail-income-item {
background: #fff;
margin-bottom: 26px;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 10px 20px 0px rgba(221, 221, 221, 0.3);
ul {
li {
line-height: 47px;
}
}
.flex {
display: flex;
justify-content: space-between;
}
.gray {
color: #bdc4d1;
font-size: 24px;
}
.bonus-detail-pay-item-desc {
background: #f5faff;
padding: 20px;
color: #606263;
}
.bonus-detail-pay-item-desc-money {
label {
color: #f1551e;
font-size: 28px;
font-weight: 600;
}
}
}
}
}
</style>
<template>
<div class="tab-add">
<van-pull-refresh :modelValue="paging.refreshing" @refresh="refresh">
<van-list
:modelValue="paging.loading"
:finished="isFinished"
:finished-text="finishText"
@load="loadMore"
>
<div v-for="item in paging.list" :key="item.id" class="reduce-item">
<ul>
<li style="color: #000">{{ item.bizTypeName }}</li>
<li class="flex gray">
<span>{{ item.creationTime }}</span>
<label
>{{ item.bizType === BizType.WITHDRAW ? "流水号:" : "订单号:"
}}{{ item.relationNo }}</label
>
</li>
</ul>
<ul class="reduce-item-desc">
<li v-if="item.bizType === BizType.WITHDRAW" class="reduce-item-desc-money flex">
<span>申请时间:{{ item.withdrawApplyTime }}</span>
<label v-if="!item.withdrawPayTime">-¥{{ item.amountChange }}</label>
</li>
<li
v-if="item.bizType === BizType.WITHDRAW && item.withdrawPayTime"
class="reduce-item-desc-money flex"
>
<span>到账时间:{{ item.withdrawPayTime }}</span>
<label>-¥{{ item.amountChange }}</label>
</li>
<li v-if="item.bizType === BizType.ORDER">
<div v-for="(className, index) in item.className" :key="className + index">
{{ className }}
</div>
</li>
<li v-if="item.bizType === BizType.ORDER" class="reduce-item-desc-money flex">
<span>{{ item.schoolAreaName }}</span
><label v-if="item.bizType === BizType.ORDER">-¥{{ item.amountChange }}</label>
</li>
</ul>
</div>
<van-empty key="1" image="network" v-if="paging.error" :description="paging.error" />
<van-empty v-else-if="paging.isLoad && paging.total < 1" />
<div class="list-footer">
<van-loading v-if="paging.loading" color="#1989fa" />
</div>
</van-list>
</van-pull-refresh>
</div>
</template>
<script lang="ts">
import { defineComponent, computed, onMounted } from "vue";
import { List, PullRefresh, Empty, Loading } from "vant";
import { usePaging } from "@/util/use-paging";
import { getBonusList } from "@/server/api/bonus";
import { FlowType, BizType } from "@/model/bonus/constant";
import { useStore } from "vuex";
export default defineComponent({
components: {
[List.name]: List,
[PullRefresh.name]: PullRefresh,
[Empty.name]: Empty,
[Loading.name]: Loading
},
setup() {
const store = useStore();
const bonusStoreState = computed(() => store.state.bonus);
const [paging, loadMore, refresh, helpers] = usePaging(getBonusList, () => ({
studentId: bonusStoreState.value.studentId,
flowType: "REDUCE"
}));
onMounted(refresh);
return { ...helpers, paging, loadMore, refresh, FlowType, BizType };
}
});
</script>
<style lang="scss" scoped>
.tab-add {
:deep(.van-pull-refresh) {
min-height: calc(100vh - 80px);
}
}
.list-footer {
display: flex;
justify-content: center;
}
// @supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) {
// .list-footer {
// padding-bottom: constant(safe-area-inset-bottom);
// padding-bottom: env(safe-area-inset-bottom);
// }
// }
.flex {
line-height: 47px;
display: flex;
justify-content: space-between;
}
.gray {
color: #bdc4d1;
font-size: 24px;
}
.reduce-item {
background: #fff;
margin: 26px 20px;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 10px 20px 0px rgba(221, 221, 221, 0.3);
li {
line-height: 47px;
}
&-desc {
background: #f5faff;
padding: 20px;
color: #606263;
}
&-desc-money {
label {
color: #f1551e;
font-size: 28px;
font-weight: 600;
}
}
}
</style>
...@@ -259,8 +259,7 @@ const Bonus = defineComponent({ ...@@ -259,8 +259,7 @@ const Bonus = defineComponent({
message: "加载中..." message: "加载中..."
}); });
try { try {
const { data } = await getBonusAccount(bonusStoreState.value.studentId); state.bonusAccount = await getBonusAccount(bonusStoreState.value.studentId);
state.bonusAccount = data;
} finally { } finally {
Toast.clear(); Toast.clear();
} }
...@@ -273,9 +272,7 @@ const Bonus = defineComponent({ ...@@ -273,9 +272,7 @@ const Bonus = defineComponent({
const onLoad = async () => { const onLoad = async () => {
state.loading = true; state.loading = true;
try { try {
const { const { hasNextPage, list, total } = await getWithdrawList(withdrawListParams);
data: { hasNextPage, list, total }
} = await getWithdrawList(withdrawListParams);
if (!list || total === 0) { if (!list || total === 0) {
state.finished = true; state.finished = true;
return; return;
...@@ -304,7 +301,8 @@ const Bonus = defineComponent({ ...@@ -304,7 +301,8 @@ const Bonus = defineComponent({
name: "withdraw", name: "withdraw",
params: { params: {
withdrawableTotal: state.bonusAccount?.withdrawableTotal || 0, withdrawableTotal: state.bonusAccount?.withdrawableTotal || 0,
withdrawAccount: state.bonusAccount?.withdrawAccount || "" withdrawAccount: state.bonusAccount?.withdrawAccount || "",
withdrawAccountId: state.bonusAccount?.withdrawAccountId || ""
} }
}); });
} else if (state.bonusAccount?.errCode === ErrCode.NOT_BIND) { } else if (state.bonusAccount?.errCode === ErrCode.NOT_BIND) {
...@@ -461,10 +459,8 @@ export default Bonus; ...@@ -461,10 +459,8 @@ export default Bonus;
.van-row { .van-row {
padding: 0 20px; padding: 0 20px;
margin-bottom: 24px; margin-bottom: 24px;
color: #141414;
.tip { .tip {
position: relative; position: relative;
color: #141414;
font-weight: 550; font-weight: 550;
font-size: 30px; font-size: 30px;
&::after { &::after {
...@@ -552,7 +548,7 @@ export default Bonus; ...@@ -552,7 +548,7 @@ export default Bonus;
border-top-right-radius: 16px; border-top-right-radius: 16px;
} }
} }
::v-deep .bunus-rule-dialog { :deep .bunus-rule-dialog {
&.van-dialog { &.van-dialog {
top: 50%; top: 50%;
width: 622px; width: 622px;
......
...@@ -133,7 +133,7 @@ import { computed, defineComponent, onMounted, reactive, toRefs } from "vue"; ...@@ -133,7 +133,7 @@ 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 { sendNativeMessage } from "@/util/use-native-bridge";
import { countDown } from "@/util/timer"; import { countDown } from "@/util/timer";
import { checkCaptcha, withdraw, getWithdrawRisk } from "@/server/api/bonus"; import { checkCaptcha, withdraw, getWithdrawRisk } from "@/server/api/bonus";
import { WithdrawResponse } from "@/model/bonus"; import { WithdrawResponse } from "@/model/bonus";
...@@ -148,6 +148,7 @@ interface TencentCaptchaResponse { ...@@ -148,6 +148,7 @@ interface TencentCaptchaResponse {
interface State { interface State {
WithdrawResponse?: WithdrawResponse | object; WithdrawResponse?: WithdrawResponse | object;
timeoutParams?: { timeCounter: number | undefined }; timeoutParams?: { timeCounter: number | undefined };
withdrawAccountId: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: number | string | boolean | any; [key: string]: number | string | boolean | any;
} }
...@@ -160,9 +161,6 @@ const Withdraw = defineComponent({ ...@@ -160,9 +161,6 @@ const Withdraw = defineComponent({
[Dialog.Component.name]: Dialog.Component [Dialog.Component.name]: Dialog.Component
}, },
setup() { setup() {
const [sendNativeMessage] = useNativeBridge("title", function(arg) {
console.log(this, arg);
});
const route = useRoute(); const route = useRoute();
const store = useStore(); const store = useStore();
const bonusStoreState = computed(() => store.state.bonus); const bonusStoreState = computed(() => store.state.bonus);
...@@ -175,15 +173,17 @@ const Withdraw = defineComponent({ ...@@ -175,15 +173,17 @@ const Withdraw = defineComponent({
showWithdrawSuccess: false, showWithdrawSuccess: false,
mobileTip: "", mobileTip: "",
withdrawAccount: "", withdrawAccount: "",
withdrawAccountId: "",
withdrawResponse: {}, withdrawResponse: {},
studentDailyWithdrawLimit: 0, // 学生单日提现上限 studentDailyWithdrawLimit: 0, // 学生单日提现上限
withdrawing: false, withdrawing: false,
tencentCaptchPass: false, // 图形验证码是否通过 tencentCaptchPass: false, // 图形验证码是否通过
smsVerifyPass: false smsVerifyPass: false
}); });
const { withdrawableTotal, withdrawAccount } = route.params; const { withdrawableTotal, withdrawAccount, withdrawAccountId } = route.params;
state.withdrawableTotal = Number(withdrawableTotal); state.withdrawableTotal = Number(withdrawableTotal);
state.withdrawAccount = withdrawAccount as string; state.withdrawAccount = withdrawAccount as string;
state.withdrawAccountId = withdrawAccountId as string;
const formatter = value => { const formatter = value => {
if (value <= 0) return ""; if (value <= 0) return "";
if (value > state.withdrawableTotal) { if (value > state.withdrawableTotal) {
...@@ -216,7 +216,7 @@ const Withdraw = defineComponent({ ...@@ -216,7 +216,7 @@ const Withdraw = defineComponent({
state.tencentCaptchPass = true; state.tencentCaptchPass = true;
state.smsVerifyPass = true; state.smsVerifyPass = true;
try { try {
const { data } = await checkCaptcha({ randStr: randstr, ticket }); const data = await checkCaptcha({ randStr: randstr, ticket });
Toast("发送验证码成功"); Toast("发送验证码成功");
state.mobileTip = data; state.mobileTip = data;
state.timeoutParams = countDown(60, 1000, (time: number) => { state.timeoutParams = countDown(60, 1000, (time: number) => {
...@@ -263,9 +263,10 @@ const Withdraw = defineComponent({ ...@@ -263,9 +263,10 @@ const Withdraw = defineComponent({
const params = { const params = {
studentId: bonusStoreState.value.studentId, studentId: bonusStoreState.value.studentId,
smsVerifyCode: state.smsVerifyCode, smsVerifyCode: state.smsVerifyCode,
withdrawAmount: state.withdrawAmount withdrawAmount: state.withdrawAmount,
withdrawAccountId: state.withdrawAccountId
}; };
const { data } = await withdraw(params); const data = await withdraw(params);
state.withdrawResponse = data; state.withdrawResponse = data;
state.showWithdrawSuccess = true; state.showWithdrawSuccess = true;
state.showWithdraw = false; state.showWithdraw = false;
...@@ -288,9 +289,7 @@ const Withdraw = defineComponent({ ...@@ -288,9 +289,7 @@ const Withdraw = defineComponent({
// 获取风控值 // 获取风控值
const getWithdrawRiskReq = async () => { const getWithdrawRiskReq = async () => {
const { const { studentDailyWithdrawLimit } = await getWithdrawRisk(bonusStoreState.value.studentId);
data: { studentDailyWithdrawLimit }
} = await getWithdrawRisk(bonusStoreState.value.studentId);
state.studentDailyWithdrawLimit = studentDailyWithdrawLimit; state.studentDailyWithdrawLimit = studentDailyWithdrawLimit;
}; };
...@@ -462,8 +461,8 @@ export default Withdraw; ...@@ -462,8 +461,8 @@ export default Withdraw;
border-radius: 51px; border-radius: 51px;
} }
} }
::v-deep .withdraw-dialog, :deep .withdraw-dialog,
::v-deep .withdraw-success-dialog { :deep .withdraw-success-dialog {
overflow: initial; overflow: initial;
.close { .close {
width: 44px; width: 44px;
...@@ -476,7 +475,7 @@ export default Withdraw; ...@@ -476,7 +475,7 @@ export default Withdraw;
top: -78px; top: -78px;
} }
} }
::v-deep .withdraw-dialog { :deep .withdraw-dialog {
padding: 48px; padding: 48px;
color: #fff; color: #fff;
width: 622px; width: 622px;
...@@ -531,7 +530,7 @@ export default Withdraw; ...@@ -531,7 +530,7 @@ export default Withdraw;
} }
} }
::v-deep .withdraw-success-dialog { :deep .withdraw-success-dialog {
padding: 60px 51px 35px; padding: 60px 51px 35px;
background: url("~@/assets/images/bonus/withdraw-success.png") no-repeat; background: url("~@/assets/images/bonus/withdraw-success.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
......
...@@ -19,7 +19,7 @@ module.exports = { ...@@ -19,7 +19,7 @@ module.exports = {
changOrigin: true //允许跨域 changOrigin: true //允许跨域
}, },
"/service": { "/service": {
target: "http://172.10.62.92", target: "http://192.168.32.31",
ws: true, ws: true,
changOrigin: true //允许跨域 changOrigin: true //允许跨域
}, },
......
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