每周更新
This commit is contained in:
@@ -229,12 +229,25 @@
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 修改钱包绑定配置弹窗:参数保持与列表一致 -->
|
||||
<el-dialog title="修改配置" :visible.sync="visibleConfigEdit" width="560px">
|
||||
<el-dialog title="修改配置" :visible.sync="visibleConfigEdit" width="560px" @close="handleConfigEditClose">
|
||||
|
||||
<div class="row">
|
||||
<label class="label">钱包地址</label>
|
||||
<el-input v-model="configForm.payAddress" placeholder="请输入钱包地址" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="label">谷歌验证码</label>
|
||||
<el-input
|
||||
v-model="configForm.googleCode"
|
||||
placeholder="请输入6位谷歌验证码"
|
||||
maxlength="6"
|
||||
@input="handleConfigGoogleCodeInput"
|
||||
>
|
||||
<template slot="prepend">
|
||||
<i class="el-icon-key"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visibleConfigEdit=false">取消</el-button>
|
||||
<el-button type="primary" @click="submitConfigEdit">确认修改</el-button>
|
||||
@@ -272,7 +285,7 @@ export default {
|
||||
// 店铺配置列表
|
||||
shopConfigs: [],
|
||||
visibleConfigEdit: false,
|
||||
configForm: { id: '', chainLabel: '', chainValue: '', payAddress: '', payCoins: [], payCoin: '' },
|
||||
configForm: { id: '', chainLabel: '', chainValue: '', payAddress: '', payCoins: [], payCoin: '', googleCode: '' },
|
||||
productOptions: [],
|
||||
coinOptions: coinList || [],
|
||||
editCoinOptionsApi: [],
|
||||
@@ -554,8 +567,14 @@ export default {
|
||||
if (!Number.isFinite(amtInt) || amtInt <= 0) { callback(new Error('请输入有效的金额')); return }
|
||||
const feeInt = this.toScaledInt(this.withdrawForm.fee)
|
||||
const balanceInt = this.toScaledInt((this.currentWithdrawRow && this.currentWithdrawRow.balance) || 0)
|
||||
if (amtInt >= balanceInt) { callback(new Error('提现金额必须小于可用余额')); return }
|
||||
// 允许提现金额等于可用余额,但不能大于
|
||||
if (amtInt > balanceInt) { callback(new Error('提现金额不能大于可用余额')); return }
|
||||
// 提现金额必须大于手续费
|
||||
if (amtInt <= feeInt) { callback(new Error('提现金额必须大于手续费')); return }
|
||||
// 实际到账金额(提现金额 - 手续费)必须大于0
|
||||
const actualInt = amtInt - feeInt
|
||||
if (actualInt <= 0) { callback(new Error('提现金额扣除手续费后必须大于0')); return }
|
||||
// 最小提现金额为 1
|
||||
if (amtInt < 1000000) { callback(new Error('最小提现金额为 1')); return }
|
||||
callback()
|
||||
},
|
||||
@@ -701,7 +720,8 @@ export default {
|
||||
chainValue: d.value || '',
|
||||
payAddress: d.address || '',
|
||||
payCoins: preSelected,
|
||||
payCoin: preSelected.join(',')
|
||||
payCoin: preSelected.join(','),
|
||||
googleCode: ''
|
||||
}
|
||||
} else {
|
||||
// 回退:使用行内已有数据
|
||||
@@ -715,7 +735,8 @@ export default {
|
||||
chainValue: row.chain || '',
|
||||
payAddress: row.payAddress || '',
|
||||
payCoins,
|
||||
payCoin: payCoins.join(',')
|
||||
payCoin: payCoins.join(','),
|
||||
googleCode: ''
|
||||
}
|
||||
}
|
||||
this.visibleConfigEdit = true
|
||||
@@ -727,19 +748,42 @@ export default {
|
||||
this.deleteShopConfig({id:row.id})
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理谷歌验证码输入(仅允许数字)
|
||||
*/
|
||||
handleConfigGoogleCodeInput(v) {
|
||||
this.configForm.googleCode = String(v || '').replace(/\D/g, '')
|
||||
},
|
||||
/**
|
||||
* 修改配置弹窗关闭时清空验证码
|
||||
*/
|
||||
handleConfigEditClose() {
|
||||
this.configForm.googleCode = ''
|
||||
},
|
||||
/**
|
||||
* 提交配置修改
|
||||
*/
|
||||
async submitConfigEdit() {
|
||||
// 仅校验钱包地址
|
||||
// 校验钱包地址
|
||||
const addr = (this.configForm.payAddress || '').trim()
|
||||
if (!addr) {
|
||||
this.$message.warning('请输入钱包地址')
|
||||
return
|
||||
}
|
||||
|
||||
// 校验谷歌验证码
|
||||
const googleCode = String(this.configForm.googleCode || '').trim()
|
||||
if (!googleCode) {
|
||||
this.$message.warning('请输入谷歌验证码')
|
||||
return
|
||||
}
|
||||
if (!/^\d{6}$/.test(googleCode)) {
|
||||
this.$message.warning('谷歌验证码必须是6位数字')
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用 RSA 加密钱包地址(与“钱包绑定”页面保持一致:同步优先,异步兜底)
|
||||
* 使用 RSA 加密钱包地址(与"钱包绑定"页面保持一致:同步优先,异步兜底)
|
||||
* @type {string}
|
||||
*/
|
||||
let encryptedPayAddress = addr
|
||||
@@ -761,7 +805,8 @@ export default {
|
||||
const payload = {
|
||||
id: this.configForm.id,
|
||||
chain: this.configForm.chainValue || this.configForm.chainLabel || '',
|
||||
payAddress: encryptedPayAddress
|
||||
payAddress: encryptedPayAddress,
|
||||
gcode: googleCode
|
||||
}
|
||||
try {
|
||||
const res = await updateShopConfigV2(payload)
|
||||
|
||||
Reference in New Issue
Block a user