diff --git a/src/components/Navbar/index.vue b/src/components/Navbar/index.vue
index f8da070..a5fa3dd 100644
--- a/src/components/Navbar/index.vue
+++ b/src/components/Navbar/index.vue
@@ -1,15 +1,65 @@
-
+
-
-
-
-
+
+
+
+
+
+
+ left
+ 标题
+ right
+
+
+
+
diff --git a/src/hooks/useSystem.ts b/src/hooks/useSystem.ts
new file mode 100644
index 0000000..c738a6d
--- /dev/null
+++ b/src/hooks/useSystem.ts
@@ -0,0 +1,164 @@
+/**
+ * 系统信息
+ * @description 除去uni官方不推荐使用的返回参数
+ * @link https://uniapp.dcloud.net.cn/api/system/info.html
+ */
+export const useSystem = () => {
+ const {
+ // device
+ deviceId,
+ deviceBrand,
+ deviceModel,
+ deviceType,
+ devicePixelRatio,
+ deviceOrientation,
+ // os
+ osName,
+ osVersion,
+ osLanguage,
+ osTheme,
+ // @ts-ignore
+ osAndroidAPILevel,
+ // rom
+ romName,
+ romVersion,
+ // browser
+ browserName,
+ browserVersion,
+ // host
+ hostFontSizeSetting,
+ hostSDKVersion,
+ hostName,
+ hostVersion,
+ hostLanguage,
+ hostTheme,
+ hostPackageName,
+ // uni-app框架
+ uniPlatform,
+ uniCompileVersion,
+ uniRuntimeVersion,
+ // app
+ appId,
+ appName,
+ appVersion,
+ appVersionCode,
+ appLanguage,
+ // @ts-ignore
+ appWgtVersion,
+ // 其他
+ ua,
+ screenWidth,
+ screenHeight,
+ windowWidth,
+ windowHeight,
+ windowTop,
+ windowBottom,
+ statusBarHeight,
+ safeArea,
+ safeAreaInsets,
+ // 某些小程序特殊的返回参数
+ // @ts-ignore
+ benchmarkLevel,
+ // @ts-ignore
+ batteryLevel,
+ currentBattery,
+ navigationBarHeight,
+ titleBarHeight,
+ albumAuthorized,
+ cameraAuthorized,
+ locationAuthorized,
+ microphoneAuthorized,
+ notificationAuthorized,
+ notificationAlertAuthorized,
+ notificationBadgeAuthorized,
+ notificationSoundAuthorized,
+ bluetoothEnabled,
+ locationEnabled,
+ wifiEnabled,
+ cacheLocation,
+ storage,
+ } = uni.getSystemInfoSync();
+ const {
+ top: safeAreaTop,
+ bottom: safeAreaBottom,
+ left: safeAreaLeft,
+ right: safeAreaRight,
+ height: safeAreaHeight,
+ width: safeAreaWidth,
+ } = safeArea!;
+ const {
+ top: safeAreaInsetsTop,
+ bottom: safeAreaInsetsBottom,
+ left: safeAreaInsetsLeft,
+ right: safeAreaInsetsRight,
+ } = safeAreaInsets!;
+ return {
+ deviceId,
+ deviceBrand,
+ deviceModel,
+ deviceType,
+ devicePixelRatio,
+ deviceOrientation,
+ osName,
+ osVersion,
+ osLanguage,
+ osTheme,
+ osAndroidAPILevel,
+ romName,
+ romVersion,
+ browserName,
+ browserVersion,
+ hostFontSizeSetting,
+ hostSDKVersion,
+ hostName,
+ hostVersion,
+ hostLanguage,
+ hostTheme,
+ hostPackageName,
+ uniPlatform,
+ uniCompileVersion,
+ uniRuntimeVersion,
+ appId,
+ appName,
+ appVersion,
+ appVersionCode,
+ appLanguage,
+ appWgtVersion,
+ ua,
+ screenWidth,
+ screenHeight,
+ windowWidth,
+ windowHeight,
+ windowTop,
+ windowBottom,
+ statusBarHeight,
+ safeAreaTop,
+ safeAreaBottom,
+ safeAreaLeft,
+ safeAreaRight,
+ safeAreaHeight,
+ safeAreaWidth,
+ safeAreaInsetsTop,
+ safeAreaInsetsBottom,
+ safeAreaInsetsLeft,
+ safeAreaInsetsRight,
+ benchmarkLevel,
+ batteryLevel,
+ currentBattery,
+ navigationBarHeight,
+ titleBarHeight,
+ albumAuthorized,
+ cameraAuthorized,
+ locationAuthorized,
+ microphoneAuthorized,
+ notificationAuthorized,
+ notificationAlertAuthorized,
+ notificationBadgeAuthorized,
+ notificationSoundAuthorized,
+ bluetoothEnabled,
+ locationEnabled,
+ wifiEnabled,
+ cacheLocation,
+ storage,
+ };
+};
diff --git a/src/state/app.ts b/src/state/app.ts
new file mode 100644
index 0000000..567eda7
--- /dev/null
+++ b/src/state/app.ts
@@ -0,0 +1,12 @@
+import { defineStore } from 'pinia';
+
+interface AppState {
+ sys?: string | number;
+}
+
+export const useAppStore = defineStore({
+ id: 'app-store',
+ state: (): AppState => ({}),
+ getters: {},
+ actions: {},
+});
diff --git a/src/utils/uniapi/index.ts b/src/utils/uniapi/index.ts
index 84619aa..0f47d16 100644
--- a/src/utils/uniapi/index.ts
+++ b/src/utils/uniapi/index.ts
@@ -33,3 +33,19 @@ export const GetClipboardData = () =>
},
});
});
+
+/**
+ * rpx 换算为 px
+ * @param upx
+ */
+export const rpx2px = (upx: number) => {
+ return uni.upx2px(upx);
+};
+
+/**
+ * px 换算为 rpx
+ * @param upx
+ */
+export const px2rpx = (px: number) => {
+ return px / (uni.upx2px(100) / 100);
+};
diff --git a/unocss.config.js b/unocss.config.js
index a462c4d..5a8c9b9 100644
--- a/unocss.config.js
+++ b/unocss.config.js
@@ -47,6 +47,8 @@ export default defineConfig({
shortcuts: [
{
'border-base': 'border border-gray-500_10',
+ '_u_z-tar-both': '_u_z-988',
+ '_u_head-fixed': '_u_fixed _u_top-0 _u_left-0 _u_w-full _u_z-tar-both',
_u_center: '_u_flex _u_justify-center _u_items-center',
},
],