Compare commits

..

3 Commits

Author SHA1 Message Date
woody 9e3da7951b fix(numberToCurrency): 货币符号写死 2025-08-15 09:44:21 +08:00
woody e7e3c867bb feat(balance): 提现不进行经销商认证 2025-08-15 09:44:21 +08:00
woody c397ab7f71 feat(realName): 实名认证 2025-08-15 09:44:21 +08:00
3 changed files with 71 additions and 39 deletions

View File

@ -101,6 +101,11 @@
<script>
import * as bal from '@/config/balance.js'
const BALANCE_TYPE = {
RECHARGE: 1,
WITHDRAW: 2,
TRANSFER: 3,
}
export default {
data() {
return {
@ -108,17 +113,17 @@ export default {
{
name: '充值',
path: '/pages/pay/index',
id: '1',
id: BALANCE_TYPE.RECHARGE,
},
{
name: '提现',
path: '/pages/mine/balance/withdrawal',
id: '2',
id: BALANCE_TYPE.WITHDRAW,
},
{
name: '转账',
path: '/pages/mine/balance/transfer',
id: '3',
id: BALANCE_TYPE.TRANSFER,
},
],
tabActive: '',
@ -155,12 +160,12 @@ export default {
{
name: '充值',
path: '/pages/pay/index',
id: '1',
id: BALANCE_TYPE.RECHARGE,
},
{
name: '提现',
path: '/pages/mine/balance/withdrawal',
id: '2',
id: BALANCE_TYPE.WITHDRAW,
},
]
} else {
@ -168,17 +173,17 @@ export default {
{
name: '充值',
path: '/pages/pay/index',
id: '1',
id: BALANCE_TYPE.RECHARGE,
},
{
name: '提现',
path: '/pages/mine/balance/withdrawal',
id: '2',
id: BALANCE_TYPE.WITHDRAW,
},
{
name: '转账',
path: '/pages/mine/balance/transfer',
id: '3',
id: BALANCE_TYPE.TRANSFER,
},
]
}
@ -228,9 +233,15 @@ export default {
handleLink(item) {
this.tabActive = item.path
if (item.id == 2 || item.id == 3) {
if (
item.id == BALANCE_TYPE.WITHDRAW ||
item.id == BALANCE_TYPE.TRANSFER
) {
if (this.userInfo.pkCountry == 1) {
if (this.userInfo.pkGradeId == 1 && item.id == 2) {
if (
this.userInfo.pkGradeId == 1 &&
item.id == BALANCE_TYPE.WITHDRAW
) {
} else {
bal
.getIfAuth({
@ -238,15 +249,19 @@ export default {
})
.then(res => {
if (res.code == 200 && res.flag == 'Y') {
this.checkExit(item)
uni.navigateTo({
url: item.path,
})
} else if (res.code == 200 && res.flag == 'N') {
this.smShow = true
uni.showToast({
title: '请先进行实名认证',
icon: 'none',
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/selfService/realName/realName',
})
}, 900)
}
})
}

View File

@ -44,6 +44,7 @@
>
<u--input
:placeholder="'请输入'"
disabled
v-model="dataForm.accountName"
></u--input>
</u-form-item>
@ -54,7 +55,11 @@
prop="sex"
ref="item1"
>
<u-radio-group v-model="dataForm.sex" @change="radioGroupChange">
<u-radio-group
disabled
v-model="dataForm.sex"
@change="radioGroupChange"
>
<u-radio
:customStyle="{ marginRight: '16rpx' }"
v-for="(item, index) in sexList"
@ -75,7 +80,6 @@
>
<u--input
suffixIcon="arrow-right"
readonly
v-model="dataForm.idName"
disabled
:placeholder="'请选择'"
@ -91,10 +95,11 @@
>
<u--input
:placeholder="'请输入'"
disabled
v-model="dataForm.idCard"
></u--input>
</u-form-item>
<u-form-item
<!-- <u-form-item
required
label-width="180rpx"
:label="'银行名称'"
@ -137,8 +142,8 @@
v-model="dataForm.subBankName"
disabledColor="#F5F5F5;"
></u--input>
</u-form-item>
<u-form-item
</u-form-item> -->
<!-- <u-form-item
required
@click="getDiqu"
:label="'所在地区'"
@ -153,7 +158,7 @@
:placeholder="'请选择'"
>
</u--input>
</u-form-item>
</u-form-item> -->
<view class="view-class">
<u-form-item
@ -165,6 +170,7 @@
>
<u-textarea
v-model="dataForm.address"
disabled
placeholder-class="place-class"
class="border-color"
maxlength="200"
@ -285,10 +291,10 @@ export default {
showAmount: false,
showCtype: false,
dataForm: {
bankName: '',
cardNumber: '',
pkBank: '',
subBankName: '',
// bankName: '',
// cardNumber: '',
// pkBank: '',
// subBankName: '',
accountName: '',
idCard: '',
pkProvince: '',
@ -457,6 +463,7 @@ export default {
this.$set(this.dataForm, 'accountName', res.data.name)
this.$set(this.dataForm, 'idCard', res.data.idCard)
this.$set(this.dataForm, 'sex', res.data.sex)
this.$set(this.dataForm, 'address', res.data.address)
} else {
this.$nextTick(() => {
this.$refs.uploadImg1.deletePic({ index: 0 })
@ -486,10 +493,13 @@ export default {
}
},
imageUploaded1(url) {
if (!url) return
this.dataForm.idFront = url
this.getIdCardInfo(url)
},
imageUploaded2(url) {
this.dataForm.idBack = url
this.idBackChange(url)
},
// radio
radioGroupChange(e) {

View File

@ -1,30 +1,34 @@
import store from '@/store'
let userInfo = uni.getStorageSync('User')
export function stateFormat(row, column, cellValue) {
if (cellValue) {
return Number(cellValue)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
return $1 + ',';
return $1 + ','
})
.replace(/\.$/, "");
.replace(/\.$/, '')
}
}
//element 转成千分位并保留小数
//decimal 默认保留2位小数
export function toThousandthAndKeepDecimal(element, decimal = 2) {
if (!element || element === '') {//值不存在 或为空
if (!element || element === '') {
//值不存在 或为空
return ''
} else if (typeof element == 'string') {
return Number(element).toLocaleString(undefined, { minimumFractionDigits: decimal, maximumFractionDigits: decimal });
return Number(element).toLocaleString(undefined, {
minimumFractionDigits: decimal,
maximumFractionDigits: decimal,
})
} else if (typeof element == 'number') {
return element.toLocaleString(undefined, { minimumFractionDigits: decimal, maximumFractionDigits: decimal });
return element.toLocaleString(undefined, {
minimumFractionDigits: decimal,
maximumFractionDigits: decimal,
})
} else {
return element;
return element
}
}
// 千分号
export function numberToCurrencyNo(value) {
@ -36,14 +40,17 @@ export function numberToCurrencyNo(value) {
// 获取整数部分
const intPart = Math.trunc(value)
// 整数部分处理,增加,
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
const intPartFormat = intPart
.toString()
.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
// 预定义小数部分
let floatPart = ''
// 将数值截取为小数部分和整数部分
const valueArray = value.toString().split('.')
if (valueArray.length === 2) { // 有小数部分
if (valueArray.length === 2) {
// 有小数部分
floatPart = valueArray[1].toString() // 取得小数部分
if(floatPart.length == 1){
if (floatPart.length == 1) {
floatPart = floatPart + '0'
}
return intPartFormat + '.' + floatPart
@ -62,9 +69,9 @@ export function numberToCurrencyNo(value) {
// }
// 添加当地币
export function isLocal(value) {
return (store.getters.user.currencyIcon + value) || (userInfo.currencyIcon + value)
return '¥' + value
}
// 添加当地币
export function isLocaled(value) {
return store.getters.user.currencyIcon || userInfo.currencyIcon
return '¥'
}