Merge branch 'fanpeng' into 'develop'

Fanpeng

See merge request StarlockTeam/wx-starlock!47
This commit is contained in:
范鹏 2025-07-07 02:30:59 +00:00
commit 8bc344e173
3 changed files with 197 additions and 161 deletions

View File

@ -1,114 +1,114 @@
{
"name" : "星星锁Lite",
"appid" : "__UNI__933D519",
"description" : "",
"versionName" : "1.3.2",
"versionCode" : "39",
"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"
}
}
}
}
"name": "星星锁Lite",
"appid": "__UNI__933D519",
"description": "",
"versionName": "1.3.0",
"versionCode": "37",
"mp-weixin": {
"appid": "wx9829a39e65550757",
"setting": {
"urlCheck": true,
"minified": true
},
"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"
},
"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" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />",
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>"
],
"targetSdkVersion" : 34,
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
},
"ios" : {
"dSYMs" : false
}
},
"modules" : {
"Bluetooth" : {},
"VideoPlayer" : {},
"Camera" : {},
"Record" : {}
},
"splashscreen" : {
"waiting" : false
"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"
},
"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": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />",
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>"
],
"targetSdkVersion": 34,
"abiFilters": ["armeabi-v7a", "arm64-v8a"]
},
"ios": {
"dSYMs": false
}
},
"modules": {
"Bluetooth": {},
"VideoPlayer": {},
"Camera": {},
"Record": {}
},
"splashscreen": {
"waiting": false
}
}
}

View File

@ -78,7 +78,10 @@
</view>
<view class="menu-main">
<view
v-if="$bluetooth.currentLockInfo.keyRight === 1"
v-if="
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'keyList' })"
>
@ -91,7 +94,8 @@
<view
v-if="
$bluetooth.currentLockInfo.lockFeature.password &&
$bluetooth.currentLockInfo.keyRight === 1
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'passwordList' })"
@ -105,7 +109,8 @@
<view
v-if="
$bluetooth.currentLockInfo.lockFeature.icCard &&
$bluetooth.currentLockInfo.keyRight === 1
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'cardList' })"
@ -119,7 +124,8 @@
<view
v-if="
$bluetooth.currentLockInfo.lockFeature.fingerprint &&
$bluetooth.currentLockInfo.keyRight === 1
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'fingerprintList' })"
@ -133,7 +139,8 @@
<view
v-if="
$bluetooth.currentLockInfo.lockFeature.bluetoothRemoteControl &&
$bluetooth.currentLockInfo.keyRight === 1
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view transform-scale-110"
@click="$basic.routeJump({ name: 'remoteList' })"
@ -147,7 +154,8 @@
<view
v-if="
$bluetooth.currentLockInfo.lockFeature.d3Face &&
$bluetooth.currentLockInfo.keyRight === 1
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'faceList' })"
@ -161,7 +169,8 @@
<view
v-if="
$bluetooth.currentLockInfo.lockFeature.palmVein &&
$bluetooth.currentLockInfo.keyRight === 1
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'palmVeinList' })"
@ -184,7 +193,10 @@
<view>监控</view>
</view>
<view
v-if="$bluetooth.currentLockInfo.userType === 110301"
v-if="
$bluetooth.currentLockInfo.userType === 110301 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'adminList' })"
>
@ -217,7 +229,10 @@
<view>门锁记录</view>
</view>
<view
v-if="$bluetooth.currentLockInfo.keyRight === 1"
v-if="
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'messageReminder' })"
>
@ -240,7 +255,11 @@
</view>
</view>
</view>
<view class="setting" @click="$basic.routeJump({ name: 'setting' })">
<view
class="setting"
@click="$basic.routeJump({ name: 'setting' })"
v-if="$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN"
>
<image class="setting-image" src="https://oss-lock.xhjcn.ltd/mp/icon_setting.png"></image>
<view class="setting-text">设置</view>
<image
@ -249,6 +268,12 @@
src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
></image>
</view>
<view
v-if="$bluetooth.currentLockInfo.transportType === transportType.TRANSPORT_TENCENT_YUN"
class="fixed bottom-[calc(env(safe-area-inset-bottom)+120rpx)] mt-4 rounded-3xl w-686 h-80 line-height-80rpx text-center mx-32rpx bg-#ec433c text-white text-xl font-bold"
@click="deleteLock"
>删除
</view>
</scroll-view>
<up-popup
:show="show"
@ -284,7 +309,7 @@
import SwitchLoading from '@/components/SwitchLoading/SwitchLoading.vue'
import { useLockStore } from '@/stores/lock'
import { useUserStore } from '@/stores/user'
import { getLockDetailRequest, getLockNetTokenRequest } from '@/api/lock'
import { getLockDetailRequest, getLockNetTokenRequest, deleteLockRequest } from '@/api/lock'
import { deleteKeyRequest } from '@/api/key'
import { transportType } from '@/constant/transportType'
@ -497,6 +522,58 @@
}
refresherTriggered.value = false
}
const deleteLock = async () => {
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
const message = '删除锁后,所有信息都会一起删除,确定删除锁吗?'
uni.showModal({
title: '提示',
content: message,
async success(res) {
if (res.confirm) {
uni.showLoading({
title: '删除中'
})
const { code: resetDeviceCode } = await $bluetooth.resetDevice({
name: $bluetooth.currentLockInfo.name,
authUid: $user.userInfo.uid.toString(),
keyId: $bluetooth.keyId.toString()
})
if (resetDeviceCode === 0 || resetDeviceCode === -2) {
const { code, message } = await deleteLockRequest({
lockId: $bluetooth.currentLockInfo.lockId
})
if (code === 0) {
uni.hideLoading()
$lock.updateLockSearch({
...$lock.lockSearch,
pageNo: 1
})
$lock.getLockList($lock.lockSearch)
$basic.backAndToast('删除成功', 1)
} else {
uni.hideLoading()
uni.showToast({
title: message,
icon: 'none'
})
}
} else if (resetDeviceCode === -1) {
uni.hideLoading()
uni.showToast({
title: '删除失败,请保持在锁附近',
icon: 'none'
})
}
}
}
})
}
</script>
<style lang="scss" scoped>

View File

@ -42,12 +42,6 @@
<view v-if="requestFinish" class="mt-4 text-center text-base font-bold text-[#999]">
微信会收到视频通话请求
</view>
<view
class="fixed bottom-120rpx w-400rpx h-88rpx rounded-md leading-88rpx left-1/2 -translate-x-1/2 bg-[#63b8af] text-center text-base font-bold text-[#ffffff]"
@click="getTicket"
>
获取ticket
</view>
</view>
</template>
@ -106,41 +100,6 @@
}
})
const getTicket = async () => {
uni.showLoading({
title: '加载中...'
})
const result = await getInfo()
uni.hideLoading()
if (result.code === 0) {
const ticket = result.data.WXIoTDeviceInfo.SNTicket
uni.showModal({
title: '票据',
content: ticket,
showCancel: false,
confirmText: '复制',
success: ({ confirm }) => {
if (confirm) {
uni.setClipboardData({
data: ticket,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'none'
})
}
})
}
}
})
} else {
uni.showToast({
title: result.message,
icon: 'none'
})
}
}
const getDeviceVoIPList = async () => {
return new Promise(resolve => {
wx.getDeviceVoIPList({