From 406466d7925c170b9f2f43cc4cf0383162eb84ce Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Wed, 16 Jul 2025 15:38:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0manifest.json?= =?UTF-8?q?=E5=92=8C=E8=93=9D=E7=89=99=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=93=9D=E7=89=99=E6=9C=AA=E5=BC=80=E5=90=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=BC=BA=E7=94=A8=E6=88=B7=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 236 +++++++++++++++++++++++--------------------- stores/bluetooth.js | 32 +++--- 2 files changed, 142 insertions(+), 126 deletions(-) diff --git a/manifest.json b/manifest.json index 998ff35..cc76942 100644 --- a/manifest.json +++ b/manifest.json @@ -1,118 +1,130 @@ { - "name": "星星锁Lite", - "appid": "__UNI__933D519", - "description": "", - "versionName": "1.3.2", - "versionCode": "40", - "mp-weixin": { - "appid": "wx9829a39e65550757", - "setting": { - "urlCheck": true, - "minified": true - }, - "permission": { - "scope.bluetooth": { - "desc": "蓝牙将用于控制和管理您的智能门锁" - } - }, - "usingComponents": true, - "lazyCodeLoading": "requiredComponents", - "optimization": { - "subPackages": true - }, - "plugins": { - "wmpf-voip": { - "version": "latest", - "provider": "wxf830863afde621eb", - "genericsImplementation": { - "call-page-plugin": { - "custombox": "pages/main/customBox" - } - } - } - } - }, - "vueVersion": "3", - "app-plus": { - "distribute": { - "icons": { - "android": { - "hdpi": "unpackage/res/icons/72x72.png", - "xhdpi": "unpackage/res/icons/96x96.png", - "xxhdpi": "unpackage/res/icons/144x144.png", - "xxxhdpi": "unpackage/res/icons/192x192.png" + "name" : "星星锁Lite", + "appid" : "__UNI__933D519", + "description" : "", + "versionName" : "1.3.2", + "versionCode" : "40", + "mp-weixin" : { + "appid" : "wx9829a39e65550757", + "setting" : { + "urlCheck" : true, + "minified" : true }, - "ios": { - "appstore": "unpackage/res/icons/1024x1024.png", - "ipad": { - "app": "unpackage/res/icons/76x76.png", - "app@2x": "unpackage/res/icons/152x152.png", - "notification": "unpackage/res/icons/20x20.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "proapp@2x": "unpackage/res/icons/167x167.png", - "settings": "unpackage/res/icons/29x29.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "spotlight": "unpackage/res/icons/40x40.png", - "spotlight@2x": "unpackage/res/icons/80x80.png" - }, - "iphone": { - "app@2x": "unpackage/res/icons/120x120.png", - "app@3x": "unpackage/res/icons/180x180.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "notification@3x": "unpackage/res/icons/60x60.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "settings@3x": "unpackage/res/icons/87x87.png", - "spotlight@2x": "unpackage/res/icons/80x80.png", - "spotlight@3x": "unpackage/res/icons/120x120.png" - } + "permission" : { + "scope.bluetooth" : { + "desc" : "蓝牙将用于控制和管理您的智能门锁" + } + }, + "usingComponents" : true, + "lazyCodeLoading" : "requiredComponents", + "optimization" : { + "subPackages" : true + }, + "plugins" : { + "wmpf-voip" : { + "version" : "latest", + "provider" : "wxf830863afde621eb", + "genericsImplementation" : { + "call-page-plugin" : { + "custombox" : "pages/main/customBox" + } + } + } } - }, - "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "packagename": "com.xhs.lock", - "password": "xhs2025", - "aliasname": "xhs2025", - "keystore": "./android.jks", - "targetSdkVersion": 34, - "abiFilters": ["armeabi-v7a", "arm64-v8a"] - }, - "ios": { - "dSYMs": false - } }, - "modules": { - "Bluetooth": {}, - "VideoPlayer": {}, - "Camera": {}, - "Record": {} - }, - "splashscreen": { - "waiting": false + "vueVersion" : "3", + "app-plus" : { + "optimization" : { + "subPackages" : true + }, + "runmode" : "liberate", + "distribute" : { + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + }, + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "packagename" : "com.xhs.lock", + "password" : "xhs2025", + "aliasname" : "xhs2025", + "keystore" : "./android.jks", + "targetSdkVersion" : 34, + "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ] + }, + "ios" : { + "dSYMs" : false + } + }, + "modules" : { + "Bluetooth" : { + "description" : "低功耗蓝牙" + }, + "VideoPlayer" : { + "description" : "视频播放" + }, + "Camera" : { + "description" : "相机和相册" + }, + "Record" : { + "description" : "录音" + } + }, + "splashscreen" : { + "waiting" : false + } } - } } diff --git a/stores/bluetooth.js b/stores/bluetooth.js index d8d60f8..5d62eed 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -900,20 +900,24 @@ export const useBluetoothStore = defineStore('ble', { }) // #endif // #ifdef APP-PLUS - const systemInfo = uni.getSystemInfoSync() - if (systemInfo.platform === 'android') { - const main = plus.android.runtimeMainActivity() - const Intent = plus.android.importClass('android.content.Intent') - const BluetoothAdapter = plus.android.importClass('android.bluetooth.BluetoothAdapter') - const intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE) - main.startActivity(intent) - } else if (systemInfo.platform === 'ios') { - uni.showModal({ - title: '提示', - content: '蓝牙尚未打开,请先打开蓝牙', - showCancel: false - }) - } + uni.showModal({ + title: '提示', + content: '蓝牙尚未打开,请先打开蓝牙', + showCancel: false, + success(res) { + if (res.confirm) { + // #ifdef APP-ANDROID + const main = plus.android.runtimeMainActivity() + const Intent = plus.android.importClass('android.content.Intent') + const BluetoothAdapter = plus.android.importClass( + 'android.bluetooth.BluetoothAdapter' + ) + const intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE) + main.startActivity(intent) + // #endif + } + } + }) // #endif } } else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) {