|
@@ -2,7 +2,7 @@
|
|
|
<cwg-page-wrapper class="create-page" :isHeaderFixed="true" :bgColor="'#f8f9f9'">
|
|
<cwg-page-wrapper class="create-page" :isHeaderFixed="true" :bgColor="'#f8f9f9'">
|
|
|
<cwg-header :title="t('Home.page_ib.item1')" />
|
|
<cwg-header :title="t('Home.page_ib.item1')" />
|
|
|
<uni-row class="demo-uni-row uni-row1">
|
|
<uni-row class="demo-uni-row uni-row1">
|
|
|
- <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
|
|
|
|
+ <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
|
|
|
<view class="dashboard-container">
|
|
<view class="dashboard-container">
|
|
|
<!-- 余额卡片 -->
|
|
<!-- 余额卡片 -->
|
|
|
<view class="card balance-card">
|
|
<view class="card balance-card">
|
|
@@ -102,6 +102,92 @@
|
|
|
</view>-->
|
|
</view>-->
|
|
|
</view>
|
|
</view>
|
|
|
</uni-col>
|
|
</uni-col>
|
|
|
|
|
+ <uni-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
|
|
|
|
|
+ <view class="dashboard-container">
|
|
|
|
|
+ <view class="card mam-card">
|
|
|
|
|
+ <view class="card-header">
|
|
|
|
|
+ <view class="header-left">
|
|
|
|
|
+ <text class="header-title">{{ t('Ib.Index.MAMList') }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="header-right" v-if="showAddMamAccount">
|
|
|
|
|
+ <cwg-dropdown :menu-list="addMamAccountMenus" @menuClick="handleAddMamAccountMenuClick">
|
|
|
|
|
+ <button type="primary" class="add-mam-btn">
|
|
|
|
|
+ <cwg-icon name="icon_add" :size="18" color="#fff" />
|
|
|
|
|
+ <text class="btn-text">{{ t('Custom.Index.AddAccount') }}</text>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </cwg-dropdown>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <cwg-tabel
|
|
|
|
|
+ ref="mamTableRef"
|
|
|
|
|
+ :columns="mamColumns"
|
|
|
|
|
+ :mobilePrimaryFields="mamMobilePrimaryFields"
|
|
|
|
|
+ :queryParams="mamSearch"
|
|
|
|
|
+ :api="mamListApi"
|
|
|
|
|
+ :show-operation="false"
|
|
|
|
|
+ :showPagination="true"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #mamAccount="{ row }">
|
|
|
|
|
+ <view v-if="row.type == 1 || row.type == 2">
|
|
|
|
|
+ <text>{{ row.login || '-' }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else-if="row.type == 3">
|
|
|
|
|
+ <view class="mam-line">
|
|
|
|
|
+ <text>{{ t('Ib.PammManager.ownerId') }}:</text>
|
|
|
|
|
+ <text>{{ row.ownerId || '--' }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="mam-line">
|
|
|
|
|
+ <text>{{ t('Ib.PammManager.accountId') }}:</text>
|
|
|
|
|
+ <text>{{ row.accountId || '--' }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="mam-line">
|
|
|
|
|
+ <text>{{ t('Ib.PammManager.percent') }}:</text>
|
|
|
|
|
+ <text>{{ (row.percent ?? '--') + '%' }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #mamType="{ row }">
|
|
|
|
|
+ <text>{{ formatMamType(row.type) }}</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #loginType="{ row }">
|
|
|
|
|
+ <text>{{ formatAccountType(row.accountType) }}</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #leverage="{ row }">
|
|
|
|
|
+ <text>{{ row.leverage ? '1:' + row.leverage : '-' }}</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #balance="{ row }">
|
|
|
|
|
+ <text>{{ numberFormat(row.balance || 0) }}</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #equity="{ row }">
|
|
|
|
|
+ <text>{{ numberFormat(row.equity || 0) }}</text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #operation="{ row }">
|
|
|
|
|
+ <view class="mam-ops">
|
|
|
|
|
+ <view v-if="row.type == 1 || row.type == 2" class="mam-op" @click.stop="toSettings(row)">
|
|
|
|
|
+ <text>{{ t('Ib.Index.Settings') }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="row.type == 3" class="mam-op" @click.stop="toSettings(row)">
|
|
|
|
|
+ <text>{{ t('Ib.PammManager.btn1') }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="row.type == 3" class="mam-op" @click.stop="toDialogPercent(row)">
|
|
|
|
|
+ <text>{{ t('Ib.PammManager.percent') }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="mam-op" @click.stop="toDialogSubs(row)">
|
|
|
|
|
+ <text>{{ t('blockchain.item1') }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </cwg-tabel>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </uni-col>
|
|
|
</uni-row>
|
|
</uni-row>
|
|
|
|
|
|
|
|
<!-- 二维码弹窗 -->
|
|
<!-- 二维码弹窗 -->
|
|
@@ -277,6 +363,34 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</cwg-popup>
|
|
</cwg-popup>
|
|
|
|
|
+ <!-- 调整收益分成弹窗 -->
|
|
|
|
|
+ <cwg-popup
|
|
|
|
|
+ :visible="dialogPercent"
|
|
|
|
|
+ :title="t('Ib.PammManager.percent')"
|
|
|
|
|
+ @close="closeDialogPercent"
|
|
|
|
|
+ @confirm="applyPercent"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view class="dia-content custom-dialog-content">
|
|
|
|
|
+ <uni-forms :model="dialogPercentData" label-width="150" label-position="left">
|
|
|
|
|
+ <uni-forms-item :label="t('Ib.PammManager.ownerId') + ':'">
|
|
|
|
|
+ <text class="info-text">{{ dialogPercentData.oldOwnerId || "--" }}</text>
|
|
|
|
|
+ </uni-forms-item>
|
|
|
|
|
+ <uni-forms-item :label="t('Ib.PammManager.accountId') + ':'">
|
|
|
|
|
+ <text class="info-text">{{ dialogPercentData.oldAccountId || "--" }}</text>
|
|
|
|
|
+ </uni-forms-item>
|
|
|
|
|
+ <uni-forms-item :label="t('Ib.PammManager.percent') + ':'">
|
|
|
|
|
+ <text class="info-text">{{ dialogPercentData.oldPercent }}%</text>
|
|
|
|
|
+ </uni-forms-item>
|
|
|
|
|
+ <uni-forms-item :label="t('Ib.PammManager.percentNew') + ':'" name="percent" required>
|
|
|
|
|
+ <uni-easyinput
|
|
|
|
|
+ v-model="dialogPercentData.percent"
|
|
|
|
|
+ :placeholder="t('placeholder.input')"
|
|
|
|
|
+ />
|
|
|
|
|
+ </uni-forms-item>
|
|
|
|
|
+ </uni-forms>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </cwg-popup>
|
|
|
|
|
+
|
|
|
</cwg-page-wrapper>
|
|
</cwg-page-wrapper>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -290,6 +404,7 @@
|
|
|
import { useStorage } from '@/hooks/useStorage'
|
|
import { useStorage } from '@/hooks/useStorage'
|
|
|
import QrCode from '@/components/QrCode.vue'
|
|
import QrCode from '@/components/QrCode.vue'
|
|
|
import { useFilters } from '@/composables/useFilters'
|
|
import { useFilters } from '@/composables/useFilters'
|
|
|
|
|
+ import { isAfterJuly28 } from '@/utils/dateUtils'
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -311,6 +426,15 @@
|
|
|
const spreadList = ref([])
|
|
const spreadList = ref([])
|
|
|
const excludeShowLoginTypes = ref([])
|
|
const excludeShowLoginTypes = ref([])
|
|
|
const pammManagerValid = ref()
|
|
const pammManagerValid = ref()
|
|
|
|
|
+ const dialogPercent = ref(false)
|
|
|
|
|
+ const dialogPercentData = ref({
|
|
|
|
|
+ oldPercent: '',
|
|
|
|
|
+ mamListId: '',
|
|
|
|
|
+ oldOwnerId: '',
|
|
|
|
|
+ oldAccountId: '',
|
|
|
|
|
+ percent: ''
|
|
|
|
|
+ })
|
|
|
|
|
+ const isActionLoading = ref(false)
|
|
|
const menuList = ref([
|
|
const menuList = ref([
|
|
|
{ label: t('Custom.Index.Withdrawals'), type: 1 },
|
|
{ label: t('Custom.Index.Withdrawals'), type: 1 },
|
|
|
{ label: t('Custom.Index.Transfer'), type: 2 },
|
|
{ label: t('Custom.Index.Transfer'), type: 2 },
|
|
@@ -663,6 +787,149 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const mamTableRef = ref(null)
|
|
|
|
|
+ const mamSearch = ref({})
|
|
|
|
|
+ const mamListApi = (params) => ibApi.MamList(params)
|
|
|
|
|
+
|
|
|
|
|
+ const showAddMamAccount = computed(() => {
|
|
|
|
|
+ return !!(
|
|
|
|
|
+ pammManagerValid.value?.mamValid ||
|
|
|
|
|
+ pammManagerValid.value?.pammValid ||
|
|
|
|
|
+ pammManagerValid.value?.pammManagerValid
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ const addMamAccountMenus = computed(() => {
|
|
|
|
|
+ const list = []
|
|
|
|
|
+ if (pammManagerValid.value?.mamValid) list.push({ label: 'MAM', type: 1 })
|
|
|
|
|
+ if (pammManagerValid.value?.pammValid) list.push({ label: 'Money Manager', type: 2 })
|
|
|
|
|
+ if (pammManagerValid.value?.pammManagerValid) list.push({ label: t('Ib.PammManager.title'), type: 3 })
|
|
|
|
|
+ return list
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ const handleAddMamAccountMenuClick = ({ value }) => {
|
|
|
|
|
+ toNewAccount(value.type)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const formatMamType = (type) => {
|
|
|
|
|
+ if (type == 1) return 'MAM'
|
|
|
|
|
+ if (type == 2) return 'Money Manager'
|
|
|
|
|
+ if (type == 3) return t('Ib.PammManager.title1')
|
|
|
|
|
+ return '--'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const formatAccountType = (accountType) => {
|
|
|
|
|
+ if (accountType == 1) return t('AccountType.ClassicAccount')
|
|
|
|
|
+ if (accountType == 2) return t('AccountType.SeniorAccount')
|
|
|
|
|
+ if (accountType == 3 && !isAfterJuly28()) return t('AccountType.AgencyAccount')
|
|
|
|
|
+ if (accountType == 5) return t('AccountType.SpeedAccount')
|
|
|
|
|
+ if (accountType == 6) return t('AccountType.SpeedAccount')
|
|
|
|
|
+ if (accountType == 7) return t('AccountType.StandardAccount')
|
|
|
|
|
+ if (accountType == 8) return t('AccountType.CentAccount')
|
|
|
|
|
+ return '--'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const mamColumns = computed(() => [
|
|
|
|
|
+ { prop: 'mamAccount', label: t('Ib.Index.MAMAccount'), align: 'center', slot: 'mamAccount' },
|
|
|
|
|
+ { prop: 'type', label: t('Label.Type'), align: 'center', slot: 'mamType' },
|
|
|
|
|
+ { prop: 'accountType', label: t('Ib.Index.LoginType'), align: 'center', slot: 'loginType' },
|
|
|
|
|
+ { prop: 'platform', label: t('Ib.Index.Platform'), align: 'center' },
|
|
|
|
|
+ { prop: 'currency', label: t('Ib.Index.Currency'), align: 'center' },
|
|
|
|
|
+ { prop: 'leverage', label: t('Ib.Index.Leverage'), align: 'center', slot: 'leverage' },
|
|
|
|
|
+ { prop: 'balance', label: t('Ib.Index.Balance'), align: 'center', slot: 'balance' },
|
|
|
|
|
+ { prop: 'equity', label: t('Ib.Index.Equity'), align: 'center', slot: 'equity' },
|
|
|
|
|
+ { prop: 'commission', label: t('Ib.Index.Commission'), align: 'center' },
|
|
|
|
|
+ { prop: 'operation', label: t('Ib.Index.Operation'), align: 'center', slot: 'operation' },
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
|
|
+ const mamMobilePrimaryFields = computed(() => [
|
|
|
|
|
+ { prop: 'mamAccount', label: t('Ib.Index.MAMAccount'), align: 'center', slot: 'mamAccount' },
|
|
|
|
|
+ { prop: 'type', label: t('Label.Type'), align: 'center', slot: 'mamType' },
|
|
|
|
|
+ { prop: 'platform', label: t('Ib.Index.Platform'), align: 'center' },
|
|
|
|
|
+ { prop: 'more', type: 'more', width: 20, align: 'right' },
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
|
|
+ const toNewAccount = (type) => {
|
|
|
|
|
+ if (type == 3) {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/pages/ib/openPammManager',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ type: type,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/pages/ib/openAccount',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ type: type,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const toSettings = (row) => {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/pages/ib/settingPammManager',
|
|
|
|
|
+ query: { login: row.accountId, id: row.id },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const toDialogPercent = (row) => {
|
|
|
|
|
+ dialogPercentData.value.oldPercent = row.percent
|
|
|
|
|
+ dialogPercentData.value.mamListId = row.id
|
|
|
|
|
+ dialogPercentData.value.oldOwnerId = row.ownerId
|
|
|
|
|
+ dialogPercentData.value.oldAccountId = row.accountId
|
|
|
|
|
+ dialogPercentData.value.percent = ''
|
|
|
|
|
+ dialogPercent.value = true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const closeDialogPercent = () => {
|
|
|
|
|
+ dialogPercent.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const applyPercent = async () => {
|
|
|
|
|
+ if (isActionLoading.value) return
|
|
|
|
|
+
|
|
|
|
|
+ if (!dialogPercentData.value.percent) {
|
|
|
|
|
+ uni.showToast({ title: t('placeholder.input'), icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ isActionLoading.value = true
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await ibApi.applyPercent({
|
|
|
|
|
+ mamListId: dialogPercentData.value.mamListId,
|
|
|
|
|
+ percent: dialogPercentData.value.percent,
|
|
|
|
|
+ })
|
|
|
|
|
+ if (res.code === Code.StatusOK) {
|
|
|
|
|
+ uni.showToast({ title: res.msg, icon: 'success' })
|
|
|
|
|
+ dialogPercent.value = false
|
|
|
|
|
+ // Refresh MAM list
|
|
|
|
|
+ mamTableRef.value?.refreshTable()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({ title: res.msg, icon: 'none' })
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ uni.showToast({ title: t('Msg.Fail'), icon: 'none' })
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ isActionLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const toDialogSubs = (row) => {
|
|
|
|
|
+ if (row?.type == 3) {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/pages/ib/transfer',
|
|
|
|
|
+ query: { tab: 'pammSubs', id: row.id },
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/pages/ib/transfer',
|
|
|
|
|
+ query: { tab: 'mamSubs', id: row.id },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
// 初始化数据
|
|
// 初始化数据
|
|
|
getIbData()
|
|
getIbData()
|
|
@@ -675,7 +942,7 @@
|
|
|
@import "@/uni.scss";
|
|
@import "@/uni.scss";
|
|
|
|
|
|
|
|
.dashboard-container {
|
|
.dashboard-container {
|
|
|
- min-height: 100vh;
|
|
|
|
|
|
|
+ min-height: 10vh;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -689,6 +956,15 @@
|
|
|
box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
|
|
box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .custom-dialog-content {
|
|
|
|
|
+ padding: px2rpx(20);
|
|
|
|
|
+
|
|
|
|
|
+ .info-text {
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ font-size: px2rpx(14);
|
|
|
|
|
+ line-height: px2rpx(36);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.card-header {
|
|
.card-header {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
@@ -871,4 +1147,36 @@
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
gap: 16rpx;
|
|
gap: 16rpx;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .mam-card {
|
|
|
|
|
+ .add-mam-btn {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 8rpx;
|
|
|
|
|
+ height: px2rpx(32);
|
|
|
|
|
+ line-height: px2rpx(32);
|
|
|
|
|
+ padding: 0 px2rpx(12);
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .mam-line {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ gap: 6rpx;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .mam-ops {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ gap: 10rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .mam-op {
|
|
|
|
|
+ color: #2b5aed;
|
|
|
|
|
+ font-size: px2rpx(12);
|
|
|
|
|
+ line-height: 1.4;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|