Просмотр исходного кода

租户切换时联动轮播图

wangtao 1 день назад
Родитель
Сommit
5f500bae11
1 измененных файлов с 15 добавлено и 21 удалено
  1. 15 21
      src/pages/index.vue

+ 15 - 21
src/pages/index.vue

@@ -4,7 +4,7 @@
       <view class="u-navbar__content__left__item" v-if="tenantIdList.length == 1">
         <view class="u-navbar__content__left__item__title">应用中心</view>
       </view>
-      <view v-if="tenantIdList.length > 1 && accountState">
+      <view class="u-navbar__content__left__item" v-if="tenantIdList.length > 1 && accountState">
         <image class="unit-change" src="@/static/images/index/unitChange.png" @click="showLeftStateClick()"></image>
       </view>
     </template>
@@ -188,19 +188,7 @@ function changeTenantId(id) {
     })
   );
   useStore.LogOut().then(() => {
-    //#ifdef APP-PLUS
-    uni.navigateTo({
-      url: "/pages/index",
-    });
-    //#endif
-    //#ifndef APP-PLUS
-    //#endif
-    if (localStorage.getItem("type")) {
-      wx.miniProgram.navigateTo({
-        appId: "wxf5ad8734295d43f8",
-        url: "/pages/login?type=logout",
-      });
-    } else {
+    proxy.$modal.loading("加载中...");
       useStore
         .Login({
           username: decrypt(info.userName),
@@ -214,14 +202,16 @@ function changeTenantId(id) {
         .then(() => {
           // /** 获取用户信息 */
           useStore.SET_STORAGE_OBJECT_KEYS({ tenantId: id });
-          proxy.$modal.closeLoading();
           useStore.GetInfo().then((res) => {
             proxy.$settingStore.initThemeColor(storageSystem.get("themeColor")); //初始化默认主题
+            state.recentlyUsed = []
             init();
-            closeDrawer();
+            setTimeout(() => {
+              showLeftStateClick();
+              proxy.$modal.closeLoading();
+            },1000)
           });
         });
-    }
   });
 }
 /**
@@ -412,6 +402,7 @@ function getMobileBannerApi() {
   getMobileBanner({
     tenantId: useStore.tenantId,
   }).then((res) => {
+
     if (res.data.length > 0) {
       state.swiperList = [];
       state.swiperBool = res.data[0].openNot == 1 ? true : false;
@@ -427,6 +418,11 @@ function getMobileBannerApi() {
           });
         }
       }
+    }else{
+      state.swiperList=[{
+        url: "http://file.usky.cn/statics/202305/20230526152845A042.jpg",
+        type: "image",
+      }];
     }
   });
 }
@@ -550,9 +546,7 @@ onShow(() => {
 .unit-change {
   width: 18px;
   height: 18px;
-  position: fixed;
-  top: 12px;
-  left: 12px;
+  margin-top:14px;
 }
 .unit {
   width: 100vw !important;
@@ -588,7 +582,7 @@ onShow(() => {
     &-right {
       position: absolute;
       top: 38%;
-      right: 30%;
+      right: 10%;
       width: 16px;
       height: 11px;
       vertical-align: middle;