diff --git a/api/lock.js b/api/lock.js
index 1be2222..cc58004 100644
--- a/api/lock.js
+++ b/api/lock.js
@@ -28,3 +28,12 @@ export function getLockNetTokenRequest(data) {
data
})
}
+
+// 删除智能门锁
+export function deleteLockRequest(data) {
+ return request({
+ url: '/lock/delete',
+ method: 'POST',
+ data
+ })
+}
diff --git a/api/lockSetting.js b/api/lockSetting.js
new file mode 100644
index 0000000..3a04683
--- /dev/null
+++ b/api/lockSetting.js
@@ -0,0 +1,12 @@
+import request from '../utils/request'
+
+// lockSetting 锁设置模块
+
+// 更新锁设置
+export function updateLockSettingRequest(data) {
+ return request({
+ url: '/lockSetting/updateLockSetting',
+ method: 'POST',
+ data
+ })
+}
diff --git a/pages.json b/pages.json
index cba01fd..7dd24e7 100644
--- a/pages.json
+++ b/pages.json
@@ -9,32 +9,17 @@
},
"pages": [
{
- "path": "pages/home/home",
- "style": {
- "navigationBarTitleText": "星星锁",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
- }
+ "path": "pages/home/home"
},
{
"path": "pages/selectAddress/selectAddress",
"style": {
"navigationBarTitleText": "锁地址",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default",
"disableScroll": true
}
},
{
- "path": "pages/mine/mine",
- "style": {
- "navigationBarTitleText": "星星锁",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
- }
+ "path": "pages/mine/mine"
},
{
"path": "pages/index/index"
@@ -42,110 +27,107 @@
{
"path": "pages/userInfo/userInfo",
"style": {
- "navigationBarTitleText": "个人信息",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "个人信息"
}
},
{
"path": "pages/updateName/updateName",
"style": {
- "navigationBarTitleText": "修改昵称",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "修改昵称"
}
},
{
"path": "pages/updatePassword/updatePassword",
"style": {
- "navigationBarTitleText": "重置密码",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "重置密码"
}
},
{
"path": "pages/updateEmail/updateEmail",
"style": {
- "navigationBarTitleText": "修改邮箱",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "修改邮箱"
}
},
{
"path": "pages/verifyEmail/verifyEmail",
"style": {
- "navigationBarTitleText": "验证邮箱",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "验证邮箱"
}
},
{
"path": "pages/safeQuestion/safeQuestion",
"style": {
- "navigationBarTitleText": "安全问题",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "安全问题"
}
},
{
"path": "pages/updateSafeQuestion/updateSafeQuestion",
"style": {
- "navigationBarTitleText": "修改安全问题",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "修改安全问题"
}
},
{
"path": "pages/webview/webview",
"style": {
- "navigationBarTitleText": "介绍",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "介绍"
}
},
{
"path": "pages/lockDetail/lockDetail",
"style": {
- "navigationBarTitleText": "星星锁",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "星星锁"
}
},
{
"path": "pages/bindLock/bindLock",
"style": {
- "navigationBarTitleText": "添加锁",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "添加锁"
}
},
{
"path": "pages/searchDevice/searchDevice",
"style": {
"disableScroll": true,
- "navigationBarTitleText": "附近设备",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#63b8af",
- "navigationStyle": "default"
+ "navigationBarTitleText": "附近设备"
+ }
+ },
+ {
+ "path": "pages/setting/setting",
+ "style": {
+ "navigationBarTitleText": "设置"
+ }
+ },
+ {
+ "path": "pages/keyList/keyList",
+ "style": {
+ "navigationBarTitleText": "电子钥匙"
+ }
+ },
+ {
+ "path": "pages/createKey/createKey",
+ "style": {
+ "navigationBarTitleText": "发送钥匙"
+ }
+ },
+ {
+ "path": "pages/passwordList/passwordList",
+ "style": {
+ "navigationBarTitleText": "密码"
+ }
+ },
+ {
+ "path": "pages/createPassword/createPassword",
+ "style": {
+ "navigationBarTitleText": "获取密码"
}
}
],
"globalStyle": {
- "navigationBarTextStyle": "black",
+ "navigationBarTextStyle": "white",
"navigationBarTitleText": "星星锁",
- "navigationBarBackgroundColor": "#F3F3F3",
+ "navigationBarBackgroundColor": "#63b8af",
"backgroundColor": "#F3F3F3",
- "navigationStyle": "custom"
+ "navigationStyle": "default"
},
"tabBar": {
"color": "#a3a3a3",
diff --git a/pages/createKey/createKey.vue b/pages/createKey/createKey.vue
new file mode 100644
index 0000000..608c2be
--- /dev/null
+++ b/pages/createKey/createKey.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/createPassword/createPassword.vue b/pages/createPassword/createPassword.vue
new file mode 100644
index 0000000..608c2be
--- /dev/null
+++ b/pages/createPassword/createPassword.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 47186cb..9254472 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -239,7 +239,7 @@
signKey: lock.bluetooth.signKey,
publicKey: lock.bluetooth.publicKey,
}
- this.updateKeyId(lock.keyId)
+ this.updateKeyId(lock.keyId.toString())
this.updateCurrentLockInfo(data)
this.routeJump({
name: 'lockDetail'
diff --git a/pages/keyList/keyList.vue b/pages/keyList/keyList.vue
new file mode 100644
index 0000000..608c2be
--- /dev/null
+++ b/pages/keyList/keyList.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue
index 9b07dbc..36c4726 100644
--- a/pages/lockDetail/lockDetail.vue
+++ b/pages/lockDetail/lockDetail.vue
@@ -33,17 +33,18 @@
+ class="menu-main-view" @click="routeJump({ name: 'keyList' })">
电子钥匙
-
+
密码
-
+
设置
@@ -53,6 +54,7 @@
diff --git a/pages/passwordList/passwordList.vue b/pages/passwordList/passwordList.vue
new file mode 100644
index 0000000..608c2be
--- /dev/null
+++ b/pages/passwordList/passwordList.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue
new file mode 100644
index 0000000..2197fe8
--- /dev/null
+++ b/pages/setting/setting.vue
@@ -0,0 +1,198 @@
+
+
+
+
+ 名称
+
+ {{currentLockInfo.lockAlias}}
+
+
+
+ 锁编号
+
+ {{currentLockInfo.name}}
+
+
+
+
+ MAC/ID
+
+ {{currentLockInfo.mac}}
+
+
+
+
+ 电量
+
+ {{currentLockInfo.electricQuantity}}%
+
+
+
+
+
+ 开锁时是否需联网
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
diff --git a/stores/basic.js b/stores/basic.js
index daa6e11..314ed7d 100644
--- a/stores/basic.js
+++ b/stores/basic.js
@@ -71,6 +71,31 @@ const pages = [
name: 'bindLock',
path: '/pages/bindLock/bindLock',
tabBar: false
+ },
+ {
+ name: 'setting',
+ path: '/pages/setting/setting',
+ tabBar: false
+ },
+ {
+ name: 'keyList',
+ path: '/pages/keyList/keyList',
+ tabBar: false
+ },
+ {
+ name: 'createKey',
+ path: '/pages/createKey/createKey',
+ tabBar: false
+ },
+ {
+ name: 'passwordList',
+ path: '/pages/passwordList/passwordList',
+ tabBar: false
+ },
+ {
+ name: 'createPassword',
+ path: '/pages/createPassword/createPassword',
+ tabBar: false
}
]
diff --git a/stores/bluetooth.js b/stores/bluetooth.js
index 8c9307b..1c83539 100644
--- a/stores/bluetooth.js
+++ b/stores/bluetooth.js
@@ -941,10 +941,10 @@ export const useBluetoothStore = defineStore('ble', {
for(let i = 0; i < authUid.length; i++) {
conentArray[i + 42] = authUid.charCodeAt(i)
}
- conentArray.set(this.currentLockInfo.token, 62)
+ conentArray.set(this.currentLockInfo.token || new Uint8Array([0, 0, 0, 0]), 62)
conentArray[66] = 16
- const md5Array = this.md5Encrypte(name, this.currentLockInfo.token, this.currentLockInfo.publicKey)
+ const md5Array = this.md5Encrypte(name, this.currentLockInfo.token || new Uint8Array([0, 0, 0, 0]), this.currentLockInfo.publicKey)
conentArray.set(md5Array, 67)
const cebArray = sm4.encrypt(conentArray, this.currentLockInfo.commKey, { mode: 'ecb', output: 'array' })