From e18be1eb9816ab9ad98ebb4576bb2c14f8fafcf3 Mon Sep 17 00:00:00 2001 From: tangping Date: Thu, 15 Jun 2023 00:58:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E4=BB=98=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/config.js | 4 ++-- src/pages/cash/index.jsx | 30 ++++++++++++++++++++++++++++-- src/pages/cash/index.scss | 12 ++++++++++-- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/config/config.js b/src/config/config.js index 1d17f4e..7567f09 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,6 +1,6 @@ export default { - api: "http://newstart-api.xbase.vip", - debugApi: "http://newstart-api.xbase.vip", + api: "https://api.sequoia-shop.net", + debugApi: "https://api.sequoia-shop.net", home: '', debug: false } \ No newline at end of file diff --git a/src/pages/cash/index.jsx b/src/pages/cash/index.jsx index 7fbd5f3..8f3e530 100644 --- a/src/pages/cash/index.jsx +++ b/src/pages/cash/index.jsx @@ -9,7 +9,7 @@ import { useState } from "react" import Taro from "@tarojs/taro" import backNav from '@/images/backNav.png' import { Picker } from "@nutui/nutui-react-taro" -import { cardList, scoreWithdraw, userDetail } from "../../utils/api" +import { cardList, configs, scoreWithdraw, userDetail } from "../../utils/api" import { useEffect } from "react" import { closeLoading, errorNotice, loading, successNotice } from "../../utils/utils" @@ -26,6 +26,8 @@ const Login = () => { const [user, setUser] = useState({}) const [card, setCard] = useState([]) const [bankList, setBankList] = useState([]) + const [price, setPrice] = useState(0) + const [withdraw, setWithdraw] = useState() useEffect(() => { userDetail().then(rs => { @@ -37,6 +39,11 @@ const Login = () => { setCard(rs.items) setBankList([rs.items.map(item => ({ value: item.id, text: `${item.bank_name} ${item.account_number}` }))]) }) + + configs().then(rs => { + if (!rs) return + setWithdraw(rs.withdraw) + }) }, []) // 返回页面 @@ -68,6 +75,10 @@ const Login = () => { errorNotice("余额不足") return } + if (Number(account) < Number(withdraw?.min_amount)) { + errorNotice("最小提现金额" + withdraw?.min_amount) + return + } loading('提现申请中...') const data = card.filter(it => it.id == bank.value) const re = await scoreWithdraw({ @@ -103,13 +114,22 @@ const Login = () => { { setAccount(v.detail.value) + if (Number(v.detail.value) > 0) { + setPrice(Number(v.detail.value) - Number(v.detail.value) * Number(withdraw?.fee_percent)) + } }} /> { account && } - + + 实到金额 + + + + + 银行卡 @@ -131,6 +151,12 @@ const Login = () => { }} /> + + 用户须知: + 1:提现金额{withdraw?.min_amount}起 + 2:提现会有{withdraw?.fee_percent * 100}%手续费 + 3:提现到账日期统一为每周星期一 + { account && !!bank.value && diff --git a/src/pages/cash/index.scss b/src/pages/cash/index.scss index f2099d6..bf04aaf 100644 --- a/src/pages/cash/index.scss +++ b/src/pages/cash/index.scss @@ -79,10 +79,9 @@ .cash-footer { display: flex; align-items: center; - position: fixed; - bottom: 100px; justify-content: center; width: 315px; + margin-top: 40px; } @@ -125,4 +124,13 @@ font-size: 26px; font-weight: bold; margin-top: 8px; +} + +.cash-helper { + font-size: 12px; + width: 100%; + text-align: left; + line-height: 22px; + color: #919191; + margin-top: 10px; } \ No newline at end of file