|
|
@@ -6,9 +6,13 @@
|
|
|
<view class="border-0 card-header">
|
|
|
<view class="d-flex flex-wrap gap-3 align-items-center justify-content-between mb-3">
|
|
|
<h3 class="mb-0" v-t="'Custom.Index.AccountList'"></h3>
|
|
|
- <button type="button" class="btn btn-secondary btn-shadow waves-effect" @click="createAccount"><i
|
|
|
- class="fi fi-rr-plus"></i>
|
|
|
- <text v-t="'Custom.Index.AddAccount'" /></button>
|
|
|
+ <button type="button" class="btn btn-secondary btn-shadow waves-effect"
|
|
|
+ @click="createAccount">
|
|
|
+ <view class="d-flex align-items-center">
|
|
|
+ <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
+ <text v-t="'Custom.Index.AddAccount'" />
|
|
|
+ </view>
|
|
|
+ </button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -16,7 +20,7 @@
|
|
|
<view class="clearfix">
|
|
|
<view class="card">
|
|
|
<view class="card-header">
|
|
|
- <view class="nav nav-underline card-header-tabs" id="myTab" role="tablist">
|
|
|
+ <view class="nav nav-underline card-header-tabs">
|
|
|
<view class="nav-item cwg-cursor" v-for="(tab, index) in tabs" :key="index"
|
|
|
@click="cativeIndex = index">
|
|
|
<view class="nav-link" :class="{ 'active': index === cativeIndex }">{{ tab.text }}
|
|
|
@@ -27,22 +31,24 @@
|
|
|
|
|
|
<view class="card-body">
|
|
|
<view class="tab-content">
|
|
|
- <view class="tab-pane fade show active" id="home" role="tabpanel"
|
|
|
- aria-labelledby="home-tab" tabindex="0">
|
|
|
- <view class="row">
|
|
|
- <AccountCard v-for="acc in accounts" :zhtype="cativeIndex"
|
|
|
- :key="acc.accountNumber" :account="acc" :is-grid-layout="isGridLayout"
|
|
|
- @action="handleAction" @copy="handleCopy"
|
|
|
- @change-password="handleChangePassword" />
|
|
|
- <view class="table-loading-mask">
|
|
|
- <uni-loading v-if="loading" />
|
|
|
- </view>
|
|
|
- <cwg-empty-state v-if="!loading && accounts.length == 0" />
|
|
|
- <DeleteAccountDialogs ref="deleteAccountDialogRef"
|
|
|
- v-model:visible="deleteAccountDialogVisible" />
|
|
|
- <cwg-improve-popup v-model:visible="dialogCheck" @confirm="confirm" />
|
|
|
+ <view class="row mb-4">
|
|
|
+ <view class="col-lg-4 col-md-6"><cwg-combox v-model:value="platformActive"
|
|
|
+ :clearable="false" :options="platformOptions" /></view>
|
|
|
+
|
|
|
+ </view>
|
|
|
|
|
|
+ <view class="row">
|
|
|
+ <AccountCard v-for="acc in accounts" :zhtype="cativeIndex" :key="acc.accountNumber"
|
|
|
+ :account="acc" :is-grid-layout="isGridLayout" @action="handleAction"
|
|
|
+ @copy="handleCopy" @change-password="handleChangePassword" />
|
|
|
+ <view class="table-loading-mask">
|
|
|
+ <uni-loading v-if="loading" />
|
|
|
</view>
|
|
|
+ <cwg-empty-state v-if="!loading && accounts.length == 0" />
|
|
|
+ <DeleteAccountDialogs ref="deleteAccountDialogRef"
|
|
|
+ v-model:visible="deleteAccountDialogVisible" />
|
|
|
+ <cwg-improve-popup v-model:visible="dialogCheck" @confirm="confirm" />
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -77,8 +83,12 @@ const isAfterJuly28 = () => {
|
|
|
const july28 = new Date(2025, 6, 28, 0, 0, 0); // 月份从0开始,所以7月是6
|
|
|
return now >= july28;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+const platformActive = ref('All')
|
|
|
+const platformOptions = computed(() => ([
|
|
|
+ { value: 'All', text: t('State.All') },
|
|
|
+ { value: 'MT4', text: 'MT4' },
|
|
|
+ { value: 'MT5', text: 'MT5' },
|
|
|
+]))
|
|
|
const handleAction = (type) => { /* 处理交易/入金等 */ };
|
|
|
const handleCopy = (text: string) => {
|
|
|
uni.setClipboardData({
|
|
|
@@ -202,10 +212,7 @@ const createAccount = () => {
|
|
|
}
|
|
|
const isZh = computed(() => ['cn', 'zh', 'zhHant'].includes(locale.value));
|
|
|
|
|
|
-watch(cativeIndex, (newVal) => {
|
|
|
- // search.value.platform = tabs.value[newVal].id
|
|
|
- getAccountList()
|
|
|
-})
|
|
|
+
|
|
|
const loading = ref(false)
|
|
|
// 获取客户登录信息
|
|
|
const dialogCheck = ref(false)
|
|
|
@@ -258,8 +265,15 @@ function formatMoney(value) {
|
|
|
}
|
|
|
|
|
|
// 转换数组
|
|
|
-const accounts = computed(() =>
|
|
|
- AccountList.value && AccountList.value.length != 0 ? AccountList.value.map((acc, index) => {
|
|
|
+const accounts = computed(() => {
|
|
|
+ if (!AccountList.value || AccountList.value.length == 0) return []
|
|
|
+ let filteredAccounts = AccountList.value
|
|
|
+ if (platformActive.value !== 'All') {
|
|
|
+ filteredAccounts = filteredAccounts.filter(acc =>
|
|
|
+ (acc.platform || 'MT4') === platformActive.value
|
|
|
+ )
|
|
|
+ }
|
|
|
+ return filteredAccounts.map((acc, index) => {
|
|
|
const currency = acc.currency || 'USD';
|
|
|
const floating = acc.floating ?? 0;
|
|
|
let labels = [t('vu.item1'), 'MT4', 'Standard'];
|
|
|
@@ -282,22 +296,31 @@ const accounts = computed(() =>
|
|
|
accountNumber: acc.login.toString(),
|
|
|
nickname,
|
|
|
fwq,
|
|
|
- balanceWithSymbol: acc.balanceWithSymbol ?? '$0', // 余额
|
|
|
- creditWithSymbol: acc.creditWithSymbol ?? '$0',//信用
|
|
|
- equityWithSymbol: acc.equityWithSymbol ?? '$0',//净值
|
|
|
+ balanceWithSymbol: acc.balanceWithSymbol ?? '$0',
|
|
|
+ creditWithSymbol: acc.creditWithSymbol ?? '$0',
|
|
|
+ equityWithSymbol: acc.equityWithSymbol ?? '$0',
|
|
|
currency,
|
|
|
- actualLeverage: '1:' + (acc.leverage ?? 0), // 实际杠杆
|
|
|
- floatingPL: formatMoney(floating), // 盈亏
|
|
|
+ actualLeverage: '1:' + (acc.leverage ?? 0),
|
|
|
+ floatingPL: formatMoney(floating),
|
|
|
platform: acc.platform || 'MT4',
|
|
|
server: acc.groupCode || '',
|
|
|
login: acc.login.toString(),
|
|
|
listType: cativeIndex.value == 1 ? 'demo' : 'real'
|
|
|
};
|
|
|
- }) : []
|
|
|
-)
|
|
|
+ })
|
|
|
+})
|
|
|
onMounted(async () => {
|
|
|
await getAccountList()
|
|
|
})
|
|
|
+
|
|
|
+watch(cativeIndex, (newVal) => {
|
|
|
+ // search.value.platform = tabs.value[newVal].id
|
|
|
+ getAccountList()
|
|
|
+ platformActive.value = 'All'
|
|
|
+})
|
|
|
+// watch(platformActive, (newVal) => {
|
|
|
+// setAccountList()
|
|
|
+// })
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|