|
|
|
@ -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)) { // 判断value值是否小于等于100, 如果大于100限制输入100 |
|
|
|
|
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值是否等于空,为空amount默认0, |
|
|
|
|
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) |
|
|
|
|