main
fanfan 7 months ago
parent 4926abaeed
commit ad957b2868
  1. 67
      pages/dealer/withdraw/apply.vue
  2. 2
      pages/news/user/withdrawal.vue

@ -20,7 +20,8 @@
<view class="capital__item dis-flex flex-y-center">
<view class="item__left">{{ words.money.value }}</view>
<view class="item__right flex-box">
<input class="input" name="money" :placeholder="words.money_placeholder.value" />
<input class="input" type="digit" name="money" @input="wordsAmount"
:placeholder="words.money_placeholder.value" />
</view>
</view>
</view>
@ -37,7 +38,8 @@
<block v-if="item == PayTypeEnum.WECHAT.value">
<!-- 微信支付 -->
<view class="form__field dis-flex flex-y-center">
<view class="form__radio dis-flex flex-y-center" @click="handleChecked(PayTypeEnum.WECHAT.value)">
<view class="form__radio dis-flex flex-y-center"
@click="handleChecked(PayTypeEnum.WECHAT.value)">
<text class="radio__icon iconfont icon-radio"
:class="[payment == PayTypeEnum.WECHAT.value ? 'c-violet' : 'col-bb']"></text>
<text class="f-28">{{ PayTypeEnum.WECHAT.name }}</text>
@ -47,7 +49,8 @@
<block v-if="item == PayTypeEnum.ALIPAY.value">
<!-- 支付宝 -->
<view class="form__field dis-flex flex-y-center">
<view class="form__radio dis-flex flex-y-center" @click="handleChecked(PayTypeEnum.ALIPAY.value)">
<view class="form__radio dis-flex flex-y-center"
@click="handleChecked(PayTypeEnum.ALIPAY.value)">
<text class="radio__icon iconfont icon-radio"
:class="[payment == PayTypeEnum.ALIPAY.value ? 'c-violet' : 'col-bb']"></text>
<text class="f-28">{{ PayTypeEnum.ALIPAY.name }}</text>
@ -69,7 +72,8 @@
<block v-if="item == PayTypeEnum.BANK_CARD.value">
<!-- 银行卡 -->
<view class="form__field dis-flex flex-y-center">
<view class="form__radio dis-flex flex-y-center" @click="handleChecked(PayTypeEnum.BANK_CARD.value)">
<view class="form__radio dis-flex flex-y-center"
@click="handleChecked(PayTypeEnum.BANK_CARD.value)">
<text class="radio__icon iconfont icon-radio"
:class="[payment == PayTypeEnum.BANK_CARD.value ? 'c-violet' : 'col-bb']"></text>
<text class="f-28">{{ PayTypeEnum.BANK_CARD.name }}</text>
@ -109,7 +113,9 @@
import * as DealerApi from '@/api/dealer'
import * as WithdrawApi from '@/api/dealer/withdraw'
import SettingModel from '@/common/model/dealer/Setting'
import { PayTypeEnum } from '@/common/enum/dealer/withdraw'
import {
PayTypeEnum
} from '@/common/enum/dealer/withdraw'
export default {
data() {
@ -142,7 +148,44 @@
},
methods: {
wordsAmount(e) {
console.log(this.words.money)
let amount = e.detail.value
let num = null
num = amount.replace(new RegExp('^(\\d+\\.\\d{2}).+'), '$1')
const startPoint = /^\./g
if (startPoint.test(num)) {
num = amount.replace(startPoint, '0.')
}
if (num && !num.includes('.') && num !== '0') {
num = +num
}
const morePoint = /\.+(\d*|\.+)\./g
if (morePoint.test(num)) {
num = amount
.replace(/\.{2,}/g, ".")
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", ".")
}
if (num > Number(this.settlement.min_money)) { // value100, 100100
uni.showToast({
title: this.settlement.min_money > 0 ? `最多可用${Number(this.settlement.min_money)}元, 请重新输入` : '暂无可提现金额',
icon: 'none',
duration: 2000
})
// this.words.money = this.settlement.min_money > 0 ? this.settlement.min_money : ''
this.$forceUpdate();
} else {
if (!num) { // value,amount0,
this.words.money = ''
this.$forceUpdate();
} else {
// this.words.money = num
this.$forceUpdate();
}
}
},
//
getSetting() {
const app = this
@ -169,7 +212,9 @@
//
setPageTitle(title) {
uni.setNavigationBarTitle({ title: title.value })
uni.setNavigationBarTitle({
title: title.value
})
},
//
@ -178,7 +223,9 @@
},
//
handleSubmit({ detail }) {
handleSubmit({
detail
}) {
const app = this
//
if (!app.onValidation(detail.value)) {
@ -204,7 +251,9 @@
const app = this
app.disabled = true
data.pay_type = app.payment
WithdrawApi.submit({ form: data })
WithdrawApi.submit({
form: data
})
.then(result => {
app.$toast(result.message)
setTimeout(() => uni.navigateBack(), 1200)

@ -306,7 +306,6 @@
.replace(/\./g, "")
.replace("$#$", ".")
}
console.log(num)
if (num > Number(this.balance)) { // value100, 100100
uni.showToast({
title: this.balance > 0 ? `最多可用${Number(this.balance)}元, 请重新输入` : '暂无可提现金额',
@ -324,7 +323,6 @@
this.$forceUpdate();
}
}
},
allMoeny() { //
this.obj.money = this.balance

Loading…
Cancel
Save