diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index dbc3f52..9ebfcd1 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -138,6 +138,7 @@ API 配置集中在 src/api/index.ts
认证逻辑封装在 src/auth/index.ts
支持登录、注册组件复用
认证状态管理通过 useAuth composable
+
开发任务指引
当收到开发任务时,请:
@@ -159,3 +160,4 @@ API 类型来自私有包 @riwa/api-types(需要特定访问权限)
Capacitor 配置本地开发服务器地址为 http://localhost:5173
国际化支持中文和英文,配置文件在 src/locales/ 目前多语言只需要支持中英文,其他语言先不要更改
样式使用 TailwindCSS 4.x + Ionic CSS Variables 混合模式
+函数风格使用function关键字定义,一般不要使用箭头函数
diff --git a/auto-imports.d.ts b/auto-imports.d.ts
index 65740c1..d19b18a 100644
--- a/auto-imports.d.ts
+++ b/auto-imports.d.ts
@@ -351,7 +351,7 @@ declare global {
export type { Language } from './src/composables/useLanguage'
import('./src/composables/useLanguage')
// @ts-ignore
- export type { QRScanResult } from './src/composables/useQRScanner'
+ export type { QRScanResult, ScannerOptions } from './src/composables/useQRScanner'
import('./src/composables/useQRScanner')
// @ts-ignore
export type { ThemeMode } from './src/composables/useTheme'
diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj
index aa68e9e..6a044b7 100644
--- a/ios/App/App.xcodeproj/project.pbxproj
+++ b/ios/App/App.xcodeproj/project.pbxproj
@@ -297,6 +297,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = G6N4M926R4;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
@@ -305,7 +306,7 @@
);
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
- PRODUCT_BUNDLE_IDENTIFIER = io.ionic.starter;
+ PRODUCT_BUNDLE_IDENTIFIER = riwa.ionic.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
@@ -319,6 +320,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
+ DEVELOPMENT_TEAM = G6N4M926R4;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
@@ -326,7 +328,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = io.ionic.starter;
+ PRODUCT_BUNDLE_IDENTIFIER = riwa.ionic.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist
index 1942361..2bfab14 100644
--- a/ios/App/App/Info.plist
+++ b/ios/App/App/Info.plist
@@ -2,64 +2,65 @@
- CAPACITOR_DEBUG
- $(CAPACITOR_DEBUG)
- CFBundleDevelopmentRegion
- en
- CFBundleDisplayName
- riwa-ionic
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- $(MARKETING_VERSION)
- CFBundleVersion
- $(CURRENT_PROJECT_VERSION)
- LSRequiresIPhoneOS
-
- UILaunchStoryboardName
- LaunchScreen
- UIMainStoryboardFile
- Main
- UIRequiredDeviceCapabilities
-
- armv7
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UIViewControllerBasedStatusBarAppearance
-
- NSCameraUsageDescription
- This app needs access to camera to scan QR codes
- NSPrivacyAccessedAPITypes
-
-
-
- NSPrivacyAccessedAPIType
- NSPrivacyAccessedAPICategoryFileTimestamp
- NSPrivacyAccessedAPITypeReasons
-
- C617.1
-
-
-
+ CAPACITOR_DEBUG
+ $(CAPACITOR_DEBUG)
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ riwa-ionic
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(MARKETING_VERSION)
+ CFBundleVersion
+ $(CURRENT_PROJECT_VERSION)
+ LSRequiresIPhoneOS
+
+ NSCameraUsageDescription
+ This app needs access to camera to scan QR codes
+ NSPhotoLibraryUsageDescription
+ This app needs access to photo library to select images for QR code scanning
+ NSPrivacyAccessedAPITypes
+
+
+ NSPrivacyAccessedAPIType
+ NSPrivacyAccessedAPICategoryFileTimestamp
+ NSPrivacyAccessedAPITypeReasons
+
+ C617.1
+
+
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UIViewControllerBasedStatusBarAppearance
+
-
\ No newline at end of file
+
diff --git a/ios/App/CapApp-SPM/Package.swift b/ios/App/CapApp-SPM/Package.swift
index cfbfd4e..d410f9a 100644
--- a/ios/App/CapApp-SPM/Package.swift
+++ b/ios/App/CapApp-SPM/Package.swift
@@ -13,6 +13,7 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.0.0"),
.package(name: "CapacitorApp", path: "../../../node_modules/.pnpm/@capacitor+app@8.0.0_@capacitor+core@8.0.0/node_modules/@capacitor/app"),
+ .package(name: "CapacitorBarcodeScanner", path: "../../../node_modules/.pnpm/@capacitor+barcode-scanner@3.0.0_@capacitor+core@8.0.0/node_modules/@capacitor/barcode-scanner"),
.package(name: "CapacitorCamera", path: "../../../node_modules/.pnpm/@capacitor+camera@8.0.0_@capacitor+core@8.0.0/node_modules/@capacitor/camera"),
.package(name: "CapacitorClipboard", path: "../../../node_modules/.pnpm/@capacitor+clipboard@8.0.0_@capacitor+core@8.0.0/node_modules/@capacitor/clipboard"),
.package(name: "CapacitorFileTransfer", path: "../../../node_modules/.pnpm/@capacitor+file-transfer@2.0.0_@capacitor+core@8.0.0/node_modules/@capacitor/file-transfer"),
@@ -28,6 +29,7 @@ let package = Package(
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm"),
.product(name: "CapacitorApp", package: "CapacitorApp"),
+ .product(name: "CapacitorBarcodeScanner", package: "CapacitorBarcodeScanner"),
.product(name: "CapacitorCamera", package: "CapacitorCamera"),
.product(name: "CapacitorClipboard", package: "CapacitorClipboard"),
.product(name: "CapacitorFileTransfer", package: "CapacitorFileTransfer"),
diff --git a/package.json b/package.json
index b7aa638..d5b9ffe 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"@capacitor-community/barcode-scanner": "^4.0.1",
"@capacitor-mlkit/barcode-scanning": "^8.0.0",
"@capacitor/app": "8.0.0",
+ "@capacitor/barcode-scanner": "^3.0.0",
"@capacitor/camera": "^8.0.0",
"@capacitor/clipboard": "^8.0.0",
"@capacitor/core": "8.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d39f4fd..90b2429 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -17,6 +17,9 @@ importers:
'@capacitor/app':
specifier: 8.0.0
version: 8.0.0(@capacitor/core@8.0.0)
+ '@capacitor/barcode-scanner':
+ specifier: ^3.0.0
+ version: 3.0.0(@capacitor/core@8.0.0)
'@capacitor/camera':
specifier: ^8.0.0
version: 8.0.0(@capacitor/core@8.0.0)
@@ -831,6 +834,11 @@ packages:
peerDependencies:
'@capacitor/core': '>=8.0.0'
+ '@capacitor/barcode-scanner@3.0.0':
+ resolution: {integrity: sha512-UWcN+9uSk1+RxR/Sh794727QH7I47/N1NoTGcumjRjhbhAb6CHJPyxOf1LyIoBILt4PinUsLhegCmzlBDrB3lA==}
+ peerDependencies:
+ '@capacitor/core': '>=8.0.0'
+
'@capacitor/camera@8.0.0':
resolution: {integrity: sha512-Iu8j2oxoIhY2mLuoEckbL7PFgw1XFm1nqmeWdIkILpcT3H9A+BrSDUDlzWqM/EeaDKo6JnhR59tYHwUhOdXaUg==}
peerDependencies:
@@ -3141,6 +3149,9 @@ packages:
html-entities@2.6.0:
resolution: {integrity: sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==}
+ html5-qrcode@2.3.8:
+ resolution: {integrity: sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==}
+
http-proxy-agent@7.0.2:
resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}
engines: {node: '>= 14'}
@@ -5839,6 +5850,11 @@ snapshots:
dependencies:
'@capacitor/core': 8.0.0
+ '@capacitor/barcode-scanner@3.0.0(@capacitor/core@8.0.0)':
+ dependencies:
+ '@capacitor/core': 8.0.0
+ html5-qrcode: 2.3.8
+
'@capacitor/camera@8.0.0(@capacitor/core@8.0.0)':
dependencies:
'@capacitor/core': 8.0.0
@@ -8363,6 +8379,8 @@ snapshots:
html-entities@2.6.0: {}
+ html5-qrcode@2.3.8: {}
+
http-proxy-agent@7.0.2:
dependencies:
agent-base: 7.1.4
diff --git a/src/components/qr-scanner/index.vue b/src/components/qr-scanner/index.vue
index ed4af41..c5fa52e 100644
--- a/src/components/qr-scanner/index.vue
+++ b/src/components/qr-scanner/index.vue
@@ -1,162 +1,342 @@
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
+
+
+