Prechádzať zdrojové kódy

账户列表,和其他页面完善

zhb 2 mesiacov pred
rodič
commit
e481df5df5

+ 1 - 19
components/cwg-match-media.vue

@@ -1,16 +1,7 @@
 <template>
-    <!-- #ifdef H5 -->
-    <view>
-        <match-media v-bind="mediaAttrs">
-            <slot />
-        </match-media>
-    </view>
-    <!-- #endif -->
-    <!-- #ifdef APP-PLUS -->
     <view v-if="shouldShow">
         <slot />
     </view>
-    <!-- #endif -->
 </template>
 
 <script setup lang="ts">
@@ -29,19 +20,11 @@ const props = defineProps({
 
 const shouldShow = ref(true)
 
-const mediaAttrs = computed(() => {
-    const attrs: Record<string, number> = {};
-    if (props.minWidth !== undefined) attrs['min-width'] = props.minWidth;
-    if (props.maxWidth !== undefined) attrs['max-width'] = props.maxWidth;
-    return attrs;
-	
-})
-
 function checkWidth() {
     const width = uni.getSystemInfoSync().windowWidth
     shouldShow.value = (props.minWidth === undefined || width >= props.minWidth) && (props.maxWidth === undefined || width <= props.maxWidth)
 }
-// #ifdef APP-PLUS
+
 checkWidth()
 let resizeListener: any
 onMounted(() => {
@@ -51,7 +34,6 @@ onMounted(() => {
 onUnmounted(() => {
     uni.offWindowResize && uni.offWindowResize(resizeListener)
 })
-// #endif
 </script>
 
 <style lang="scss" scoped>

+ 2 - 3
components/cwg-page-wrapper.vue

@@ -1,7 +1,7 @@
 <template>
   <view :class="['page-wrapper', { dark: isDark }]">
-    <cwg-match-media :max-width="991" v-if="!isLoginPage" class="header-box">
-      <cwg-pc-header @open-right-drawer="openRightDrawer" @open-left-drawer="openLeftDrawer" />
+    <cwg-match-media :max-width="991" v-if="!isLoginPage">
+      <cwg-pc-header @open-right-drawer="openRightDrawer" @open-left-drawer="openLeftDrawer" class="header-box" />
     </cwg-match-media>
     <LanguageDropdown style="width: 0;display: none;" />
     <cwg-progress />
@@ -23,7 +23,6 @@
     </view>
     <cwg-match-media :max-width="991">
       <cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
-
     </cwg-match-media>
     <cwg-right-drawer v-if="!isLoginPage" ref="rightDrawerRef" @navigate="handleDrawerNavigate"
       @logout="handleDrawerLogout" />

+ 11 - 19
pages/customer/components/AccountCard.vue

@@ -221,13 +221,12 @@
 </template>
 
 <script setup lang="ts">
-import { ref, computed, onMounted, nextTick, onBeforeUnmount, watch } from 'vue';
+import { ref, computed, onMounted, nextTick, onBeforeUnmount } from 'vue';
 import useRouter from "@/hooks/useRouter";
 const router = useRouter();
 import { useI18n } from 'vue-i18n';
-const { t, locale } = useI18n();
+const { t } = useI18n();
 import TerminalDialog from './TerminalDialog.vue'
-import TerminalNickNameDialog from './TerminalNickNameDialog.vue'
 import TerminalChangePasswordDialog from './TerminalChangePasswordDialog.vue'
 import TerminalInfoDialog from './TerminalInfoDialog.vue'
 
@@ -265,10 +264,6 @@ const fieldList = ref([
     { label: '账号', key: 'login', copyable: true }
 ])
 const nickName = ref(accountInfo.value.nickName)
-const saveNickName = (newNickName) => {
-    nickName.value = newNickName
-    accountInfo.value.nickName = newNickName
-}
 
 const infoBottomRef = ref(null);
 const infoBottomHeight = ref(0);
@@ -349,22 +344,12 @@ const toDeposit = () => {
 }
 
 const toWithdraw = () => {
-    router.push(`/pages/customer/withdraw?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
+    router.push(`/pages/customer/withdrawal?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
 }
 
 const toTransfer = () => {
     router.push(`/pages/customer/transfer?login=${accountInfo.value.login}&type=${accountInfo.value.type}&balance=${accountInfo.value.balance}&currency=${accountInfo.value.currency}`)
 }
-
-// 更改交易密码
-const handleChangePassword = () => {
-    const close = accountInfo.value.closeFunctions?.indexOf('4') !== -1 ? 1 : 0
-    router.push(`/pages/customer/settings?login=${accountInfo.value.login}&platform=${accountInfo.value.platform}&type=${accountInfo.value.type}&currency=${accountInfo.value.currency}&leverage=${accountInfo.value.leverage}&close=${close}`)
-}
-
-const toStandardRebate = () => {
-    router.push(`/pages/customer/standard/rebate?login=${accountInfo.value.login}`)
-}
 // 格式化余额,拆分为整数和小数部分
 const balanceInteger = computed(() => {
     return Math.floor(accountInfo.value.balance).toString();
@@ -617,6 +602,13 @@ onBeforeUnmount(() => {
         }
     }
 
+    @media screen and (max-width: 768px) {
+        .info-section {
+            flex-direction: column;
+            gap: px2rpx(12);
+        }
+    }
+
     .extra-actions {
         display: flex;
         align-items: center;
@@ -717,4 +709,4 @@ onBeforeUnmount(() => {
         }
     }
 }
-</style>
+</style>

+ 182 - 0
pages/customer/components/TerminalInfoDialog.vue

@@ -0,0 +1,182 @@
+<template>
+    <cwg-popup :title="title" v-model:visible="props.visible" :showFooter="false"
+        @update:visible="$emit('update:visible', $event)">
+        <view class="account-detail-content">
+            <!-- 账户编号独立显示(如果需要,也可以作为 fieldList 中的一项) -->
+            <view v-if="accountNumber" class="account-number-row">
+                <text class="label">{{ accountLabel }}</text>
+                <text class="value">{{ accountNumber }}</text>
+            </view>
+
+            <!-- 动态字段列表 -->
+            <view v-for="(field, index) in fieldList" :key="index" class="field-row">
+
+                <cwg-label-line-value :label="field.label" :value="getFieldValue(field.key)">
+                    <template #operation v-if="field.copyable">
+                        <view class="copy-btn" @click="copyValue(getFieldValue(field.key))">
+                            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"
+                                fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
+                                stroke-linejoin="round">
+                                <path
+                                    d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" />
+                                <path
+                                    d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
+                            </svg>
+                        </view>
+                    </template>
+                </cwg-label-line-value>
+                <!-- <text class="label">{{ field.label }}</text>
+                <view class="value-wrapper">
+                    <text class="value">{{ getFieldValue(field.key) || '--' }}</text>
+                    <view v-if="field.copyable" class="copy-btn" @click="copyValue(getFieldValue(field.key))">
+                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"
+                            stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+                            <path
+                                d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" />
+                            <path
+                                d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
+                        </svg>
+                    </view>
+                </view> -->
+            </view>
+        </view>
+    </cwg-popup>
+</template>
+
+<script setup>
+import { computed } from 'vue'
+
+const props = defineProps({
+    // 是否显示弹窗
+    visible: {
+        type: Boolean,
+        default: false
+    },
+    // 弹窗标题
+    title: {
+        type: String,
+        default: '账户详情'
+    },
+    // 账户编号(若单独展示)
+    accountNumber: {
+        type: String,
+        default: ''
+    },
+    // 账户编号标签
+    accountLabel: {
+        type: String,
+        default: '账户:'
+    },
+    // 表单数据对象
+    form: {
+        type: Object,
+        default: () => ({})
+    },
+    // 字段配置列表,每项包含:
+    // - label: 字段显示名称
+    // - key: 在 form 中对应的键名
+    // - copyable: 是否显示复制按钮,默认 false
+    fieldList: {
+        type: Array,
+        default: () => []
+    }
+})
+
+const emit = defineEmits(['update:visible'])
+
+// 获取字段值
+const getFieldValue = (key) => {
+    return props.form?.[key] ?? ''
+}
+
+// 复制文本到剪贴板
+const copyValue = (text) => {
+    if (!text) {
+        uni.showToast({ title: '无内容可复制', icon: 'none' })
+        return
+    }
+    uni.setClipboardData({
+        data: String(text),
+        success: () => {
+            uni.showToast({ title: '复制成功', icon: 'success' })
+        },
+        fail: () => {
+            uni.showToast({ title: '复制失败', icon: 'none' })
+        }
+    })
+}
+</script>
+
+<style scoped lang="scss">
+@import "@/uni.scss";
+@media (min-width: 768px) {
+    :deep(.cwg-dialog) {
+        background-color: var(--color-white);
+        border-radius: px2rpx(8);
+        width: px2rpx(500) !important;
+    }
+}
+
+.account-number-row,
+.field-row {
+    display: flex;
+    align-items: center;
+    padding: px2rpx(10) 0;
+    width: 100%;
+    font-size: px2rpx(14);
+
+    &:last-child {
+        border-bottom: none;
+    }
+
+    .label {
+        min-width: px2rpx(30);
+        color: #666;
+        font-weight: normal;
+        flex-shrink: 0;
+    }
+
+    .value-wrapper {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+    }
+
+    .value {
+        color: #333;
+        flex: 1;
+    }
+
+    .copy-btn {
+        width: px2rpx(20);
+        height: px2rpx(20);
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin-left: px2rpx(12);
+        cursor: pointer;
+        color: #999;
+        transition: color 0.2s;
+
+        &:active {
+            color: #007aff;
+        }
+
+        svg {
+            width: px2rpx(20);
+            height: px2rpx(20);
+        }
+    }
+}
+
+// 可复制行样式(仅用于视觉区分)
+.copyable-row {
+    .value-wrapper {
+        .value {
+            // 可复制字段的值留出右侧空间
+            margin-right: px2rpx(8);
+        }
+    }
+}
+</style>

+ 1 - 3
pages/customer/payment-history.vue

@@ -1,9 +1,7 @@
 <template>
     <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
+        <cwg-header :title="t('Home.page_customer.item4')" />
         <view class="info-card">
-            <view class="content-title">
-                <view v-t="'Home.page_customer.item4'"></view>
-            </view>
             <view class="search-bar">
                 <cwg-combox v-model:value="search.type" :options="typeMap" :placeholder="t('placeholder.choose')" />
                 <cwg-combox v-model:value="search.orderStatus" :options="orderStatusMap"

+ 1 - 3
pages/customer/recording-history.vue

@@ -1,9 +1,7 @@
 <template>
     <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
+        <cwg-header :title="t('Home.page_customer.item7')" />
         <view class="info-card">
-            <view class="content-title">
-                <view v-t="'Home.page_customer.item7'"></view>
-            </view>
             <view class="search-bar">
                 <cwg-combox v-model:value="search.type" :clearable="false" :options="typeMap"
                     :placeholder="t('Custom.Recording.AccountType')" />

+ 55 - 49
windows/left-window.vue

@@ -25,8 +25,9 @@ import useRouter from "@/hooks/useRouter";
 const router = useRouter();
 import useRoute from '@/hooks/useRoute'
 const route = useRoute()
+import Config from '@/config/index'
 import { useI18n } from "vue-i18n";
-const { t } = useI18n();
+const { t, locale } = useI18n();
 interface MenuItem {
     key: string;
     label: string;
@@ -35,54 +36,59 @@ interface MenuItem {
 }
 const emit = defineEmits(['menu-click']);
 // 菜单数据
-const menu = ref<MenuItem[]>([
-    {
-        isOpenMenu: false, submenuHeight: 0,
-        path: '/pages/customer/index', label: 'Home.msg.Custom', icon: 'crm-house',
-        children: [
-            { path: '/pages/customer/index', label: 'Custom.Index.AccountList', icon: 'icon-client' },
-            { path: '/pages/customer/deposit', label: 'Home.page_customer.item2', icon: 'icon-deposit' },
-            { path: '/pages/customer/withdrawal', label: 'Home.page_customer.item3', icon: 'icon-withdrawal' },
-            { path: '/pages/customer/payment-history', label: 'Home.page_customer.item4', icon: 'icon-payment' },
-            { path: '/pages/customer/transfer', label: 'Home.page_customer.item5', icon: 'icon-transfer' },
-            { path: '/pages/customer/recording-history', label: 'Home.page_customer.item7', icon: 'icon-application' }
-        ]
-    },
-    {
-        isOpenMenu: false,
-        path: '/pages/customer/promotion', label: 'Home.msg.Ib', icon: 'crm-users',
-        children: [
-            { path: '/pages/ib/index', label: 'Home.page_ib.item1', icon: 'icon-client' },
-            { path: '/pages/ib/customer', label: 'Home.page_ib.item2', icon: 'icon-deposit' },
-            { path: '/pages/ib/report', label: 'Home.page_ib.item3', icon: 'icon-withdrawal' },
-            { path: '/pages/ib/transfer', label: 'Home.page_ib.item4', icon: 'icon-payment' },
-            { path: '/pages/ib/withdraw', label: 'Home.page_ib.item5', icon: 'icon-transfer' },
-            { path: '/pages/ib/agent-transfer', label: 'Home.page_ib.item9', icon: 'icon-transfer' },
-            { path: '/pages/ib/recording', label: 'Home.page_ib.item7', icon: 'icon-application' }
-        ]
-    },
-    {
-        path: '/pages/customer/deposit', isOpenMenu: false, label: 'Documentary.title', icon: 'crm-chart-area',
-        children: []
-    },
-    {
-        path: '/pages/customer/withdrawal', isOpenMenu: false, label: 'Downloadpage.item1', icon: 'crm-download',
-        children: []
-    },
-    {
-        path: '/pages/customer/support', isOpenMenu: false, label: 'Downloadpage.item16', icon: 'crm-headset',
-        children: []
-    },
-    {
-        path: '/pages/customer/support', isOpenMenu: false, label: '设置', icon: 'crm-headset',
-        children: [
-            { path: '/pages/mine/info?type=1', isOpenMenu: false, label: 'PersonalManagement.Title.PersonalInformation', icon: 'crm-headset' },
-            { path: '/pages/mine/info?type=2', isOpenMenu: false, label: 'PersonalManagement.Title.BankInformation', icon: 'crm-headset' },
-            { path: '/pages/mine/info?type=3', isOpenMenu: false, label: 'PersonalManagement.Title.FileManagement', icon: 'crm-headset' },
-            { path: '/pages/mine/info?type=4', isOpenMenu: false, label: 'PersonalManagement.Title.SecurityCenter', icon: 'crm-headset' },
-        ]
-    },
-]);
+const menu = ref<MenuItem[]>(
+    [
+        {
+            isOpenMenu: false, submenuHeight: 0,
+            path: '/pages/customer/index', label: 'Home.msg.Custom', icon: 'crm-house',
+            children: [
+                { path: '/pages/customer/index', label: 'Custom.Index.AccountList', icon: 'icon-client' },
+                { path: '/pages/customer/deposit', label: 'Home.page_customer.item2', icon: 'icon-deposit' },
+                { path: '/pages/customer/withdrawal', label: 'Home.page_customer.item3', icon: 'icon-withdrawal' },
+                { path: '/pages/customer/payment-history', label: 'Home.page_customer.item4', icon: 'icon-payment' },
+                { path: '/pages/customer/transfer', label: 'Home.page_customer.item5', icon: 'icon-transfer' },
+                { path: '/pages/customer/recording-history', label: 'Home.page_customer.item7', icon: 'icon-application' }
+            ]
+        },
+        {
+            isOpenMenu: false,
+            path: '/pages/ib/index', label: 'Home.msg.Ib', icon: 'crm-users',
+            children: [
+                { path: '/pages/ib/index', label: 'Home.page_ib.item1', icon: 'icon-client' },
+                { path: '/pages/ib/customer', label: 'Home.page_ib.item2', icon: 'icon-deposit' },
+                { path: '/pages/ib/report', label: 'Home.page_ib.item3', icon: 'icon-withdrawal' },
+                { path: '/pages/ib/transfer', label: 'Home.page_ib.item4', icon: 'icon-payment' },
+                { path: '/pages/ib/withdraw', label: 'Home.page_ib.item5', icon: 'icon-transfer' },
+                { path: '/pages/ib/agent-transfer', label: 'Home.page_ib.item9', icon: 'icon-transfer' },
+                { path: '/pages/ib/recording', label: 'Home.page_ib.item7', icon: 'icon-application' }
+            ]
+        },
+        {
+            path: '/pages/analytics/analystViews', isOpenMenu: false, label: 'News.News', icon: 'crm-chart-area',
+            children: [
+                { path: '/pages/analytics/analystViews', label: 'News.Announcement', icon: 'icon-application' },
+                { path: '/pages/analytics/news', label: 'News.NewsInformation', icon: 'icon-application' },
+                { path: `https://www.${Config.host}.com/${locale.value}/economic-calendar`, label: 'News.FinancialCalendar', icon: 'icon-application', isExternal: true },
+            ]
+        },
+        {
+            path: '/pages/customer/withdrawal', isOpenMenu: false, label: 'Downloadpage.item1', icon: 'crm-download',
+            children: []
+        },
+        {
+            path: '/pages/customer/support', isOpenMenu: false, label: 'Downloadpage.item16', icon: 'crm-headset',
+            children: []
+        },
+        {
+            path: '/pages/customer/support', isOpenMenu: false, label: '设置', icon: 'crm-headset',
+            children: [
+                { path: '/pages/mine/info?type=1', isOpenMenu: false, label: 'PersonalManagement.Title.PersonalInformation', icon: 'crm-headset' },
+                { path: '/pages/mine/info?type=2', isOpenMenu: false, label: 'PersonalManagement.Title.BankInformation', icon: 'crm-headset' },
+                { path: '/pages/mine/info?type=3', isOpenMenu: false, label: 'PersonalManagement.Title.FileManagement', icon: 'crm-headset' },
+                { path: '/pages/mine/info?type=4', isOpenMenu: false, label: 'PersonalManagement.Title.SecurityCenter', icon: 'crm-headset' },
+            ]
+        },
+    ]);
 const submenuRefs = ref<any[]>([]);
 const measureHeight = (element: HTMLElement): number => {
     const originalDisplay = element.style.display;