|
|
@@ -26,7 +26,7 @@
|
|
|
</view>
|
|
|
<view class="flex-1">
|
|
|
<view class="d-flex justify-between items-start mb-1">
|
|
|
- <text class="text-muted text-sm">Total Balance</text>
|
|
|
+ <text class="text-muted text-sm">{{t('vu.custom.t1')}}</text>
|
|
|
<text
|
|
|
:class="['growth-rate', compareData.totalBalanceGrowthRate||0 >= 0 ? 'rate-up' : 'rate-down']">
|
|
|
{{ compareData.totalBalanceGrowthRate || 0 >= 0 ? '+' : ''
|
|
|
@@ -46,7 +46,7 @@
|
|
|
</view>
|
|
|
<view class="flex-1">
|
|
|
<view class="d-flex justify-between items-start mb-1">
|
|
|
- <text class="text-muted text-sm">Equity</text>
|
|
|
+ <text class="text-muted text-sm">{{t('vu.custom.t2')}}</text>
|
|
|
<text :class="['growth-rate', compareData.totalEquityGrowthRate ||0>= 0 ? 'rate-up' : 'rate-down']">
|
|
|
{{ compareData.totalEquityGrowthRate || 0 >= 0 ? '+' : ''
|
|
|
}}{{ compareData.totalEquityGrowthRate || 0 }}%
|
|
|
@@ -65,7 +65,7 @@
|
|
|
</view>
|
|
|
<view class="flex-1">
|
|
|
<view class="d-flex justify-between items-start mb-1">
|
|
|
- <text class="text-muted text-sm">Total deposit</text>
|
|
|
+ <text class="text-muted text-sm">{{t('vu.custom.t3')}}</text>
|
|
|
<text
|
|
|
:class="['growth-rate', compareData.totalDepositAmountGrowthRate ||0 >= 0 ? 'rate-up' : 'rate-down']">
|
|
|
{{ compareData.totalDepositAmountGrowthRate || 0 >= 0 ? '+' : ''
|
|
|
@@ -85,7 +85,7 @@
|
|
|
</view>
|
|
|
<view class="flex-1">
|
|
|
<view class="d-flex justify-between items-start mb-1">
|
|
|
- <text class="text-muted text-sm">Total withdrawal</text>
|
|
|
+ <text class="text-muted text-sm">{{t('vu.custom.t4')}}</text>
|
|
|
<text
|
|
|
:class="['growth-rate', compareData.totalWithdrawalAmountGrowthRate||0 >= 0 ? 'rate-up' : 'rate-down']">
|
|
|
{{ compareData.totalWithdrawalAmountGrowthRate || 0 >= 0 ? '+' : ''
|
|
|
@@ -104,44 +104,48 @@
|
|
|
<view class="chart-box crm-border-radius">
|
|
|
<view class="chart-title">
|
|
|
<uni-row>
|
|
|
- <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
|
|
|
- <view class="time" @click="toReload">
|
|
|
- <cwg-icon name="crm-refresh" :size="16" color="#666" />
|
|
|
- <text class="crm-cursor"> GMT+3 {{ time }}</text>
|
|
|
- </view>
|
|
|
- </uni-col>
|
|
|
- <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
|
|
|
- <view class="title">
|
|
|
- <view class="name">
|
|
|
+ <uni-row>
|
|
|
+ <view class="opt-title mb-2">
|
|
|
+ <view class="bigtitle">
|
|
|
<text v-if="chartForm.chartType == 4">{{ t('Custom.Index.TradingVolumeStatistics') }}</text>
|
|
|
<text v-if="chartForm.chartType == 2">{{ t('Custom.Index.DepositStatistical') }}</text>
|
|
|
<text v-if="chartForm.chartType == 3">{{ t('Custom.Index.WithdrawalsStatistical') }}</text>
|
|
|
<text v-if="chartForm.chartType == 6">{{ t('Custom.Index.ProfitLoss') }}</text>
|
|
|
</view>
|
|
|
- <view class="account" v-if="chartForm.login">
|
|
|
- <text>{{ t('Custom.Index.TradingAccount') }}</text>
|
|
|
- <text> —</text>
|
|
|
- <text>{{ chartForm.login }}</text>
|
|
|
- </view>
|
|
|
- <view class="date">
|
|
|
- <uni-datetime-picker
|
|
|
- v-model="isDate"
|
|
|
- type="daterange"
|
|
|
- :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')"
|
|
|
- @change="getSearchDate"
|
|
|
- />
|
|
|
+ <view class="time" @click="toReload">
|
|
|
+ <cwg-icon name="crm-refresh" :size="16" color="#666" />
|
|
|
+ <text class="crm-cursor"> GMT+3 {{ time }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </uni-col>
|
|
|
- <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
|
|
|
- <view class="operation" @click="isChart = true">
|
|
|
- <text style="font-size: 14px">{{ t('Custom.Index.Parameter') }}</text>
|
|
|
- <cwg-icon name="iconcanshu" :size="16" color="#666" />
|
|
|
+
|
|
|
+ </uni-row>
|
|
|
+
|
|
|
+ <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
+ <view class="btn-opt">
|
|
|
+ <view class="title">
|
|
|
+
|
|
|
+ <view class="account" v-if="chartForm.login">
|
|
|
+ <text>{{ t('Custom.Index.TradingAccount') }}</text>
|
|
|
+ <text> —</text>
|
|
|
+ <text>{{ chartForm.login }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="date">
|
|
|
+ <uni-datetime-picker
|
|
|
+ v-model="isDate"
|
|
|
+ type="daterange"
|
|
|
+ :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')"
|
|
|
+ @change="getSearchDate"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <button class="operation" @click="isChart = true">
|
|
|
+ <text style="font-size: 14px">{{ t('Custom.Index.Parameter') }}</text>
|
|
|
+ </button>
|
|
|
</view>
|
|
|
</uni-col>
|
|
|
</uni-row>
|
|
|
</view>
|
|
|
- {{isMobile}}
|
|
|
<view class="chart-container">
|
|
|
<cwg-match-media :max-width="991">
|
|
|
<cwg-charts type="line" :chartData="chartData" :opts="chartOpts" tooltipFormat="tooltipCustom" ontouch />
|
|
|
@@ -152,6 +156,21 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</uni-col>
|
|
|
+ <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" style="height: 100%">
|
|
|
+ <view class="chart-box mh crm-border-radius">
|
|
|
+ <view class="bigtitle mb-3">
|
|
|
+ {{t('Custom.Index.MyAccount')}}
|
|
|
+ </view>
|
|
|
+ <view class="mb-2">
|
|
|
+ <cwg-combox :clearable="false" v-model:value="loginValue"
|
|
|
+ :options="loginComboxOptions" :placeholder="t('placeholder.choose')" @change="setCurData"/>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <AccountCard :key="curData?.accountNumber"
|
|
|
+ :account="curData" noCtrl />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-col>
|
|
|
</uni-col>
|
|
|
</uni-row>
|
|
|
<cwg-improve-popup v-model:visible="dialogCheck" @confirm="confirm" />
|
|
|
@@ -165,7 +184,6 @@
|
|
|
v-model:value="chartForm.chartType"
|
|
|
:options="chartTypeOptions"
|
|
|
:placeholder="t('placeholder.choose')"
|
|
|
- filterable
|
|
|
/>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item :label="t('Label.PlatformType') + ':'" prop="platform">
|
|
|
@@ -181,7 +199,6 @@
|
|
|
v-model:value="chartForm.login"
|
|
|
:options="loginOptions"
|
|
|
:placeholder="t('placeholder.choose')"
|
|
|
- filterable
|
|
|
/>
|
|
|
</uni-forms-item>
|
|
|
</uni-forms>
|
|
|
@@ -201,19 +218,17 @@
|
|
|
import useRouter from '@/hooks/useRouter'
|
|
|
import config from '@/config/index'
|
|
|
import useUserStore from '@/stores/use-user-store'
|
|
|
- import { useStorage } from '@/hooks/useStorage'
|
|
|
import { useFilters } from '@/composables/useFilters'
|
|
|
import { documentaryApi } from '@/service/documentary'
|
|
|
import { customApi } from '@/service/custom'
|
|
|
import { userApi } from '@/api/user'
|
|
|
-
|
|
|
+ import AccountCard from '@/pages/customer/components/AccountCard.vue'
|
|
|
const { t, locale } = useI18n()
|
|
|
const loading = ref(false)
|
|
|
const router = useRouter()
|
|
|
const { Code } = config
|
|
|
const userStore = useUserStore()
|
|
|
const { numberFormat } = useFilters()
|
|
|
- const listApi = ref(documentaryApi.followDailySubscribeProfit)
|
|
|
|
|
|
|
|
|
const loginOptions = ref([])
|
|
|
@@ -222,6 +237,7 @@
|
|
|
const dealDate = ref({})
|
|
|
const SubscribeProfitDate = ref([])
|
|
|
const compareData = ref({})
|
|
|
+ const loginValue = ref('')
|
|
|
|
|
|
const isChart = ref(false)
|
|
|
const isDate = ref(['', ''])
|
|
|
@@ -262,11 +278,11 @@
|
|
|
login: '',
|
|
|
})
|
|
|
|
|
|
- const chartTypeOptions = ref([
|
|
|
- { text: 'Trading Volume Statistics', value: 4 },
|
|
|
- { text: 'Deposit Statistical', value: 2 },
|
|
|
- { text: 'Withdrawals Statistical', value: 3 },
|
|
|
- { text: 'Profit Loss', value: 6 },
|
|
|
+ const chartTypeOptions = computed(() => [
|
|
|
+ { text: t('Custom.Index.TradingVolumeStatistics'), value: 4 },
|
|
|
+ { text: t('Custom.Index.DepositStatistical'), value: 2 },
|
|
|
+ { text: t('Custom.Index.WithdrawalsStatistical'), value: 3 },
|
|
|
+ { text: t('Custom.Index.ProfitLoss'), value: 6 },
|
|
|
])
|
|
|
|
|
|
const platformOptions = [
|
|
|
@@ -274,6 +290,19 @@
|
|
|
{ text: 'MT5', value: 'MT5' },
|
|
|
]
|
|
|
|
|
|
+ const loginDataOptions = ref([])
|
|
|
+ const loginComboxOptions = computed(() => {
|
|
|
+ return loginDataOptions.value.map((item) => ({
|
|
|
+ text: item.label,
|
|
|
+ value: item.login
|
|
|
+ }))
|
|
|
+ })
|
|
|
+
|
|
|
+ const isAfterJuly28 = () => {
|
|
|
+ const now = new Date();
|
|
|
+ const july28 = new Date(2025, 6, 28, 0, 0, 0); // 月份从0开始,所以7月是6
|
|
|
+ return now >= july28;
|
|
|
+ }
|
|
|
const getLocalTime = () => {
|
|
|
let timezone = 2 //目标时区时间,东2区 东时区正数 西市区负数
|
|
|
let offset_GMT = new Date().getTimezoneOffset() // 本地时间和格林威治的时间差,单位为分钟
|
|
|
@@ -307,6 +336,21 @@
|
|
|
const toReload = () => {
|
|
|
goTime()
|
|
|
}
|
|
|
+ // 获取账户信息
|
|
|
+ const getDateList = async () => {
|
|
|
+ loading.value = true
|
|
|
+ let res = await customApi.CustomDropdown({ platform: "" })
|
|
|
+ if (res.code == Code.StatusOK) {
|
|
|
+ loginDataOptions.value = res.data.map(item => ({
|
|
|
+ ...item,
|
|
|
+ label: `${item.login}`
|
|
|
+ }))
|
|
|
+ const found = loginDataOptions.value?.[0]
|
|
|
+ loginValue.value = found?.login||null
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: res.msg, icon: 'none' })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const getSearchDate = (val) => {
|
|
|
if (Array.isArray(val)) {
|
|
|
@@ -393,46 +437,6 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- const groupTypeName = (type) => {
|
|
|
- if (!type) return '--'
|
|
|
- if (type == 1) return t('AccountType.ClassicAccount')
|
|
|
- if (type == 2) return t('AccountType.SeniorAccount')
|
|
|
- if (type == 5) return t('AccountType.SpeedAccount')
|
|
|
- if (type == 6) return t('AccountType.SpeedAccount')
|
|
|
- if (type == 7) return t('AccountType.StandardAccount')
|
|
|
- if (type == 8) return t('AccountType.CentAccount')
|
|
|
- return type
|
|
|
- }
|
|
|
-
|
|
|
- const groupCurrency = (type) => {
|
|
|
- console.log(type, 'usd')
|
|
|
- if (type == 'GBP') {
|
|
|
- return ': £'
|
|
|
- } else if (type == 'USD') {
|
|
|
- return ': $'
|
|
|
- } else if (type == 'EUR') {
|
|
|
- return ': €'
|
|
|
- } else if (type == 'USC') {
|
|
|
- return ': ¢'
|
|
|
- } else {
|
|
|
- return ': $'
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- const groupCurrency1 = (type) => {
|
|
|
- if (type == 'GBP') {
|
|
|
- return '£'
|
|
|
- } else if (type == 'USD') {
|
|
|
- return '$'
|
|
|
- } else if (type == 'EUR') {
|
|
|
- return '€'
|
|
|
- } else if (type == 'USC') {
|
|
|
- return '¢'
|
|
|
- } else {
|
|
|
- return '$'
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// 今日时间
|
|
|
const dateWeek = computed(() => {
|
|
|
const now = dayjs()
|
|
|
@@ -463,7 +467,7 @@
|
|
|
res.data.customInfo.status == 2 &&
|
|
|
res.data.customInfo.applyRealStatus == 2
|
|
|
) {
|
|
|
- router.push(`/pages/customer/account-select?server=${cativeIndex.value}`)
|
|
|
+ router.push(`/pages/customer/account-select?server=${'real'}`)
|
|
|
} else {
|
|
|
dialogCheck.value = true
|
|
|
}
|
|
|
@@ -574,11 +578,93 @@
|
|
|
chartShow.value = true
|
|
|
// #endif
|
|
|
}
|
|
|
+
|
|
|
+ const AccountList = ref([])
|
|
|
+ const getAccountList = async () => {
|
|
|
+ AccountList.value = []
|
|
|
+
|
|
|
+ const res = await customApi.AccountAllList({
|
|
|
+ page: {
|
|
|
+ current: 1,
|
|
|
+ size: 100
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ AccountList.value = res.data
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const typeMap = computed(() => ({
|
|
|
+ 1: t('AccountType.ClassicAccount'),
|
|
|
+ 2: t('AccountType.SeniorAccount'),
|
|
|
+ 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
|
|
|
+ 5: t('AccountType.SpeedAccount'),
|
|
|
+ 6: t('AccountType.SpeedAccount'),
|
|
|
+ 7: t('AccountType.StandardAccount'),
|
|
|
+ 8: t('AccountType.CentAccount')
|
|
|
+ }));
|
|
|
+ // 格式化数值函数
|
|
|
+ function formatMoney(value) {
|
|
|
+ if (value === null || value === undefined) value = 0;
|
|
|
+ const sign = value >= 0 ? '' : '-';
|
|
|
+ const absoluteValue = Math.abs(value);
|
|
|
+ return '$' + sign + absoluteValue.toFixed(2);
|
|
|
+ }
|
|
|
+ // 转换数组
|
|
|
+ const accounts = computed(() => {
|
|
|
+ if (!AccountList.value || AccountList.value.length == 0) return []
|
|
|
+ let filteredAccounts = AccountList.value
|
|
|
+ return filteredAccounts.map((acc, index) => {
|
|
|
+ const currency = acc.currency || 'USD';
|
|
|
+ const floating = acc.floating ?? 0;
|
|
|
+ let labels = [t('vu.item1'), 'MT4', 'Standard'];
|
|
|
+ labels[0] = t('vu.item1');
|
|
|
+ labels[1] = acc.platform || 'MT4';
|
|
|
+ labels[2] = typeMap.value[acc.type];
|
|
|
+ let nickname = typeMap.value[acc.type];
|
|
|
+ let fwq
|
|
|
+
|
|
|
+ fwq = acc.platform == 'MT4' ? 'CWGMarketsLtd-Live' : 'CWGMarketsSVG-Live';
|
|
|
+
|
|
|
+ const balance = acc.balance
|
|
|
+ return {
|
|
|
+ ...acc,
|
|
|
+ labels,
|
|
|
+ isExpanded: index == 0,
|
|
|
+ balance,
|
|
|
+ accountNumber: acc.login.toString(),
|
|
|
+ nickname,
|
|
|
+ fwq,
|
|
|
+ balanceWithSymbol: acc.balanceWithSymbol ?? '$0',
|
|
|
+ creditWithSymbol: acc.creditWithSymbol ?? '$0',
|
|
|
+ equityWithSymbol: acc.equityWithSymbol ?? '$0',
|
|
|
+ currency,
|
|
|
+ actualLeverage: '1:' + (acc.leverage ?? 0),
|
|
|
+ floatingPL: formatMoney(floating),
|
|
|
+ platform: acc.platform || 'MT4',
|
|
|
+ server: acc.groupCode || '',
|
|
|
+ login: acc.login.toString(),
|
|
|
+ listType: 'real'
|
|
|
+ };
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const curData = ref()
|
|
|
+ const setCurData = (val)=>{
|
|
|
+ console.log(accounts.value, val)
|
|
|
+ curData.value = accounts.value.find(item=>item.login == val)
|
|
|
+ }
|
|
|
+ watch(() => accounts.value, (val)=>{
|
|
|
+ if (val.length){
|
|
|
+ curData.value = accounts.value.find(item=>item.login == loginValue.value)
|
|
|
+ }
|
|
|
+ })
|
|
|
onMounted(async () => {
|
|
|
loading.value = true
|
|
|
goTime()
|
|
|
await getData()
|
|
|
await getDropDown()
|
|
|
+ await getDateList()
|
|
|
+ await getAccountList()
|
|
|
// await fetchChartData()
|
|
|
loading.value = false
|
|
|
})
|
|
|
@@ -899,21 +985,41 @@
|
|
|
padding: px2rpx(16);
|
|
|
box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
|
|
|
}
|
|
|
+ .mh{
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
|
|
|
.chart-title {
|
|
|
+ width: 100%;
|
|
|
+ //display: flex;
|
|
|
+ //justify-content: space-between;
|
|
|
+ //align-items: flex-start;
|
|
|
+ //margin-bottom: px2rpx(16);
|
|
|
+ //padding-bottom: px2rpx(16);
|
|
|
+ border-bottom: 1px solid #f0f0f0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bigtitle{
|
|
|
+ font-size: px2rpx(18);
|
|
|
+ }
|
|
|
+ .opt-title{
|
|
|
display: flex;
|
|
|
+ align-items: center;
|
|
|
justify-content: space-between;
|
|
|
- align-items: flex-start;
|
|
|
- margin-bottom: px2rpx(16);
|
|
|
- padding-bottom: px2rpx(16);
|
|
|
- border-bottom: 1px solid #f0f0f0;
|
|
|
+
|
|
|
+ }
|
|
|
+ .btn-opt{
|
|
|
+ display: flex;
|
|
|
+ height: 100%;
|
|
|
+ align-items: flex-end;
|
|
|
+ justify-content: flex-end;
|
|
|
}
|
|
|
|
|
|
.chart-title .time {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
gap: px2rpx(8);
|
|
|
- font-size: px2rpx(20);
|
|
|
+ font-size: px2rpx(16);
|
|
|
margin-bottom: px2rpx(10);
|
|
|
color: #999;
|
|
|
}
|
|
|
@@ -925,15 +1031,17 @@
|
|
|
}
|
|
|
|
|
|
.chart-title .title .name {
|
|
|
- font-size: px2rpx(20);
|
|
|
+ font-size: px2rpx(18);
|
|
|
font-weight: 600;
|
|
|
color: var(--bs-heading-color);
|
|
|
+ text-align: center;
|
|
|
margin-bottom: px2rpx(8);
|
|
|
}
|
|
|
|
|
|
.chart-title .title .account {
|
|
|
- font-size: px2rpx(20);
|
|
|
+ font-size: px2rpx(14);
|
|
|
color: #999;
|
|
|
+ text-align: center;
|
|
|
margin-bottom: px2rpx(8);
|
|
|
}
|
|
|
|
|
|
@@ -950,12 +1058,13 @@
|
|
|
}
|
|
|
|
|
|
.chart-title .operation {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: px2rpx(4);
|
|
|
+ //gap: px2rpx(4);
|
|
|
+ margin-left: px2rpx(10);
|
|
|
color: #666;
|
|
|
margin-bottom: px2rpx(10);
|
|
|
- cursor: pointer;
|
|
|
+ height: px2rpx(35);
|
|
|
+ width: px2rpx(110);
|
|
|
+ line-height: px2rpx(35)!important;
|
|
|
}
|
|
|
|
|
|
.chart-container {
|