Browse Source

1-优化钉钉登录跳转管理台逻辑
2-管理台首页按钮卡片形式

yanqiliang 1 month ago
parent
commit
7d9275c2a9
3 changed files with 57 additions and 23 deletions
  1. 17 9
      src/App.vue
  2. 37 10
      src/pages/staticPages/workbench/workbench.vue
  3. 3 4
      src/pages/tabBar/login/login.vue

+ 17 - 9
src/App.vue

@@ -193,20 +193,28 @@ export default {
                             data: locInfo,
                             success: function () {
                                 let TIMInfo = Cache.get('TIMInfo') || {};
-                                const doRefresh = function () {
-                                    // 仅刷新一次,防止 loginTim 成功与 fallback 定时器重复触发
-                                    if (that._ssoRefreshDone) return;
-                                    that._ssoRefreshDone = true;
-                                    that.refreshCurrentPage(launchOptions);
+                                const redirectByRole = function () {
+                                    // 仅跳转一次,防止 loginTim 成功与 fallback 定时器重复触发
+                                    if (that._ssoRedirectDone) return;
+                                    that._ssoRedirectDone = true;
+                                    if (String(locInfo.groupID) === '352') {
+                                        uni.reLaunch({
+                                            url: '/pages/staticPages/workbench/workbench'
+                                        });
+                                    } else {
+                                        uni.switchTab({
+                                            url: '/pages/tabBar/home/home'
+                                        });
+                                    }
                                 };
                                 if (TIMInfo.loginStatus !== 'Y') {
-                                    messageUtil.loginTim(doRefresh);
-                                    // fallback:若 loginTim 回调因异常未触发,3s 后主动刷新,避免页面卡死
+                                    messageUtil.loginTim(redirectByRole);
+                                    // fallback:若 loginTim 回调因异常未触发,3s 后仍继续跳转。
                                     setTimeout(function () {
-                                        doRefresh();
+                                        redirectByRole();
                                     }, 3000);
                                 } else {
-                                    doRefresh();
+                                    redirectByRole();
                                 }
                             }
                         });

+ 37 - 10
src/pages/staticPages/workbench/workbench.vue

@@ -281,34 +281,61 @@ export default {
 .quick-entry-row {
     display: flex;
     flex-direction: row;
-    justify-content: flex-start;
+    gap: 16rpx;
 }
 
 .quick-item {
+    flex: 1;
+    min-width: 0;
+    box-sizing: border-box;
     display: flex;
     flex-direction: column;
     align-items: center;
-    padding: 12rpx 20rpx;
+    justify-content: center;
+    min-height: 180rpx;
+    padding: 20rpx 8rpx;
+    border: 2rpx solid #e7f0ff;
+    border-radius: 16rpx;
+    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
+    box-shadow: 0 6rpx 14rpx rgba(43, 132, 255, 0.08);
+    cursor: pointer;
+    -webkit-tap-highlight-color: transparent;
+    transition: transform 0.15s ease, box-shadow 0.15s ease;
+}
+
+.quick-item:active {
+    transform: scale(0.97);
+    box-shadow: 0 2rpx 8rpx rgba(43, 132, 255, 0.12);
 }
 
 .quick-icon-wrap {
-    width: 96rpx;
-    height: 96rpx;
-    background: #f0f6ff;
-    border-radius: 20rpx;
+    width: 80rpx;
+    height: 80rpx;
+    background: #ffffff;
+    border: 2rpx solid #dcecff;
+    border-radius: 18rpx;
     display: flex;
     align-items: center;
     justify-content: center;
-    margin-bottom: 12rpx;
+    margin-bottom: 14rpx;
+    box-shadow: 0 4rpx 10rpx rgba(43, 132, 255, 0.1);
 }
 
 .quick-icon {
-    font-size: 40rpx;
+    font-size: 42rpx;
+    line-height: 1;
 }
 
 .quick-text {
-    font-size: 26rpx;
-    color: #4a5160;
+    width: 100%;
+    font-size: 24rpx;
+    color: #354052;
+    font-weight: 500;
+    line-height: 1.35;
+    text-align: center;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
 }
 
 /* 最近患者 */

+ 3 - 4
src/pages/tabBar/login/login.vue

@@ -962,16 +962,15 @@ export default {
          */
         redirectAfterLogin: function () {
             let userData = Cache.get('userData') || {};
-            let targetUrl = (userData.groupID == 352) ? '/pages/staticPages/workbench/workbench' : '/pages/tabBar/home/home';
-            if (userData.groupID) {
+            if (String(userData.groupID) === '352') {
                 // workbench 非 tabBar 页面,使用 reLaunch 跳转
                 uni.reLaunch({
-                    url: targetUrl
+                    url: '/pages/staticPages/workbench/workbench'
                 });
             } else {
                 // home 为 tabBar 页面,使用 switchTab 跳转
                 uni.switchTab({
-                    url: targetUrl
+                    url: '/pages/tabBar/home/home'
                 });
             }
         },