Browse Source

feat: 阳光采购搜索页未登录下拉样式兼容

cuiyalong 9 months ago
parent
commit
948d7d0b28
1 changed files with 17 additions and 6 deletions
  1. 17 6
      apps/mobile/src/views/search/result/sun/index.vue

+ 17 - 6
apps/mobile/src/views/search/result/sun/index.vue

@@ -896,6 +896,17 @@ export default {
     calcDropdownMenuMaxHeight() {
       const { maxHeight } = this.conf
       const { searchFilters } = this.$refs
+
+      let noLoginTop = 0
+      if (this.isLogin) {
+        // do something
+      } else {
+        const noLoginHeaderTop = document.querySelector('.no-login-header')
+        if (noLoginHeaderTop) {
+          noLoginTop = noLoginHeaderTop.clientHeight
+        }
+      }
+
       if (!maxHeight) {
         const h5Offset = this.$envs.inH5 ? 120 : 0
         const filterDOM = searchFilters?.$el
@@ -906,7 +917,7 @@ export default {
           filterDOM.getBoundingClientRect().top,
           filterDOM.clientHeight
         )
-        this.conf.maxHeight = `calc(100vh - ${domTop + h5Offset}px)`
+        this.conf.maxHeight = `calc(100vh - ${domTop + h5Offset}px - ${noLoginTop}px)`
       }
     },
     initDefaultFilterState() {
@@ -2177,11 +2188,11 @@ export default {
       this.scrollStatus = scrollTop < 60
     },
     onListTabClick(name) {
-      // if (!this.isLogin) {
-      //   if (name === 'detailedList') {
-      //     return this.toLogin()
-      //   }
-      // }
+      if (!this.isLogin) {
+        if (name === 'detailedList') {
+          return this.toLogin()
+        }
+      }
       // const isPass = this.beforeTabActiveChange(name)
       // if (isPass) {
       //   this.pageState.listTabActive = name