|
101 | 101 | @click="box.usercfgs.isHidedSearchBar = false" |
102 | 102 | v-if="box.usercfgs.isHidedSearchBar" |
103 | 103 | ></v-system-bar> |
104 | | - <v-app-bar v-bind="appBarBind" v-if="!box.usercfgs.isHidedSearchBar"> |
| 104 | + <v-app-bar v-bind="appBarBind" v-show="!box.usercfgs.isHidedSearchBar"> |
105 | 105 | <!-- 搜索条 --> |
106 | 106 | <v-autocomplete v-bind="ui.searchBar" :label="title" @click="ui.searchDialog.show = true" hide-no-data hide-details solo> |
107 | 107 | <template #prepend-inner> |
@@ -1144,7 +1144,7 @@ <h2>{{curbak.name}}</h2> |
1144 | 1144 | <v-btn dark v-if="!box.usercfgs.isHideRefresh" fab small color="orange" @click="window.location.reload()"> |
1145 | 1145 | <v-icon>mdi-refresh</v-icon> |
1146 | 1146 | </v-btn> |
1147 | | - <v-btn dark v-if="!box.usercfgs.isHideCoding" fab small @click="path = '/coding'"> |
| 1147 | + <v-btn dark v-if="!box.usercfgs.isHideCoding" fab small @click="path = '/#/coding'"> |
1148 | 1148 | <v-icon>mdi-code-tags</v-icon> |
1149 | 1149 | </v-btn> |
1150 | 1150 | <v-btn dark v-if="!box.usercfgs.isHidedSearch" fab small color="green" @click="ui.searchDialog.show = true"> |
@@ -1216,7 +1216,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio |
1216 | 1216 | scrollY: {}, //记录每个界面的滚动值 |
1217 | 1217 | overlay: { show: false, val: 60 }, |
1218 | 1218 | snackbar: { show: false, color: 'primary', msg: '' }, |
1219 | | - searchBar: { color: 'primary', readonly: true, input: '' }, |
| 1219 | + searchBar: { color: 'primary', readonly: true, input: '', hideNoData: true, hideDetails: true, solo: true }, |
1220 | 1220 | searchDialog: { show: false }, |
1221 | 1221 | versionsheet: { show: false }, |
1222 | 1222 | updatesheet: { show: false }, |
@@ -1399,14 +1399,14 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio |
1399 | 1399 | } |
1400 | 1400 | }, |
1401 | 1401 | appBarBind() { |
1402 | | - let app = !!this.box.usercfgs.isPinedSearchBar |
| 1402 | + let app = !!this.box.usercfgs.isPinedSearchBar && !this.box.usercfgs.isHidedSearchBar |
1403 | 1403 | let color = 'transparent' |
1404 | 1404 | const isEmptyLight = this.isWebApp && !this.isDarkMode && !this.isWallpaper |
1405 | 1405 | if (isEmptyLight) { |
1406 | 1406 | color = 'primary' |
1407 | 1407 | } |
1408 | 1408 | let flat = color === 'transparent' |
1409 | | - return { app, color, flat, height: '68' } |
| 1409 | + return { app, color, flat, height: '68', maxHeight: '68' } |
1410 | 1410 | }, |
1411 | 1411 | searchBarBind() { |
1412 | 1412 | const color = this.isDarkMode ? null : 'primary' |
@@ -1720,8 +1720,20 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio |
1720 | 1720 | methods: { |
1721 | 1721 | // 记录每个页面的滚动值 |
1722 | 1722 | onScroll(event) { |
| 1723 | + const currentY = event.currentTarget.scrollY |
| 1724 | + const historyY = this.ui.scrollY[this.path] |
1723 | 1725 | this.ui.scrollY[this.path] = event.currentTarget.scrollY |
| 1726 | + // 下拉显示/隐藏顶栏 |
| 1727 | + // 回弹时才触发显示与隐藏, 1 秒内不重复触发 |
| 1728 | + if (currentY < historyY && currentY < -30 && !this.ui.isWaitToggleSearchBar) { |
| 1729 | + this.ui.isWaitToggleSearchBar = true |
| 1730 | + this.box.usercfgs.isHidedSearchBar = !this.box.usercfgs.isHidedSearchBar |
| 1731 | + this.toggleWaitSearchBar() |
| 1732 | + } |
1724 | 1733 | }, |
| 1734 | + toggleWaitSearchBar: _.debounce(function () { |
| 1735 | + this.ui.isWaitToggleSearchBar = false |
| 1736 | + }, 1000), |
1725 | 1737 | handleHistory(path) { |
1726 | 1738 | const state = { title: 'BoxJs', url: path } |
1727 | 1739 | if (!history.state) { |
|
0 commit comments