Compare commits

..

No commits in common. "9e3da7951b91f98816031b984ed2a3caf9ea53ff" and "e1eeb64c7406a28601994acc54e74718da23a777" have entirely different histories.

3 changed files with 39 additions and 71 deletions

View File

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

View File

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

View File

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