Skip to content

Commit

Permalink
feat: 支持隐藏文件页
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 13, 2024
1 parent c229627 commit 035a967
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.41",
"version": "2.14.42",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
4 changes: 2 additions & 2 deletions src/components/TabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
size="22px"
>
<nut-tabbar-item class="tabbar-item" to="/subs" icon="link" />
<nut-tabbar-item class="tabbar-item" to="/files" icon="category" />
<nut-tabbar-item v-show="!istabBar2" class="tabbar-item" to="/files" icon="category" />

<nut-tabbar-item
v-show="!istabBar"
Expand Down Expand Up @@ -38,7 +38,7 @@
});
const globalStore = useGlobalStore();
const { bottomSafeArea, istabBar, env } = storeToRefs(globalStore);
const { bottomSafeArea, istabBar, istabBar2, env } = storeToRefs(globalStore);
const style = {
height: `${bottomSafeArea.value + 12 + 44}px`,
paddingBottom: bottomSafeArea.value + 'px',
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ export default {
isSimpleReicon: 'Show items refresh button',
showFloatingRefreshButton: 'Show floating refresh button',
tabBar: 'Hide "Sync" Page',
tabBar2: 'Hide "File" Page',
auto2: 'MoreSetting Key',
hostapi: 'Custom Backend API',
currentHostApi: 'Current Backend API',
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ export default {
isEditorCommon: '展示编辑页常用配置',
isSimpleReicon: '展示订阅刷新按钮',
showFloatingRefreshButton: '显示悬浮刷新按钮',
tabBar: '隐藏“Gist 同步”页',
tabBar: '隐藏 "Gist 同步" 页',
tabBar2: '隐藏 "文件" 页',
auto2: '自定义设置 Key',
hostapi: '自定义后端 API',
currentHostApi: '当前后端 API',
Expand Down
9 changes: 9 additions & 0 deletions src/store/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const useGlobalStore = defineStore('globalStore', {
isSimpleReicon: localStorage.getItem('isSimpleReicon') === '1',
showFloatingRefreshButton: localStorage.getItem('showFloatingRefreshButton') === '1',
istabBar: localStorage.getItem('istabBar') === '1',
istabBar2: localStorage.getItem('istabBar2') === '1',
ishostApi: getHostAPIUrl(),
};
},
Expand Down Expand Up @@ -98,6 +99,14 @@ export const useGlobalStore = defineStore('globalStore', {
}
this.istabBar = istabBar;
},
settabBar2(istabBar2: boolean) {
if (istabBar2) {
localStorage.setItem('istabBar2', '1');
} else {
localStorage.removeItem('istabBar2');
}
this.istabBar2 = istabBar2;
},
async setHostAPI(hostApi: string) {
this.ishostApi = hostApi;
service.defaults.baseURL = hostApi;
Expand Down
1 change: 1 addition & 0 deletions src/types/store/globalStore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface GlobalStoreState {
isSimpleReicon: boolean;
showFloatingRefreshButton: boolean;
istabBar: boolean;
istabBar2: boolean;
ishostApi: string;
}

Expand Down
16 changes: 16 additions & 0 deletions src/views/settings/moreSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
</template>
</nut-cell>

<nut-cell :title="$t(`moreSettingPage.tabBar2`)" class="cell-item">
<template v-slot:link>
<nut-switch
class="my-switch"
v-model="awtabBar2"
size="mini"
@change="settabBar2"
/>
</template>
</nut-cell>
<nut-cell :title="$t(`moreSettingPage.tabBar`)" class="cell-item">
<template v-slot:link>
<nut-switch
Expand Down Expand Up @@ -180,6 +190,7 @@
isSimpleReicon,
showFloatingRefreshButton,
istabBar,
istabBar2,
} = storeToRefs(globalStore);
const InputHostApi = ref('');
Expand All @@ -191,6 +202,7 @@
const awSimpleReicon = ref(true);
const awShowFloatingRefreshButton = ref(false);
const awtabBar = ref(true);
const awtabBar2 = ref(true);
// const isEditing = ref(false);
const isInit = ref(false);
Expand Down Expand Up @@ -226,6 +238,9 @@
const settabBar = (istabBar: boolean) => {
globalStore.settabBar(istabBar);
};
const settabBar2 = (istabBar2: boolean) => {
globalStore.settabBar2(istabBar2);
};
const SwitchSyncIsChange = (val: boolean) => {
changeAutoDownloadGist({ autoDownloadGistSync: val });
Expand Down Expand Up @@ -355,6 +370,7 @@
awSimpleReicon.value = isSimpleReicon.value;
awShowFloatingRefreshButton.value = showFloatingRefreshButton.value;
awtabBar.value = istabBar.value;
awtabBar2.value = istabBar2.value;
autoSwitch.value = isAuto();
if (!isInit.value) {
setDisplayInfo();
Expand Down

0 comments on commit 035a967

Please sign in to comment.