| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781 |
- <template>
- <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
- <cwg-header :title="t('Documentary.title')" :showBack="false" />
- <uni-loading v-if="loading" />
- <uni-row v-else class="demo-uni-row uni-row1" :gutter="20">
- <uni-col :xs="24" :sm="12" :md="24" :lg="24" :xl="24" class="mb-3">
- <cwg-combox :clearable="false" v-model:value="login"
- :options="loginOptions.map(item => ({
- text: item.platform + ' - ' + item.login + ' - ' + groupTypeName(item.type) + ' - ' + t('Custom.Deposit.AvailableBalance') + groupCurrency(item.currency) + item.balance,
- value: item
- }))" :placeholder="locale === 'es'?'Selecciona':t('placeholder.choose')" @change="handleCommand"/>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="uni-col-left">
- <uni-row :gutter="10">
- <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
- <view class="custom-money">
- <view class="left">
- <view class="tit">
- <text>{{ t('Documentary.console.item5') }}</text>
- </view>
- <view class="num red">
- <text>{{ numberFormat(ChartSetDate.position || '0.00') }}</text>
- </view>
- </view>
- </view>
- </uni-col>
- <!-- <uni-col :xs="24" :sm="12" :md="isDealLogin ? 8 : 12" :lg="isDealLogin ? 4 : 6" :xl="isDealLogin ? 4 : 6">-->
- <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
- <view class="custom-money">
- <view class="left">
- <view class="tit">
- <text>{{ t('Documentary.console.item6') }}</text>
- </view>
- <view class="num">
- <text>{{ numberFormat(ChartSetDate.equity || '0.00') }}</text>
- </view>
- </view>
- <view class="right">
- <view class="tit">
- <text>{{ t('Documentary.console.item9') }}</text>
- </view>
- <view class="num">
- <text>{{ numberFormat(ChartSetDate.equityIncrement || '0.00') }}</text>
- </view>
- </view>
- </view>
- </uni-col>
- <!-- <uni-col :xs="24" :sm="12" :md="isDealLogin ? 8 : 12" :lg="isDealLogin ? 4 : 6" :xl="isDealLogin ? 4 : 6">-->
- <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
- <view class="custom-money">
- <view class="left">
- <view class="tit">
- <text>{{ t('Documentary.console.item7') }}</text>
- </view>
- <view class="num">
- <text>{{ numberFormat(ChartSetDate.balance || '0.00') }}</text>
- </view>
- </view>
- <view class="right">
- <view class="tit">
- <text>{{ t('Documentary.console.item9') }}</text>
- </view>
- <view class="num">
- <text>{{ numberFormat(ChartSetDate.balanceIncrement || '0.00') }}</text>
- </view>
- </view>
- </view>
- </uni-col>
- <!-- <uni-col :xs="24" :sm="12" :md="8" :lg="4" :xl="4" v-if="isDealLogin">-->
- <!-- <view class="custom-money">-->
- <!-- <view class="left">-->
- <!-- <view class="tit">-->
- <!-- <text>{{ t('Documentary.console.item8') }}</text>-->
- <!-- </view>-->
- <!-- <view class="num">-->
- <!-- <text>{{ numberFormat(ChartSetDate.profit || '0.00') }}</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- <view class="right">-->
- <!-- <view class="tit">-->
- <!-- <text>{{ t('Documentary.console.item9') }}</text>-->
- <!-- </view>-->
- <!-- <view class="num">-->
- <!-- <text>{{ numberFormat(ChartSetDate.profitIncrement || '0.00') }}</text>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </view>-->
- <!-- </uni-col>-->
- </uni-row>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="uni-col-right">
- <view class="dashboard-container">
- <view class="account-info1" v-if="isDealLogin">
- <uni-row>
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
- <view class="custom-money custom-money-left">
- <view class="header">
- <view class="tit">
- <text class="tab h3">{{ t('Documentary.console.item23') }}</text>
- </view>
- <view class="num" @click="toDocumentary1">
- <cwg-icon name="crm-sz" :size="18" color="#6c8595" />
- </view>
- </view>
- <view class="bottomCol">
- <uni-row>
- <uni-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6">
- <view class="bo-left1">
- <view>
- <text>{{ t('Documentary.console.item26') }}</text>
- </view>
- <view class="blue-font">
- <text>{{ numberFormat(dealDate.followNum || '0') }}</text>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6">
- <view class="bo-left1">
- <view>
- <text>{{ t('Documentary.console.item9') }}</text>
- </view>
- <view class="blue-font">
- <text>{{ numberFormat(dealDate.followNumIncrement || '0') }}</text>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6">
- <view class="bo-left1">
- <view>
- <text>{{ t('Documentary.console.item29') }}</text>
- </view>
- <view class="blue-font">
- <text>{{ numberFormat(dealDate.position || '0') }}</text>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6">
- <view class="bo-right1">
- <view>
- <text>{{ t('Documentary.console.item30') }}</text>
- </view>
- <view class="blue-font">
- <text>{{ numberFormat(dealDate.closed || '0') }}</text>
- </view>
- </view>
- </uni-col>
- </uni-row>
- </view>
- </view>
- </uni-col>
- </uni-row>
- </view>
- <view class="account-info1" v-else>
- <uni-row>
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
- <view class="custom-money custom-money-right">
- <view class="header">
- <view class="tit">
- <view class="tab h3">{{ t('Documentary.console.item27') }}</view>
- </view>
- <view class="num">
- <view class="btn crm-cursor" @click="dialogFllowApplyOpen">
- +
- <text>{{ t('Documentary.TundManagement.item12') }}</text>
- </view>
- </view>
- </view>
- <view class="bottom">
- <view class="tab">
- <cwg-tabel :data="SubscribeProfitDate" class="crm_tab" :api="listApi" :columns="[
- { label: t('Documentary.console.item32'), prop: 'nickname', align: 'center', slot: 'nickname' },
- { label: t('Documentary.console.item33'), prop: 'nickname2', align: 'center', slot: 'nickname2' },
- { label: t('Documentary.console.item34'), prop: 'startTime', align: 'center', slot: 'startTime' },
- { label: t('Documentary.console.item35'), prop: 'endTime', align: 'center', slot: 'endTime' }
- ]" style="width: 100%" :show-operation="false" :showPagination="false">
- <template #nickname="{ row }">
- <text>{{ row.nickname || '--' }}</text>
- </template>
- <template #nickname2="{ row }">
- <text>{{ row.nickname || '--' }}</text>
- </template>
- <template #startTime="{ row }">
- <text>{{ row.startTime || '--' }}</text>
- </template>
- <template #endTime="{ row }">
- <text>{{ row.endTime || '--' }}</text>
- </template>
- </cwg-tabel>
- </view>
- </view>
- </view>
- </uni-col>
- </uni-row>
- </view>
- </view>
- </uni-col>
- </uni-row>
- <!-- 申请成为信号源弹窗 -->
- <applySignalDialog :visible="isApplySignalVisible" :loginOptions="loginOptions"
- @close="isApplySignalVisible = false" @confirm="onApplySignalConfirm" />
- </cwg-page-wrapper>
- </template>
- <script setup>
- import { ref, computed, watch, onMounted, nextTick } from 'vue'
- import { useI18n } from 'vue-i18n'
- import useRouter from '@/hooks/useRouter'
- import { ibApi } from '@/service/ib'
- import config from '@/config/index'
- import useUserStore from '@/stores/use-user-store'
- import { useStorage } from '@/hooks/useStorage'
- import QrCode from '@/components/QrCode.vue'
- import applySignalDialog from './components/applySignalDialog.vue'
- import { useFilters } from '@/composables/useFilters'
- import { isAfterJuly28 } from '@/utils/dateUtils'
- import { documentaryApi } from '@/service/documentary'
- const { t, locale } = useI18n()
- const loading = ref(false)
- const router = useRouter()
- const { Code } = config
- const { userInfo } = useUserStore()
- const { numberFormat } = useFilters()
- const listApi = ref(documentaryApi.followDailySubscribeProfit)
- const ibData = ref({
- customAmount: 0,
- ibAmount: 0,
- },
- )
- const selectedSpreadId = ref('')
- const spreadList = ref([])
- const excludeShowLoginTypes = ref([])
- const pammManagerValid = ref()
- const dialogPercent = ref(false)
- const dialogPercentData = ref({
- oldPercent: '',
- mamListId: '',
- oldOwnerId: '',
- oldAccountId: '',
- percent: '',
- })
- const getCustomLoginDown = async () => {
- const res = await documentaryApi.followCustomDropdown()
- if (res.code === Code.StatusOK) {
- if (res.data?.length > 0) {
- const options = res.data[0]
- login.value = res.data[0]
- loginOptions.value = res.data
- console.log(res.data)
- isDealLogin.value = options.isDealLogin
- ChartSet.value = {
- login: options.login,
- leverage: '1:' + options.leverage,
- platform: options.platform,
- groupTypeName: options.groupTypeName,
- type: options.type,
- balance: options.balance,
- currency: options.currency || '',
- }
- }
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- const loginOptions = ref([])
- const ChartSet = ref({})
- const ChartSetDate = ref({})
- const isDealLogin = ref(false)
- const dealDate = ref({})
- const SubscribeProfitDate = ref([])
- const login = ref('')
- 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 handleCommand = (value) => {
- const data = { ...value }
- isDealLogin.value = data.isDealLogin
- ChartSet.value = {
- login: data.login,
- leverage: '1:' + data.leverage,
- platform: data.platform,
- groupTypeName: data.groupTypeName,
- type: data.type,
- balance: data.balance,
- currency: data.currency || '',
- }
- }
- const getDailyCompare = async (login) => {
- const res = await documentaryApi.followDailyCompare({ login })
- if (res.code === Code.StatusOK) {
- ChartSetDate.value = res.data ?? {}
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- const getDailyDeal = async (login) => {
- const res = await documentaryApi.followDailyDeal({ login })
- if (res.code === Code.StatusOK) {
- dealDate.value = res.data ?? {}
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- const getDailySubscribeProfit = async (login) => {
- const res = await documentaryApi.followDailySubscribeProfit({ login })
- if (res.code === Code.StatusOK) {
- SubscribeProfitDate.value = res.data?.data ?? []
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- watch(() => ChartSet.value.login, async (login) => {
- await getDailyCompare(login)
- if (isDealLogin.value) {
- await getDailyDeal(login)
- } else {
- await getDailySubscribeProfit(login)
- }
- })
- const toDocumentary1 = () => {
- router.push({ path: '/pages/follow/trading-management' })
- }
- const dialogFllowApplyOpen = () => {
- isApplySignalVisible.value = true
- }
- const isApplySignalVisible = ref(false)
- const onApplySignalConfirm = () => {
- isApplySignalVisible.value = false
- }
- onMounted(async () => {
- loading.value = true
- await getCustomLoginDown()
- loading.value = false
- })
- </script>
- <style lang="scss" scoped>
- @import "@/uni.scss";
- .demo-uni-row {
- display: flex;
- flex-wrap: wrap;
- align-items: stretch;
- margin: 0 auto !important;
- }
- .uni-col-left {
- //display: flex;
- //flex-direction: column;
- }
- .uni-col-right {
- display: flex;
- flex-direction: column;
- }
- .dashboard-container {
- min-height: 10vh;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- height: 100%;
- }
- .mam-card {
- flex: 1;
- display: flex;
- flex-direction: column;
- }
- /* 卡片通用样式 */
- .card {
- background: var(--color-white);
- color: var(--bs-heading-color);
- padding: px2rpx(12) px2rpx(16);
- border-radius: 4px;
- margin-bottom: px2rpx(20);
- box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
- }
- .custom-number,
- .custom-money {
- background: var(--bs-body-bg);
- border: 1px solid var(--bs-border-color);
- padding: 15px;
- border-radius: 4px;
- margin-bottom: 20px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- min-height: px2rpx(125);
- }
- .custom-number .title,
- .custom-money .left .tit,
- .custom-money .right .tit {
- font-size: 14px;
- color: var(--bs-heading-color);
- margin-bottom: 10px;
- }
- .custom-number .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .custom-money {
- display: flex;
- flex-direction: column;
- }
- .custom-money .left,
- .custom-money .right {
- flex: 1;
- }
- .custom-money .num {
- font-size: 20px;
- font-weight: bold;
- color: var(--bs-heading-color);
- }
- .custom-money .num.red {
- color: #eb3f57;
- }
- .el-dropdown-link {
- display: flex;
- align-items: center;
- gap: 4px;
- color: #6c8595;
- font-size: 12px;
- }
- .account-info1 {
- margin-bottom: 20px;
- }
- .custom-money-left .header,
- .custom-money-right .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: px2rpx(15);
- }
- .custom-money-left .tab,
- .custom-money-right .tab {
- font-size: px2rpx(20);
- font-weight: 600;
- color: var(--bs-heading-color);
- }
- .bottomCol {
- font-size: 16px;
- color: #868686;
- .bo-left1 {
- margin: 20px 0;
- padding: 20px 0;
- border-right: 1px dashed #989898;
- text-align: center;
- font-size: 16px;
- }
- .bo-right1 {
- margin: 20px 0px;
- padding: 20px 0;
- text-align: center;
- font-size: 16px;
- }
- }
- .blue-font {
- margin-top: px2rpx(15);
- color: #007aff;
- font-weight: 600;
- font-size: px2rpx(24);
- }
- .subscribe-table {
- width: 100%;
- border: 1px solid #ebeef5;
- border-radius: 6px;
- overflow: hidden;
- }
- .subscribe-row {
- display: grid;
- grid-template-columns: 1fr 1fr 1fr 1fr;
- border-top: 1px solid #ebeef5;
- }
- .subscribe-head {
- background: #f5f7fa;
- border-top: none;
- }
- .subscribe-cell {
- padding: 10px 8px;
- font-size: 12px;
- color: var(--bs-heading-color);
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .custom-dialog-content {
- padding: px2rpx(20);
- .info-text {
- color: var(--bs-heading-color);
- font-size: px2rpx(14);
- line-height: px2rpx(36);
- }
- }
- .card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: px2rpx(12);
- }
- .header-left {
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .header-title {
- font-size: px2rpx(14);
- font-weight: 600;
- }
- .header-right {
- display: flex;
- align-items: center;
- }
- .action-btn {
- background: #ffde02;
- border: none;
- border-radius: 50%;
- width: px2rpx(32);
- height: px2rpx(32);
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0;
- margin: 0;
- &:after {
- border: none;
- }
- }
- /* 余额区域 */
- .balance-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 16rpx;
- }
- .balance-main {
- display: flex;
- align-items: baseline;
- flex-wrap: wrap;
- }
- .balance-amount {
- font-size: px2rpx(20);
- font-weight: 700;
- line-height: 1;
- }
- .balance-decimal {
- font-size: px2rpx(16);
- font-weight: 500;
- line-height: 1;
- }
- .balance-currency {
- font-size: px2rpx(16);
- font-weight: 500;
- }
- .total-earnings {
- display: flex;
- align-items: center;
- gap: 5px;
- color: rgba(20, 29, 34, 0.6);
- font-size: px2rpx(12);
- }
- .total-value {
- align-self: flex-end;
- }
- /* 合作伙伴卡片 */
- .partner-content {
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .link-area {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-around;
- align-items: center;
- gap: 12px;
- }
- .link-btn {
- height: px2rpx(32);
- background-color: rgb(108, 133, 149);
- line-height: px2rpx(32);
- color: var(--color-white);
- border-radius: px2rpx(16);
- font-size: px2rpx(14);
- margin: 0;
- }
- .code-content {
- display: flex;
- justify-content: center;
- }
- .code-input {
- width: 50%;
- max-width: px2rpx(178);
- margin-right: px2rpx(20);
- }
- .custom-content {
- display: flex;
- justify-content: space-around;
- flex-wrap: wrap;
- .con {
- cursor: pointer;
- text-align: center;
- font-size: px2rpx(16);
- margin: 5px;
- }
- .num {
- font-weight: bold;
- }
- .des {
- margin-top: px2rpx(5);
- }
- }
- .dia-content {
- padding: 20rpx;
- }
- .content {
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- }
- .label {
- font-weight: 500;
- margin-bottom: 8rpx;
- }
- .btn {
- text-align: center;
- background-color: rgb(var(--bs-danger-rgb));
- font-size: px2rpx(16);
- color: #fff;
- padding: px2rpx(10) px2rpx(20);
- border-radius: px2rpx(8);
- }
- .crm-cursor {
- cursor: pointer;
- }
- .link {
- display: flex;
- margin-top: 20rpx;
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- height: px2rpx(35);
- margin: 0 px2rpx(10);
- }
- }
- .qrCode {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 16rpx;
- }
- .mam-card {
- .add-mam-btn {
- display: flex;
- background-color: var(--color-error);
- 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>
|