ljc 3 дней назад
Родитель
Сommit
0444c4d888

+ 3 - 0
components/cwg-download.vue

@@ -2,6 +2,7 @@
   <view class="cwg-language cursor-pointer" :data-tooltip="t('Downloadpage.item1')">
     <view class="pc-header-btn" @click="handleMenuClick">
       <cwg-icon name="crm-download" color="#97A1C0" :size="20" />
+      <view>{{t('Downloadpage.item1')}}</view>
     </view>
   </view>
 
@@ -21,10 +22,12 @@ function handleMenuClick() {
 @import "@/uni.scss";
 
 .pc-header-btn {
+  width: auto;
   display: flex;
   align-items: center;
   cursor: pointer;
   gap: px2rpx(6);
+  padding: 0 px2rpx(5);
 }
 
 .cwg-language {

+ 2 - 2
components/cwg-dropdown.vue

@@ -189,7 +189,7 @@ defineExpose({
 
 .cwg-dropdown-menu {
     position: relative;
-    z-index: 1000;
+    z-index: 999;
 }
 
 .cwg-dropdown-mask {
@@ -198,7 +198,7 @@ defineExpose({
     left: 0;
     width: 100vw;
     height: 100vh;
-    z-index: 999;
+    z-index: 998;
     transition: all 0.3s;
     opacity: 0;
     pointer-events: none;

+ 7 - 0
components/cwg-language.vue

@@ -3,6 +3,7 @@
     <cwg-dropdown :menu-list="customMenuList" @menuClick="handleMenuClick" showActive :activeKey="lang">
       <view class="pc-header-btn cursor-pointer" :data-tooltip="t('vu.tooltip.t101')">
         <cwg-icon name="cwg-lang" :color="iconColor " :size="20" />
+        <text class="lang-text">{{ t(`language.${lang}`) }}</text>
       </view>
     </cwg-dropdown>
   </view>
@@ -55,12 +56,18 @@ function getFlagSrc(code: string) {
 @import "@/uni.scss";
 
 .pc-header-btn {
+  width: auto;
   display: flex;
   align-items: center;
   cursor: pointer;
   gap: px2rpx(6);
+  padding: 0 px2rpx(5);
 }
 .cwg-language {
+  :deep(.cwg-dropdown-menu-container) {
+    left: px2rpx(-40) !important;
+    right: px2rpx(0) !important;
+  }
   @media screen and (max-width: 991px) {
     :deep(.cwg-dropdown-menu-container) {
       right: px2rpx(-20) !important;

+ 70 - 0
components/cwg-logout.vue

@@ -0,0 +1,70 @@
+<template>
+  <view class="cursor-pointer" :data-tooltip="t('mine.logout')">
+    <view class="pc-btn" @click="handleLogout">
+      <view>{{t('vu.Btn.Logout')}}</view>
+    </view>
+  </view>
+  <cwg-global-popup/>
+</template>
+
+<script setup lang="ts">
+import { useI18n } from 'vue-i18n'
+import { userApi } from '@/api/user'
+import useUserStore from '@/stores/use-user-store'
+import useRouter from "@/hooks/useRouter"
+import { usePopup } from '@/hooks/usePopup'
+
+const router = useRouter()
+const userStore = useUserStore()
+const { confirm } = usePopup()
+const { t } = useI18n()
+
+async function handleLogout() {
+  const res = await confirm({
+    title: t('Msg.SystemPrompt'),
+    content: t('mine.p'),
+    showCancel: t('mine.b2'),
+    confirmText: t('mine.b1'),
+  })
+  if (!res) return
+  try {
+    await userApi.logout()
+  } catch (e) { }
+  userStore.clearUserInfo()
+  uni.setStorageSync('logoutToSystem', 1)
+  // uni.$emit('updateSystemList')
+  router.push('/pages/login/index')
+}
+</script>
+
+<style scoped lang="scss">
+@import "@/uni.scss";
+
+.pc-btn {
+  width: auto;
+  height: px2rpx(28);
+  border-radius: px2rpx(4);
+  padding: 0 px2rpx(10);
+  border: 1px solid #EE1C25;
+  background: #FFF5F5;
+  display: flex;
+  align-items: center;
+  font-size: px2rpx(14);
+  margin-left: px2rpx(20);
+  &:hover {
+    color: #ffffff;
+    background: #EE1C25;
+    border-color: #EE1C25;
+  }
+}
+
+
+
+:deep(.cwg-dropdown-menu-container .menu .menu-item) {
+  min-height: px2rpx(36);
+}
+
+:deep(.cwg-dropdown) {
+  overflow: visible !important;
+}
+</style>

+ 12 - 2
components/cwg-notice.vue

@@ -3,8 +3,9 @@
         <cwg-dropdown ref="dropdownRef" :menu-list="[]">
             <view class="pc-header-btn cursor-pointer" :data-tooltip="t('News.Notice')" :class="{ '!has-dot': isRed }">
                 <text v-if="isRed"
-                    class="position-absolute top-0 end-0 p-1 mt-1 me-1 bg-danger border border-3 border-light rounded-circle" />
+                    class="position-absolute top-0 left-15 p-1 mt-1 me-1 bg-danger border border-3 border-light rounded-circle" />
                 <cwg-icon name="cwg-bell" color="#97A1C0" :size="20" @click="openNotice" />
+                <view class="ml-5">{{ t('News.Notice') }}</view>
             </view>
             <template #btn>
                 <view class="dropdown-menu dropdown-menu-lg-end p-0 w-300px mt-2 show">
@@ -123,7 +124,7 @@ onUnmounted(() => {
 
 .notice-container {
     :deep(.cwg-dropdown-menu-container) {
-        left: px2rpx(-260) !important;
+        left: px2rpx(-200) !important;
         right: px2rpx(0) !important;
 
         .menu {
@@ -154,7 +155,16 @@ onUnmounted(() => {
     }
 
     .pc-header-btn {
+      width: auto;
+      padding: 0 px2rpx(5);
         position: relative;
+      .left-15{
+        left: 15px !important;
+      }
+
+      .ml-5{
+        margin-left: px2rpx(5);
+      }
 
 
         &.has-dot::after {

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

@@ -1,6 +1,6 @@
 <template>
   <view :class="['page-wrapper bg-body', { dark: isDark }]">
-    <cwg-match-media :max-width="991" v-if="!isLoginPage">
+    <cwg-match-media :max-width="990" v-if="!isLoginPage">
       <cwg-pc-header @open-right-drawer="openRightDrawer" @open-left-drawer="openLeftDrawer"
         :sidebarVisible="sidebarVisible" v-if="type != 'webview'" />
       <view class="sidebar-mask mask-visible" v-if="sidebarVisible" @click="openLeftDrawer">
@@ -12,7 +12,7 @@
     <cwg-progress />
 
     <view class="page-content" :style="{ backgroundColor: bgColor }">
-      <cwg-match-media :max-width="991" v-if="!isLoginPage">
+      <cwg-match-media :max-width="990" v-if="!isLoginPage">
         <view class="left-sidebar" :class="{ 'sidebar-visible': sidebarVisible }">
           <cwg-sidebar @handle-click="openLeftDrawer" />
         </view>

+ 2 - 2
components/cwg-payment.vue

@@ -276,7 +276,7 @@ onUnmounted(() => {
     display: flex;
     align-items: center;
     justify-content: center;
-    padding: 0 px2rpx(12);
+    padding: 0 px2rpx(8);
 
 
     &.has-dot::after {
@@ -293,7 +293,7 @@ onUnmounted(() => {
 
   .pc-payment-btn {
     border-radius: px2rpx(4);
-    padding: px2rpx(4) px2rpx(12);
+    padding: px2rpx(4) px2rpx(8);
     height: px2rpx(36);
     cursor: pointer;
 

+ 32 - 12
components/cwg-right-drawer.vue

@@ -3,6 +3,7 @@
         <cwg-dropdown ref="dropdownRef" :menu-list="[]">
             <view class="pc-header-btn cursor-pointer" :data-tooltip="t('vu.tooltip.t100')">
                 <cwg-icon name="icon_my" color="#97A1C0" @click="openNotice" />
+              <view>{{ name }}</view>
             </view>
             <template #btn>
                 <view class="dropdown-menu dropdown-menu-end w-225px mt-1 show">
@@ -27,20 +28,21 @@
                             <text v-t="item.name"></text>
                         </view>
                     </view>
-                    <view>
-                        <view class="dropdown-divider my-1"></view>
-                    </view>
-                    <view>
-                        <view class="dropdown-item d-flex align-items-center gap-2 text-danger cursor-pointer"
-                            @click="handleLogout">
-                            <cwg-icon name="logout" :size="16" color="#FF401C" />
-                            <text v-t="'language.i6'"></text>
-                        </view>
-                    </view>
+<!--                    <view>-->
+<!--                        <view class="dropdown-divider my-1"></view>-->
+<!--                    </view>-->
+<!--                    <view>-->
+<!--                        <view class="dropdown-item d-flex align-items-center gap-2 text-danger cursor-pointer"-->
+<!--                            @click="handleLogout">-->
+<!--                            <cwg-icon name="logout" :size="16" color="#FF401C" />-->
+<!--                            <text v-t="'language.i6'"></text>-->
+<!--                        </view>-->
+<!--                    </view>-->
                 </view>
             </template>
         </cwg-dropdown>
     </view>
+  <cwg-global-popup/>
 </template>
 
 <script setup lang="ts">
@@ -52,11 +54,13 @@ import { userApi } from '@/api/user'
 import { useI18n } from "vue-i18n"
 import useRouter from "@/hooks/useRouter"
 import useGlobalStore from '@/stores/use-global-store'
+import { usePopup } from '@/hooks/usePopup'
 const globalStore = useGlobalStore()
 const isDark = computed(() => globalStore.theme === 'dark')
 
 const { t } = useI18n()
 const router = useRouter()
+const { confirm } = usePopup()
 const dropdownRef = ref(null)
 const userStore = useUserStore()
 const route = useRoute()
@@ -67,6 +71,13 @@ const _displayName = ref('--')
 const _displayCid = ref('--')
 const _activePath = ref('')
 const _email = ref('--')
+
+const name = computed(() => {
+  const info = userStore.userInfo?.customInfo || {}
+  const firstName = info.firstName || ''
+  const lastName = info.lastName || ''
+  return (firstName + ' ' + lastName).trim() || info.name
+})
 // 复制文本
 const copy = (text: string) => {
     uni.setClipboardData({
@@ -144,6 +155,13 @@ function handleNavigate(path) {
 
 // 登出
 async function handleLogout() {
+  const res = await confirm({
+    title: t('Msg.SystemPrompt'),
+    content: t('mine.p'),
+    showCancel: t('mine.b2'),
+    confirmText: t('mine.b1'),
+  })
+  if (!res) return
     try {
         await userApi.logout()
     } catch (e) { }
@@ -170,7 +188,7 @@ defineExpose({ openNotice, close })
         text-overflow: unset !important;
     }
     :deep(.cwg-dropdown-menu-container) {
-        left: px2rpx(-190) !important;
+        left: px2rpx(-150) !important;
         right: px2rpx(0) !important;
 
         .menu {
@@ -181,12 +199,14 @@ defineExpose({ openNotice, close })
 
     @media screen and (max-width: 991px) {
         :deep(.cwg-dropdown-menu-container) {
-            left: px2rpx(-190) !important;
+            left: px2rpx(-150) !important;
             max-width: px2rpx(400);
         }
     }
 
     .pc-header-btn {
+      width: auto;
+      padding: 0 px2rpx(5);
         position: relative;
     }
 

+ 2 - 1
locale/ar.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "المزيد",
-      "Hide": "إخفاء"
+      "Hide": "إخفاء",
+      "Logout": "تسجيل الخروج"
     },
     "system": {
       "title1": "تبديل النظام",

+ 2 - 2
locale/cn.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "更多",
-      "Hide": "隐藏"
+      "Hide": "隐藏",
+      "Logout": "退出"
     },
     "system": {
       "title1": "系统切换",
@@ -90,7 +91,6 @@
       "t18": "复制开户链接",
       "t19": "查看二维码",
       "t20": "复制推荐码"
-
     }
   },
   "common": {

+ 2 - 1
locale/de.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Mehr",
-      "Hide": "Ausblenden"
+      "Hide": "Ausblenden",
+      "Logout": "Abmelden"
     },
     "system": {
       "title1": "Systemwechsel",

+ 2 - 1
locale/en.json

@@ -58,7 +58,8 @@
     },
     "Btn": {
       "More": "More",
-      "Hide": "Hide"
+      "Hide": "Hide",
+      "Logout": "Logout"
     },
     "system": {
       "title1": "System Switch",

+ 2 - 1
locale/es.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Más",
-      "Hide": "Ocultar"
+      "Hide": "Ocultar",
+      "Logout": "Cerrar sesión"
     },
     "system": {
       "title1": "Cambio de Sistema",

+ 2 - 1
locale/fa.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "بیشتر",
-      "Hide": "مخفی کردن"
+      "Hide": "مخفی کردن",
+      "Logout": "خروج"
     },
     "system": {
       "title1": "تغییر سیستم",

+ 2 - 1
locale/id.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Lainnya",
-      "Hide": "Sembunyikan"
+      "Hide": "Sembunyikan",
+      "Logout": "Keluar"
     },
     "system": {
       "title1": "Beralih Sistem",

+ 2 - 1
locale/ko.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "더 보기",
-      "Hide": "숨기기"
+      "Hide": "숨기기",
+      "Logout": "로그아웃"
     },
     "system": {
       "title1": "시스템 전환",

+ 2 - 1
locale/ms.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Lain-lain",
-      "Hide": "Sembunyikan"
+      "Hide": "Sembunyikan",
+      "Logout": "Keluar"
     },
     "system": {
       "title1": "Tukar Sistem",

+ 2 - 1
locale/pt.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Mais",
-      "Hide": "Ocultar"
+      "Hide": "Ocultar",
+      "Logout": "Sair"
     },
     "system": {
       "title1": "Troca de Sistema",

+ 2 - 1
locale/th.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "เพิ่มเติม",
-      "Hide": "ซ่อน"
+      "Hide": "ซ่อน",
+      "Logout": "ออกจากระบบ"
     },
     "system": {
       "title1": "เปลี่ยนระบบ",

+ 2 - 1
locale/tr.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Daha Fazla",
-      "Hide": "Gizle"
+      "Hide": "Gizle",
+      "Logout": "Çıkış"
     },
     "system": {
       "title1": "Sistem Değişimi",

+ 2 - 1
locale/ug.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "تېخىمۇ كۆپ",
-      "Hide": "يوشۇر"
+      "Hide": "يوشۇر",
+      "Logout": "چىقىش"
     },
     "system": {
       "title1": "سىستېما ئالماشتۇر",

+ 2 - 1
locale/vn.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "Thêm",
-      "Hide": "Ẩn"
+      "Hide": "Ẩn",
+      "Logout": "Đăng xuất"
     },
     "system": {
       "title1": "Chuyển Hệ thống",

+ 2 - 1
locale/zhHant.json

@@ -57,7 +57,8 @@
     },
     "Btn": {
       "More": "更多",
-      "Hide": "隱藏"
+      "Hide": "隱藏",
+      "Logout": "登出"
     },
     "system": {
       "title1": "系統切換",

+ 1 - 1
pages/customer/dashboard.vue

@@ -165,7 +165,7 @@
               <cwg-combox :clearable="false" v-model:value="loginValue"
                           :options="loginComboxOptions" :placeholder="t('placeholder.choose')" @change="setCurData"/>
             </view>
-            <view>
+            <view v-if="curData">
               <AccountCard :key="curData?.accountNumber"
                            :account="curData" noCtrl  />
             </view>

+ 3 - 3
pages/customer/deposit-select.vue

@@ -944,9 +944,9 @@ const country = computed(() => {
     return userInfo.value.customInfo.country
 })
 const userName = computed(() => {
-    let first = userInfo.value.customInfo.firstName
-    let last = userInfo.value.customInfo.lastName
-    let middle = userInfo.value.customInfo.middle
+    let first = userInfo.value?.customInfo?.firstName
+    let last = userInfo.value?.customInfo?.lastName
+    let middle = userInfo.value?.customInfo?.middle
     if (!first && !last && !middle) return false
     return (first ? first + " " : "") + (middle ? middle + " " : "") + (last ? last : "")
 })

+ 0 - 2
static/scss/global/global.scss

@@ -1766,9 +1766,7 @@ uni-content.collapsed {
     align-items: center;
     font-size: px2rpx(14);
     cursor: pointer;
-    display: flex;
     justify-content: center;
-    align-items: center;
 
     &:hover {
         background: rgba(108, 133, 149, 0.12);

+ 5 - 2
windows/top-window.vue

@@ -8,12 +8,13 @@
       <div class="cid cursor-pointer" v-if="visible"  @click="copy(cId)" :data-tooltip="`${t('vu.tooltip.t2')}-${cId}`">{{t('newSignin.item1')}} {{name?(name + ' - '):''}}{{ cId}}</div>
     </div>
     <div class="right" v-if="visible">
-      <cwg-download />
       <cwg-payment />
+      <cwg-download />
       <cwg-system event-source="top"/>
       <cwg-language />
       <cwg-notice />
       <cwg-right-drawer />
+      <cwg-logout />
     </div>
   </header>
 </template>
@@ -48,7 +49,9 @@ const cId = computed(() => {
 
 const name = computed(() => {
   const info = userStore.userInfo?.customInfo || {}
-  return info.firstName&&info.lastName?`${info.firstName} ${info.lastName}`:''
+  const firstName = info.firstName || ''
+  const lastName = info.lastName || ''
+  return (firstName + ' ' + lastName).trim() || info.name
 })
 
 onMounted(()=>{