From 7e863f00f1029faec04568c036370316035f4b3d Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Mon, 14 Sep 2026 10:55:01 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E9=85=8D=E7=BD=AE=E8=93=9D=E7=89=99?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.config.ts | 9 +- src/auto-imports.d.ts | 5 + src/components/bluetooth/connect.vue | 267 +++++++- src/utils/bluetooth.ts | 873 +++++++++++++++++++++++++++ 4 files changed, 1126 insertions(+), 28 deletions(-) create mode 100644 src/utils/bluetooth.ts diff --git a/manifest.config.ts b/manifest.config.ts index b07a012..275045b 100644 --- a/manifest.config.ts +++ b/manifest.config.ts @@ -39,7 +39,12 @@ export default defineManifestConfig({ '', '', '', - '', + '', + '', + '', + '', + '', + '', '', '', '', @@ -48,7 +53,7 @@ export default defineManifestConfig({ '', '', '', - ], + ] as any, }, /* ios打包配置 */ ios: {}, diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index ebdb95e..808a544 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -9,6 +9,7 @@ declare global { const EffectScope: typeof import('vue')['EffectScope'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] + const bluetooth: typeof import('./utils/bluetooth')['default'] const closeDatabase: typeof import('./utils/sqlite')['closeDatabase'] const computed: typeof import('vue')['computed'] const computedAsync: typeof import('@vueuse/core')['computedAsync'] @@ -337,6 +338,9 @@ declare global { export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' import('vue') // @ts-ignore + export type { BluetoothDevice, ScanOptions, ScanForDeviceOptions, WriteOptions, BluetoothReceiveData, BluetoothConnectionState, DataCallback, ConnectionStateCallback, DeviceFoundCallback } from './utils/bluetooth' + import('./utils/bluetooth') + // @ts-ignore export type { SystemInfo } from './utils/device' import('./utils/device') // @ts-ignore @@ -352,6 +356,7 @@ declare module 'vue' { readonly EffectScope: UnwrapRef readonly asyncComputed: UnwrapRef readonly autoResetRef: UnwrapRef + readonly bluetooth: UnwrapRef readonly closeDatabase: UnwrapRef readonly computed: UnwrapRef readonly computedAsync: UnwrapRef diff --git a/src/components/bluetooth/connect.vue b/src/components/bluetooth/connect.vue index 8aa8a9c..8a24c8e 100644 --- a/src/components/bluetooth/connect.vue +++ b/src/components/bluetooth/connect.vue @@ -1,33 +1,212 @@