Skip to content

Commit 6b46dbb

Browse files
committed
更新[BoxJs TF]: 新增下拉显示&隐藏搜索栏, 优化固定背景, 修复搜索栏高度问题
1 parent 87ac7ce commit 6b46dbb

3 files changed

Lines changed: 39 additions & 6 deletions

File tree

‎box/chavy.boxjs.html‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
@click="box.usercfgs.isHidedSearchBar = false"
102102
v-if="box.usercfgs.isHidedSearchBar"
103103
></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">
105105
<!-- 搜索条 -->
106106
<v-autocomplete v-bind="ui.searchBar" :label="title" @click="ui.searchDialog.show = true" hide-no-data hide-details solo>
107107
<template #prepend-inner>
@@ -1144,7 +1144,7 @@ <h2>{{curbak.name}}</h2>
11441144
<v-btn dark v-if="!box.usercfgs.isHideRefresh" fab small color="orange" @click="window.location.reload()">
11451145
<v-icon>mdi-refresh</v-icon>
11461146
</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'">
11481148
<v-icon>mdi-code-tags</v-icon>
11491149
</v-btn>
11501150
<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
12161216
scrollY: {}, //记录每个界面的滚动值
12171217
overlay: { show: false, val: 60 },
12181218
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 },
12201220
searchDialog: { show: false },
12211221
versionsheet: { show: false },
12221222
updatesheet: { show: false },
@@ -1399,14 +1399,14 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
13991399
}
14001400
},
14011401
appBarBind() {
1402-
let app = !!this.box.usercfgs.isPinedSearchBar
1402+
let app = !!this.box.usercfgs.isPinedSearchBar && !this.box.usercfgs.isHidedSearchBar
14031403
let color = 'transparent'
14041404
const isEmptyLight = this.isWebApp && !this.isDarkMode && !this.isWallpaper
14051405
if (isEmptyLight) {
14061406
color = 'primary'
14071407
}
14081408
let flat = color === 'transparent'
1409-
return { app, color, flat, height: '68' }
1409+
return { app, color, flat, height: '68', maxHeight: '68' }
14101410
},
14111411
searchBarBind() {
14121412
const color = this.isDarkMode ? null : 'primary'
@@ -1720,8 +1720,20 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
17201720
methods: {
17211721
// 记录每个页面的滚动值
17221722
onScroll(event) {
1723+
const currentY = event.currentTarget.scrollY
1724+
const historyY = this.ui.scrollY[this.path]
17231725
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+
}
17241733
},
1734+
toggleWaitSearchBar: _.debounce(function () {
1735+
this.ui.isWaitToggleSearchBar = false
1736+
}, 1000),
17251737
handleHistory(path) {
17261738
const state = { title: 'BoxJs', url: path }
17271739
if (!history.state) {

‎box/chavy.boxjs.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const $ = new Env('BoxJs')
22

3-
$.version = '0.7.35'
3+
$.version = '0.7.36'
44
$.versionType = 'beta'
55

66
/**

‎box/release/box.release.tf.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.7.36",
5+
"tags": ["beta"],
6+
"author": "@chavyleung",
7+
"icon": "https://avatars3.githubusercontent.com/u/29748519",
8+
"repo": "https://github.com/chavyleung",
9+
"notes": [
10+
{
11+
"name": "新增",
12+
"descs": ["下拉显示&隐藏搜索栏"]
13+
},
14+
{
15+
"name": "优化",
16+
"descs": ["固定背景"]
17+
},
18+
{
19+
"name": "修复",
20+
"descs": ["搜索栏高度问题"]
21+
}
22+
]
23+
},
324
{
425
"version": "0.7.35",
526
"tags": ["beta"],

0 commit comments

Comments
 (0)