diff --git a/api/notification.js b/api/notification.js new file mode 100644 index 0000000..472a636 --- /dev/null +++ b/api/notification.js @@ -0,0 +1,39 @@ +import request from '../utils/request' + +// Notification 通知模块 + +// 获取通知列表 +export function getNotificationList(data) { + return request({ + url: '/notifications/list', + method: 'POST', + data + }) +} + +// 标记消息为已读 +export function markAsReadNotification(data) { + return request({ + url: '/notifications/markAsRead', + method: 'POST', + data + }) +} + +// 删除所有通知 +export function deleteAllNotification(data) { + return request({ + url: '/notifications/deleteAll', + method: 'POST', + data + }) +} + +// 删除通知 +export function deleteNotification(data) { + return request({ + url: '/notifications/delete', + method: 'POST', + data + }) +} diff --git a/manifest.json b/manifest.json index bca47ef..4f4f363 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "wx-starlock", "appid" : "__UNI__933D519", "description" : "", - "versionName" : "1.0.2", - "versionCode" : "22", + "versionName" : "1.1.1", + "versionCode" : "28", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/pages.json b/pages.json index 66fb723..342e554 100644 --- a/pages.json +++ b/pages.json @@ -1,155 +1,180 @@ { - "easycom": { - "autoscan": true, - "custom": { - "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" - } - }, - "pages": [ - { - "path": "pages/home/home" - }, - { - "path": "pages/selectAddress/selectAddress", - "style": { - "navigationBarTitleText": "锁地址", - "disableScroll": true - } - }, - { - "path": "pages/mine/mine" - }, - { - "path": "pages/userInfo/userInfo", - "style": { - "navigationBarTitleText": "个人信息" - } - }, - { - "path": "pages/updateName/updateName", - "style": { - "navigationBarTitleText": "修改昵称" - } - }, - { - "path": "pages/updatePassword/updatePassword", - "style": { - "navigationBarTitleText": "重置密码" - } - }, - { - "path": "pages/updateEmail/updateEmail", - "style": { - "navigationBarTitleText": "修改邮箱" - } - }, - { - "path": "pages/verifyEmail/verifyEmail", - "style": { - "navigationBarTitleText": "验证邮箱" - } - }, - { - "path": "pages/webview/webview", - "style": { - "navigationBarTitleText": "介绍" - } - }, - { - "path": "pages/lockDetail/lockDetail", - "style": { - "navigationBarTitleText": "星星锁" - } - }, - { - "path": "pages/bindLock/bindLock", - "style": { - "navigationBarTitleText": "添加锁" - } - }, - { - "path": "pages/searchDevice/searchDevice", - "style": { - "disableScroll": true, - "navigationBarTitleText": "附近设备" - } - }, - { - "path": "pages/setting/setting", - "style": { - "navigationBarTitleText": "设置" - } - }, - { - "path": "pages/keyList/keyList", - "style": { - "disableScroll": true, - "navigationBarTitleText": "电子钥匙" - } - }, - { - "path": "pages/createKey/createKey", - "style": { - "navigationBarTitleText": "发送钥匙" - } - }, - { - "path": "pages/passwordList/passwordList", - "style": { - "disableScroll": true, - "navigationBarTitleText": "密码" - } - }, - { - "path": "pages/createPassword/createPassword", - "style": { - "disableScroll": true, - "navigationBarTitleText": "获取密码" - } - }, - { - "path": "pages/passwordDetail/passwordDetail", - "style": { - "disableScroll": true, - "navigationBarTitleText": "密码详情" - } - }, - { - "path": "pages/keyDetail/keyDetail", - "style": { - "disableScroll": true, - "navigationBarTitleText": "钥匙详情" - } - } - ], - "globalStyle": { - "navigationBarTextStyle": "white", - "navigationBarTitleText": "星星锁", - "navigationBarBackgroundColor": "#63b8af", - "backgroundColor": "#F3F3F3", - "navigationStyle": "default" - }, - "tabBar": { - "color": "#a3a3a3", - "selectedColor": "#63b8af", - "borderStyle": "white", - "backgroundColor": "#FFFFFF", - "position": "bottom", - "list": [ - { - "pagePath": "pages/home/home", - "iconPath": "static/images/tabbar_key_no_select.png", - "selectedIconPath": "static/images/tabbar_key_select.png", - "text": "设备" - }, - { - "pagePath": "pages/mine/mine", - "iconPath": "static/images/tabbar_mine_no_select.png", - "selectedIconPath": "static/images/tabbar_mine_select.png", - "text": "我的" - } - ] - } + "easycom": { + "autoscan": true, + "custom": { + "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" + } + }, + "pages": [ + { + "path": "pages/home/home" + }, + { + "path": "pages/selectAddress/selectAddress", + "style": { + "navigationBarTitleText": "锁地址", + "disableScroll": true + } + }, + { + "path": "pages/mine/mine" + }, + { + "path": "pages/userInfo/userInfo", + "style": { + "navigationBarTitleText": "个人信息" + } + }, + { + "path": "pages/updateName/updateName", + "style": { + "navigationBarTitleText": "修改昵称" + } + }, + { + "path": "pages/updatePassword/updatePassword", + "style": { + "navigationBarTitleText": "重置密码" + } + }, + { + "path": "pages/updateEmail/updateEmail", + "style": { + "navigationBarTitleText": "修改邮箱" + } + }, + { + "path": "pages/verifyEmail/verifyEmail", + "style": { + "navigationBarTitleText": "验证邮箱" + } + }, + { + "path": "pages/webview/webview", + "style": { + "navigationBarTitleText": "介绍" + } + }, + { + "path": "pages/lockDetail/lockDetail", + "style": { + "navigationBarTitleText": "星星锁" + } + }, + { + "path": "pages/bindLock/bindLock", + "style": { + "navigationBarTitleText": "添加锁" + } + }, + { + "path": "pages/searchDevice/searchDevice", + "style": { + "disableScroll": true, + "navigationBarTitleText": "附近设备" + } + }, + { + "path": "pages/setting/setting", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "pages/keyList/keyList", + "style": { + "disableScroll": true, + "navigationBarTitleText": "电子钥匙" + } + }, + { + "path": "pages/createKey/createKey", + "style": { + "navigationBarTitleText": "发送钥匙" + } + }, + { + "path": "pages/passwordList/passwordList", + "style": { + "disableScroll": true, + "navigationBarTitleText": "密码" + } + }, + { + "path": "pages/createPassword/createPassword", + "style": { + "disableScroll": true, + "navigationBarTitleText": "获取密码" + } + }, + { + "path": "pages/passwordDetail/passwordDetail", + "style": { + "disableScroll": true, + "navigationBarTitleText": "密码详情" + } + }, + { + "path": "pages/keyDetail/keyDetail", + "style": { + "disableScroll": true, + "navigationBarTitleText": "钥匙详情" + } + }, + { + "path": "pages/notificationList/notificationList", + "style": { + "navigationBarTitleText": "通知列表" + } + }, + { + "path": "pages/notificationDetail/notificationDetail", + "style": { + "navigationBarTitleText": "消息详情" + } + }, + { + "path": "pages/addLockGuid/addLockGuid", + "style": { + "navigationBarTitleText": "添加锁", + "disableScroll": true + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "星星锁", + "navigationBarBackgroundColor": "#63b8af", + "backgroundColor": "#F3F3F3", + "navigationStyle": "default" + }, + "tabBar": { + "color": "#a3a3a3", + "selectedColor": "#63b8af", + "borderStyle": "white", + "backgroundColor": "#FFFFFF", + "position": "bottom", + "list": [ + { + "pagePath": "pages/home/home", + "iconPath": "static/images/tabbar_key_no_select.png", + "selectedIconPath": "static/images/tabbar_key_select.png", + "text": "设备" + }, + { + "pagePath": "pages/notificationList/notificationList", + "iconPath": "static/images/tabbar_notification_no_select.png", + "selectedIconPath": "static/images/tabbar_notification_select.png", + "text": "消息" + }, + { + "pagePath": "pages/mine/mine", + "iconPath": "static/images/tabbar_mine_no_select.png", + "selectedIconPath": "static/images/tabbar_mine_select.png", + "text": "我的" + } + ] + } } diff --git a/pages/addLockGuid/addLockGuid.vue b/pages/addLockGuid/addLockGuid.vue new file mode 100644 index 0000000..02fbbb7 --- /dev/null +++ b/pages/addLockGuid/addLockGuid.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/pages/home/home.vue b/pages/home/home.vue index fd34b7b..98bb142 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -5,16 +5,16 @@ - + + v-model="lockSearch.searchStr" bgColor="#ffffff" :showAction="false" maxlength="50"> - 填加锁时,手机必须在锁旁边 + 添加锁时,手机必须在锁旁边 @@ -77,7 +77,7 @@ - @@ -124,7 +124,7 @@ ...mapState(useLockStore, ['lockList', 'lockTotal', 'lockSearch']), ...mapState(useBluetoothStore, ['bluetoothStatus', 'isInitBluetooth', 'keyId', 'currentLockInfo']), }, - async onLoad() { + async onLoad(data) { uni.showLoading({ title: '加载中', mask: true @@ -158,6 +158,8 @@ this.penging = false uni.hideLoading() } + const _data = JSON.parse(JSON.stringify(data)) + this.shareJump(_data) }, methods: { timeFormat, @@ -165,7 +167,7 @@ ...mapActions(useLockStore, ['getLockList', 'updateLockList', 'getRole', 'getTimeLimit', 'updateLockSearch', 'getPowerIcon']), ...mapActions(useBluetoothStore, ['getBluetoothStatus', 'initAndListenBluetooth', 'updateCurrentLockInfo', 'checkSetting', 'updateKeyId', 'resetDevice']), - ...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo', 'getNetworkType']), + ...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo', 'getNetworkType', 'shareJump']), async deleteLock(lock, groupIndex, lockIndex) { const that = this const netWork = await this.getNetworkType() @@ -403,21 +405,9 @@ this.focus = false }, async toSearchDevice() { - if(this.bluetoothStatus !== 0) { - this.getBluetoothStatus() - return - } - let result = true - if(!this.isInitBluetooth) { - result = await this.initAndListenBluetooth() - } - if(result) { - this.routeJump({ - name: 'searchDevice' - }) - } else { - this.checkSetting() - } + this.routeJump({ + name: 'addLockGuid' + }) }, async toLockDeatil(lock) { if(!(this.bluetoothStatus === 0 || this.bluetoothStatus === -1)) { @@ -620,7 +610,7 @@ page { .button-add-big { width: 400rpx; height: 400rpx; - margin-top: 250rpx; + margin-top: 300rpx; margin-left: 136rpx; } diff --git a/pages/keyList/keyList.vue b/pages/keyList/keyList.vue index eab770d..6ee125f 100644 --- a/pages/keyList/keyList.vue +++ b/pages/keyList/keyList.vue @@ -6,7 +6,7 @@ + v-model="keySearch.searchStr" bgColor="#ffffff" :showAction="false" maxlength="50"> diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index 7ae0dea..208e83e 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -1,7 +1,5 @@