feat: 更新manifest.json和蓝牙逻辑,优化蓝牙未开启提示,增强用户交互体验

This commit is contained in:
fanpeng 2025-07-16 15:38:47 +08:00
parent 08b0121560
commit 406466d792
2 changed files with 142 additions and 126 deletions

View File

@ -1,74 +1,78 @@
{ {
"name": "星星锁Lite", "name" : "星星锁Lite",
"appid": "__UNI__933D519", "appid" : "__UNI__933D519",
"description": "", "description" : "",
"versionName": "1.3.2", "versionName" : "1.3.2",
"versionCode": "40", "versionCode" : "40",
"mp-weixin": { "mp-weixin" : {
"appid": "wx9829a39e65550757", "appid" : "wx9829a39e65550757",
"setting": { "setting" : {
"urlCheck": true, "urlCheck" : true,
"minified": true "minified" : true
}, },
"permission": { "permission" : {
"scope.bluetooth": { "scope.bluetooth" : {
"desc": "蓝牙将用于控制和管理您的智能门锁" "desc" : "蓝牙将用于控制和管理您的智能门锁"
} }
}, },
"usingComponents": true, "usingComponents" : true,
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading" : "requiredComponents",
"optimization": { "optimization" : {
"subPackages": true "subPackages" : true
}, },
"plugins": { "plugins" : {
"wmpf-voip": { "wmpf-voip" : {
"version": "latest", "version" : "latest",
"provider": "wxf830863afde621eb", "provider" : "wxf830863afde621eb",
"genericsImplementation": { "genericsImplementation" : {
"call-page-plugin": { "call-page-plugin" : {
"custombox": "pages/main/customBox" "custombox" : "pages/main/customBox"
} }
} }
} }
} }
}, },
"vueVersion": "3", "vueVersion" : "3",
"app-plus": { "app-plus" : {
"distribute": { "optimization" : {
"icons": { "subPackages" : true
"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": { "runmode" : "liberate",
"appstore": "unpackage/res/icons/1024x1024.png", "distribute" : {
"ipad": { "icons" : {
"app": "unpackage/res/icons/76x76.png", "android" : {
"app@2x": "unpackage/res/icons/152x152.png", "hdpi" : "unpackage/res/icons/72x72.png",
"notification": "unpackage/res/icons/20x20.png", "xhdpi" : "unpackage/res/icons/96x96.png",
"notification@2x": "unpackage/res/icons/40x40.png", "xxhdpi" : "unpackage/res/icons/144x144.png",
"proapp@2x": "unpackage/res/icons/167x167.png", "xxxhdpi" : "unpackage/res/icons/192x192.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": { "ios" : {
"app@2x": "unpackage/res/icons/120x120.png", "appstore" : "unpackage/res/icons/1024x1024.png",
"app@3x": "unpackage/res/icons/180x180.png", "ipad" : {
"notification@2x": "unpackage/res/icons/40x40.png", "app" : "unpackage/res/icons/76x76.png",
"notification@3x": "unpackage/res/icons/60x60.png", "app@2x" : "unpackage/res/icons/152x152.png",
"settings@2x": "unpackage/res/icons/58x58.png", "notification" : "unpackage/res/icons/20x20.png",
"settings@3x": "unpackage/res/icons/87x87.png", "notification@2x" : "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png", "proapp@2x" : "unpackage/res/icons/167x167.png",
"spotlight@3x": "unpackage/res/icons/120x120.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": { "android" : {
"permissions": [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@ -94,25 +98,33 @@
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>" "<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>"
], ],
"packagename": "com.xhs.lock", "packagename" : "com.xhs.lock",
"password": "xhs2025", "password" : "xhs2025",
"aliasname": "xhs2025", "aliasname" : "xhs2025",
"keystore": "./android.jks", "keystore" : "./android.jks",
"targetSdkVersion": 34, "targetSdkVersion" : 34,
"abiFilters": ["armeabi-v7a", "arm64-v8a"] "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
}, },
"ios": { "ios" : {
"dSYMs": false "dSYMs" : false
} }
}, },
"modules": { "modules" : {
"Bluetooth": {}, "Bluetooth" : {
"VideoPlayer": {}, "description" : "低功耗蓝牙"
"Camera": {},
"Record": {}
}, },
"splashscreen": { "VideoPlayer" : {
"waiting": false "description" : "视频播放"
},
"Camera" : {
"description" : "相机和相册"
},
"Record" : {
"description" : "录音"
}
},
"splashscreen" : {
"waiting" : false
} }
} }
} }

View File

@ -900,20 +900,24 @@ export const useBluetoothStore = defineStore('ble', {
}) })
// #endif // #endif
// #ifdef APP-PLUS // #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({ uni.showModal({
title: '提示', title: '提示',
content: '蓝牙尚未打开,请先打开蓝牙', content: '蓝牙尚未打开,请先打开蓝牙',
showCancel: false 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 // #endif
} }
} else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) { } else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) {