交付版本
This commit is contained in:
parent
57e9bff831
commit
e18be1eb98
@ -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
|
||||
}
|
@ -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 = () => {
|
||||
<View className="form-control relative">
|
||||
<Input className="form-input" type="digit" placeholder="请输入提现金额" onInput={(v) => {
|
||||
setAccount(v.detail.value)
|
||||
if (Number(v.detail.value) > 0) {
|
||||
setPrice(Number(v.detail.value) - Number(v.detail.value) * Number(withdraw?.fee_percent))
|
||||
}
|
||||
}} />
|
||||
{
|
||||
account && <Image className="w-6 h-6 absolute right-0 bottom-16" src={checked} />
|
||||
}
|
||||
|
||||
</View>
|
||||
</View>
|
||||
<View className="form-item mt-22">
|
||||
<View className="form-label">实到金额</View>
|
||||
<View className="form-control relative">
|
||||
<Input className="form-input" type="digit" placeholder={price} disabled />
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View className="form-item mt-22">
|
||||
<View className="form-label">银行卡</View>
|
||||
<View className="form-control relative">
|
||||
@ -131,6 +151,12 @@ const Login = () => {
|
||||
}} />
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex-col justify-start cash-helper">
|
||||
<Text>用户须知:</Text>
|
||||
<Text>1:提现金额{withdraw?.min_amount}起</Text>
|
||||
<Text>2:提现会有{withdraw?.fee_percent * 100}%手续费</Text>
|
||||
<Text>3:提现到账日期统一为每周星期一</Text>
|
||||
</View>
|
||||
{
|
||||
account && !!bank.value &&
|
||||
<View className="cash-footer ">
|
||||
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user