|
@@ -13,7 +13,7 @@
|
|
|
placeholder="请输入金额">
|
|
|
<template #button>
|
|
|
<span @click="() => {
|
|
|
- amount = userInfo.profitPrice / 100
|
|
|
+ amount = String(userInfo.profitPrice / 100)
|
|
|
|
|
|
}" class="font26" style="color:#498EF5">全部提现</span>
|
|
|
</template>
|
|
@@ -23,12 +23,13 @@
|
|
|
|
|
|
</van-field>
|
|
|
<div class="button">
|
|
|
- <van-button @click="cashToWx" class="cash-button" color="#01C18D" round icon="wechat" type="primary">
|
|
|
- 提现到微信</van-button>
|
|
|
+
|
|
|
<van-button @click="() => {
|
|
|
cashToCardShow = true
|
|
|
}" class="cash-button" color="#498EF5" round icon="credit-pay" type="primary">提现到银行卡
|
|
|
</van-button>
|
|
|
+ <van-button @click="cashToWx" class="cash-button" color="#01C18D" round icon="wechat" type="primary">
|
|
|
+ 提现到微信</van-button>
|
|
|
</div>
|
|
|
<van-dialog @confirm="cashToCard" v-model:show="cashToCardShow" title="银行卡信息" show-cancel-button>
|
|
|
<van-cell-group inset>
|
|
@@ -84,14 +85,14 @@ import { computed, defineComponent, reactive, ref, onMounted } from 'vue'
|
|
|
import bgImgIcon from '@/assets/img/bgImg.png'
|
|
|
import { useStore } from 'vuex'
|
|
|
import api from '@/api'
|
|
|
-import { Dialog, Toast, PickerOption } from 'vant';
|
|
|
+import { Dialog, Toast } from 'vant';
|
|
|
import WXBANKLIST from '@/assets/js/wxBankList';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
export default defineComponent({
|
|
|
setup() {
|
|
|
const store = useStore()
|
|
|
const route = useRoute()
|
|
|
- const amount = ref(0)
|
|
|
+ const amount = ref<string>('')
|
|
|
const userInfo = computed(() => {
|
|
|
return store.state.userInfo
|
|
|
})
|
|
@@ -121,19 +122,23 @@ export default defineComponent({
|
|
|
|
|
|
})
|
|
|
const cashToCard = () => {
|
|
|
- if (amount.value < 0.3) {
|
|
|
+ if (Number(amount.value) < 0.3) {
|
|
|
Toast.fail('提现金额需要0.3元以上')
|
|
|
|
|
|
return
|
|
|
}
|
|
|
|
|
|
api.wx.studentWxExtractWxwithbankdrawal({
|
|
|
- amount: amount.value * 100,
|
|
|
- bankCode: bankCode.value,
|
|
|
+ amount: Number(amount.value) * 100,
|
|
|
+ bankCode: bankCode.value || 0,
|
|
|
encBankNo: encBankNo.value,
|
|
|
encTrueName: encTrueName.value
|
|
|
|
|
|
}).then(res => {
|
|
|
+ if (res.data.code !== 200) {
|
|
|
+ Toast.fail(res.data.msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
Toast.success('提现成功,到账有延迟')
|
|
|
store.dispatch('getUserInfo');
|
|
|
api.wx.studentWxExtractlist({
|
|
@@ -154,18 +159,20 @@ export default defineComponent({
|
|
|
}
|
|
|
const cashToWx = () => {
|
|
|
Dialog.confirm({
|
|
|
- title: '提现申请',
|
|
|
- message:
|
|
|
- '提现到微信',
|
|
|
+ title: '提现到微信',
|
|
|
})
|
|
|
.then(() => {
|
|
|
- if (amount.value < 1) {
|
|
|
+ if (Number(amount.value) < 1) {
|
|
|
Toast.fail('提现金额需要大于1元')
|
|
|
return
|
|
|
}
|
|
|
api.wx.studentWxExtractWithdraw({
|
|
|
- amount: amount.value * 100
|
|
|
+ amount: Number(amount.value) * 100
|
|
|
}).then(res => {
|
|
|
+ if (res.data.code !== 200) {
|
|
|
+ Toast.fail(res.data.msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
Toast.success('提现成功,到账有延迟')
|
|
|
store.dispatch('getUserInfo');
|
|
|
api.wx.studentWxExtractlist({
|