|
|
@@ -71,18 +71,16 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { computed, ref, onMounted, onUnmounted, watch } from 'vue'
|
|
|
-import { newsApi } from '@/service/news'
|
|
|
-import { storeToRefs } from 'pinia'
|
|
|
import useRouter from '@/hooks/useRouter'
|
|
|
import { drawApi } from '@/service/draw'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import { useMenuSplit } from '@/composables/useMenuSplit'
|
|
|
import useUserStore from '@/stores/use-user-store'
|
|
|
import { userToken } from '@/composables/config'
|
|
|
-import { onLoad } from '@dcloudio/uni-app'
|
|
|
import { ibApi } from '@/service/ib'
|
|
|
import { documentaryApi } from '@/service/documentary'
|
|
|
-
|
|
|
+import { useFilters } from '@/composables/useFilters'
|
|
|
+const { numberDecimal } = useFilters()
|
|
|
const { mode } = useMenuSplit()
|
|
|
|
|
|
const { t, locale } = useI18n()
|
|
|
@@ -101,16 +99,6 @@ const walletData = ref({})
|
|
|
const handleMenuClick = ({ value }) => {
|
|
|
goPages(value)
|
|
|
}
|
|
|
-const NumberDecimal = (value) => {
|
|
|
- let realVal = ''
|
|
|
- if (!isNaN(value) && value !== '') {
|
|
|
- // 截取当前数据到小数点后两位
|
|
|
- realVal = value// parseFloat(value).toFixed(2)
|
|
|
- } else {
|
|
|
- realVal = '0'
|
|
|
- }
|
|
|
- return realVal
|
|
|
-}
|
|
|
const NumberDesensitization = (value) => {
|
|
|
let realVal = ''
|
|
|
if (!isNaN(value) && value !== '') {
|
|
|
@@ -126,27 +114,27 @@ const walletbalance = ref(0)
|
|
|
const pendingWithdrawAmount = ref(0)
|
|
|
const formattedBalance = computed(() => {
|
|
|
const value = walletbalance.value || '0'
|
|
|
- const decimalValue = NumberDecimal(value)
|
|
|
+ const decimalValue = numberDecimal(value)
|
|
|
return isShow.value ? decimalValue : NumberDesensitization(decimalValue)
|
|
|
})
|
|
|
const formattedPendingWithdrawAmount = computed(() => {
|
|
|
const value = pendingWithdrawAmount.value || '0'
|
|
|
- const decimalValue = NumberDecimal(value)
|
|
|
+ const decimalValue = numberDecimal(value)
|
|
|
return isShow.value ? decimalValue : NumberDesensitization(decimalValue)
|
|
|
})
|
|
|
|
|
|
//ib金额
|
|
|
const ibBalance = computed(() => {
|
|
|
- const value = NumberDecimal(ibData.value?.balance || 0)
|
|
|
+ const value = numberDecimal(ibData.value?.balance || 0)
|
|
|
return isShow.value ? value : NumberDesensitization(value)
|
|
|
})
|
|
|
const ibTotalBalance = computed(() => {
|
|
|
- const value = NumberDecimal(ibData.value?.all || 0)
|
|
|
+ const value = numberDecimal(ibData.value?.all || 0)
|
|
|
return isShow.value ? value : NumberDesensitization(value)
|
|
|
})
|
|
|
// 跟单
|
|
|
const followBalance = computed(() => {
|
|
|
- const value = NumberDecimal(walletData.value?.walletAmount || 0)
|
|
|
+ const value = numberDecimal(walletData.value?.walletAmount || 0)
|
|
|
return isShow.value ? value : NumberDesensitization(value)
|
|
|
})
|
|
|
const getWalletList = async () => {
|