ljc vor 1 Monat
Ursprung
Commit
fb6653a13b

+ 1 - 1
components/cwg-notice.vue

@@ -106,7 +106,7 @@ onMounted(() => {
     })
 })
 onUnmounted(() => {
-    uni.off('updateUnreadCount')
+    uni.$off('updateUnreadCount')
 })
 </script>
 

+ 1 - 0
components/cwg-right-drawer.vue

@@ -136,6 +136,7 @@ async function handleLogout() {
         await userApi.logout()
     } catch (e) { }
     userStore.clearUserInfo()
+    uni.$emit('updateSystemList')
     router.push('/pages/login/index')
     close()
 }

+ 22 - 6
components/cwg-system.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="cwg-system">
+  <view class="cwg-system" v-if="systemMenuList.length">
     <cwg-dropdown :menu-list="systemMenuList" @menuClick="handleMenuClick">
       <view class="pc-header-btn">
         <text class="current-system-name">{{ currentSystemName }}</text>
@@ -10,7 +10,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, ref, onMounted } from 'vue'
+import { computed, ref, onMounted,onUnmounted } from 'vue'
 import { useI18n } from 'vue-i18n'
 import Config from '@/config/index'
 import { customApi } from '@/service/custom'
@@ -85,13 +85,17 @@ const applySystemList = (data: any[]) => {
   }
 }
 
-async function getSystemList() {
+async function getSystemList(type = false) {
   const cached = getCache()
-  if (cached && cached.timestamp && Date.now() - cached.timestamp < CACHE_DURATION) {
-    applySystemList(cached.data || [])
-    return
+  console.log(1)
+  if (!type){
+    if (cached && cached.timestamp && Date.now() - cached.timestamp < CACHE_DURATION) {
+      applySystemList(cached.data || [])
+      return
+    }
   }
 
+  console.log('qingqiule')
   try {
     const res: any = await customApi.getSystemList({})
     if (res && res.code === Code.StatusOK) {
@@ -155,8 +159,20 @@ function handleMenuClick({ value }: { value: any }) {
   switchSystem(value)
 }
 
+const isInit = ref(false)
+
 onMounted(() => {
+  if (isInit.value) return
+  isInit.value = true
+  
   getSystemList()
+
+  uni.$on('updateSystemList', () => {
+    getSystemList(true)
+  })
+})
+onUnmounted(() => {
+  uni.$off('updateSystemList')
 })
 </script>
 

+ 8 - 5
pages/ib/index.vue

@@ -14,13 +14,14 @@
         </view>
       </uni-col>
       <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="uni-col-left">
-        <view class="dashboard-container">
+        <uni-row class="dashboard-container">
           <!-- 余额卡片  操作代码隐藏了,-->
           <!--                <cwg-dropdown :menu-list="menuList" @menuClick="handleMenuClick">-->
           <!--                  <view class="pc-header-btn">-->
           <!--                    <cwg-icon name="crm-ellipsis" :size="24" color="#000" />-->
           <!--                  </view>-->
           <!--                </cwg-dropdown>-->
+          <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
           <view class="card position-relative">
             <view class="card-body d-flex gap-3 align-items-center">
               <view class="clearfix pe-2 text-warning"> <img src="/static/images/dollar.png" alt="dollar" class="img-fluid"> </view>
@@ -30,6 +31,7 @@
               </view>
             </view>
           </view>
+          </uni-col>
           
 
           <!-- 开户链接 -->
@@ -51,7 +53,7 @@
 <!--              </view>-->
 <!--            </view>-->
 <!--          </view>-->
-
+          <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
           <view class="card position-relative">
             <view class="card-body d-flex gap-3 align-items-center">
               <view class="clearfix pe-2 text-warning">
@@ -63,6 +65,8 @@
               </view>
             </view>
           </view>
+          </uni-col>
+          <uni-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
           <view class="card position-relative">
             <view class="card-body d-flex gap-3 align-items-center">
               <view class="clearfix pe-2 text-warning">
@@ -74,7 +78,7 @@
               </view>
             </view>
           </view>
-
+          </uni-col>
 
           <!-- 名下客户 -->
 <!--          <view class="card custom-card">-->
@@ -123,7 +127,7 @@
   <button class="link-btn">{{ t('Ib.Index.Copy') }}</button>
 </view>
 </view>-->
-        </view>
+        </uni-row>
       </uni-col>
       <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="uni-col-right">
         <view class="card">
@@ -764,7 +768,6 @@ onMounted(async () => {
   .dashboard-container {
     min-height: 10vh;
     box-sizing: border-box;
-    display: flex;
     height: 100%;
   }
 

+ 1 - 0
pages/login/index.vue

@@ -677,6 +677,7 @@ async function getCustomLoginInfo() {
   try {
     const res = await userApi.getUserInfo()
     userStore.saveUserInfo(res.data)
+    uni.$emit('updateSystemList')
     if (res.code === 200) {
       switch (modeStore.value) {
         case 'customer':