|
|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
<view class="cwg-sidebar">
|
|
|
<view class="wallet-widget">
|
|
|
- <view class="wallet-header" :class="{'header-bottom':isWalletOpen}" @click="isWalletOpen = !isWalletOpen">
|
|
|
+ <view class="wallet-header" :class="{ 'header-bottom': isWalletOpen }"
|
|
|
+ @click="isWalletOpen = !isWalletOpen">
|
|
|
<view class="wallet-header-left">
|
|
|
<cwg-icon name="crm-payment" :size="16" color="#141d22" />
|
|
|
<text class="wallet-header-text">{{ mode === 'customer' ? formattedBalance : ibBalance }} USD</text>
|
|
|
@@ -10,29 +11,31 @@
|
|
|
<cwg-icon name="crm-chevron-down" :size="16" color="#6c8595" />
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="wallet-body" v-if="isWalletOpen">
|
|
|
<view class="wallet-body-header">
|
|
|
<text class="drawer-title">隐藏余额</text>
|
|
|
- <switch :checked="!isShow" @change="toggleShow" color="#6c8595" style="transform:scale(0.7); margin-right: -10px;" />
|
|
|
+ <switch :checked="!isShow" @change="toggleShow" color="#6c8595"
|
|
|
+ style="transform:scale(0.7); margin-right: -10px;" />
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="wallet-body-content">
|
|
|
<view class="balance-amount">{{ mode === 'customer' ? formattedBalance : ibBalance }} USD</view>
|
|
|
- <view class="wallet-type">{{ mode === 'customer' ? t('wallet.pendingWithdraw') : t('Ib.Index.TotalRevenue') }}</view>
|
|
|
+ <view class="wallet-type">{{ mode === 'customer' ? t('wallet.pendingWithdraw') :
|
|
|
+ t('Ib.Index.TotalRevenue') }}</view>
|
|
|
<view class="wallet-id-box">
|
|
|
- {{ mode === 'customer' ? formattedPendingWithdrawAmount : ibTotalBalance }}
|
|
|
+ {{ mode === 'customer' ? formattedPendingWithdrawAmount : ibTotalBalance }}
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="wallet-actions" v-if="mode === 'customer'">
|
|
|
- <button class="action-btn" @click.stop="goPages(1)" v-t="'wallet.item6'"></button>
|
|
|
- <button class="action-btn" @click.stop="goPages(2)" v-t="'wallet.item7'"></button>
|
|
|
+ <button class="action-btn" @click.stop="goPages(1)" v-t="'wallet.item6'"></button>
|
|
|
+ <button class="action-btn" @click.stop="goPages(2)" v-t="'wallet.item7'"></button>
|
|
|
</view>
|
|
|
<view class="wallet-actions" v-if="mode === 'ib'">
|
|
|
- <button class="action-btn" @click.stop="goIbPages(1)" v-t="'Custom.Index.Withdrawals'"></button>
|
|
|
- <button class="action-btn" @click.stop="goIbPages(2)" v-t="'Home.page_ib.item4'"></button>
|
|
|
-<!-- <button class="action-btn" @click.stop="goIbPages(3)" v-t="'Ib.Transfer.CommissionIssue'"></button>-->
|
|
|
+ <button class="action-btn" @click.stop="goIbPages(1)" v-t="'Custom.Index.Withdrawals'"></button>
|
|
|
+ <button class="action-btn" @click.stop="goIbPages(2)" v-t="'Home.page_ib.item4'"></button>
|
|
|
+ <!-- <button class="action-btn" @click.stop="goIbPages(3)" v-t="'Ib.Transfer.CommissionIssue'"></button>-->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -53,7 +56,7 @@
|
|
|
transition: 'height 281ms cubic-bezier(0.4, 0, 0.2, 1)'
|
|
|
}" :class="{ 'active': item.isOpenMenu }">
|
|
|
<cwg-submenu v-if="item.children && item.children.length" :submenu-items="item.children"
|
|
|
- @submenu-click="handleSubmenuClick" />
|
|
|
+ @submenu-click="handleClick1" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -84,7 +87,6 @@ import { useI18n } from 'vue-i18n'
|
|
|
const { t } = useI18n()
|
|
|
const router = useRouter()
|
|
|
const handleClick1 = (item: MenuItem) => {
|
|
|
- console.log(item)
|
|
|
emit('handle-click', item)
|
|
|
}
|
|
|
const { menus, setSubmenuRef, setMode, handleClick, handleSubmenuClick, mode } = useMenuSplit(handleClick1)
|
|
|
@@ -137,14 +139,14 @@ const ibBalance = computed(() => {
|
|
|
})
|
|
|
|
|
|
const formattedPendingWithdrawAmount = computed(() => {
|
|
|
- const value = pendingWithdrawAmount.value || '0'
|
|
|
- const decimalValue = NumberDecimal(value)
|
|
|
- return isShow.value ? decimalValue : NumberDesensitization(decimalValue)
|
|
|
+ const value = pendingWithdrawAmount.value || '0'
|
|
|
+ const decimalValue = NumberDecimal(value)
|
|
|
+ return isShow.value ? decimalValue : NumberDesensitization(decimalValue)
|
|
|
})
|
|
|
|
|
|
const ibTotalBalance = computed(() => {
|
|
|
- const value = NumberDecimal(ibData.value?.all || 0)
|
|
|
- return isShow.value ? value : NumberDesensitization(value)
|
|
|
+ const value = NumberDecimal(ibData.value?.all || 0)
|
|
|
+ return isShow.value ? value : NumberDesensitization(value)
|
|
|
})
|
|
|
const getWalletList = async () => {
|
|
|
let res = await drawApi.walletbalance({})
|
|
|
@@ -159,17 +161,17 @@ const getWalletList = async () => {
|
|
|
|
|
|
//获取处理中出金金额
|
|
|
const getPendingWithdrawAmount = async () => {
|
|
|
- let res = await drawApi.pendingWithdrawAmount({})
|
|
|
- if (res.code == 200) {
|
|
|
- if (res.data != null) {
|
|
|
- pendingWithdrawAmount.value = res.data
|
|
|
+ let res = await drawApi.pendingWithdrawAmount({})
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data != null) {
|
|
|
+ pendingWithdrawAmount.value = res.data
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
}
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none',
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
const getIbData = async () => {
|
|
|
@@ -185,7 +187,7 @@ watch(() => mode.value, (newMode) => {
|
|
|
if (!userToken.value) return
|
|
|
if (newMode == 'customer') {
|
|
|
getWalletList()
|
|
|
- getPendingWithdrawAmount()
|
|
|
+ getPendingWithdrawAmount()
|
|
|
} else if (newMode == 'ib') {
|
|
|
getIbData()
|
|
|
}
|
|
|
@@ -244,9 +246,11 @@ const goIbPages = (type: number) => {
|
|
|
border-bottom: 1px solid rgba(108, 133, 149, 0.12);
|
|
|
overflow: hidden;
|
|
|
margin-bottom: px2rpx(4);
|
|
|
- .header-bottom{
|
|
|
- border-bottom: 1px solid rgba(108, 133, 149, 0.12);
|
|
|
+
|
|
|
+ .header-bottom {
|
|
|
+ border-bottom: 1px solid rgba(108, 133, 149, 0.12);
|
|
|
}
|
|
|
+
|
|
|
.wallet-header {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
@@ -267,9 +271,10 @@ const goIbPages = (type: number) => {
|
|
|
color: #141d22;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.wallet-header-right {
|
|
|
transition: transform 0.3s;
|
|
|
+
|
|
|
&.expanded {
|
|
|
transform: rotate(180deg);
|
|
|
}
|
|
|
@@ -312,7 +317,7 @@ const goIbPages = (type: number) => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
gap: px2rpx(4);
|
|
|
-
|
|
|
+
|
|
|
.wallet-id {
|
|
|
font-size: 12px;
|
|
|
color: #999;
|