From d9158dcc99d77a200542630e84a684a3d2d77ac6 Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Fri, 6 Jun 2025 15:20:34 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E7=9A=84=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 + pages/feature/createKey.vue | 2 + pages/feature/createPassword.vue | 21 +++++++---- pages/main/customBox.vue | 2 + pages/main/lockDetail.vue | 4 ++ pages/main/mine.vue | 2 +- pages/main/notificationList.vue | 64 ++++++++++++++++---------------- pages/p2p/p2pPlayer.vue | 2 + stores/basic.js | 2 +- 9 files changed, 59 insertions(+), 42 deletions(-) diff --git a/App.vue b/App.vue index 830976a..504e94b 100644 --- a/App.vue +++ b/App.vue @@ -19,6 +19,7 @@ sn: '', // 获取环境配置 getEnvConfig() { + // #ifdef MP-WEIXIN const envVersionStorage = getStorage('envVersion') if (envVersionStorage) { return envVersionStorage @@ -29,6 +30,7 @@ if (this.envVersion === 'trial') { return 'XHJ' } + // #endif return 'DEV' } }, diff --git a/pages/feature/createKey.vue b/pages/feature/createKey.vue index 9aa6a21..0c60bed 100644 --- a/pages/feature/createKey.vue +++ b/pages/feature/createKey.vue @@ -275,7 +275,9 @@ } const { code, data, message } = await createKeyRequest(params) if (code === 0) { + // #ifdef MP-WEIXIN uni.reportEvent('create_key', {}) + // #endif this.updateKeySearch({ ...this.keySearch, pageNo: 1 diff --git a/pages/feature/createPassword.vue b/pages/feature/createPassword.vue index d6cf61b..fb2bb49 100644 --- a/pages/feature/createPassword.vue +++ b/pages/feature/createPassword.vue @@ -455,7 +455,9 @@ }) uni.hideLoading() if (requestCode === 0) { + // #ifdef MP-WEIXIN uni.reportEvent('create_password', {}) + // #endif $lock.updatePasswordSearch({ ...$lock.passwordSearch, pageNo: 1 @@ -562,7 +564,10 @@ } const { code, data, message } = await createPsaawordRequest(params) if (code === 0) { + // #ifdef MP-WEIXIN uni.reportEvent('create_password', {}) + // #endif + $lock.updatePasswordSearch({ ...$lock.passwordSearch, pageNo: 1 @@ -638,23 +643,23 @@ } .text { + padding: 0 32rpx; margin-top: 40rpx; margin-bottom: 50rpx; - color: #262626; font-size: 26rpx; - padding: 0 32rpx; + color: #262626; } .button { - border-radius: 64rpx; width: 686rpx; - margin-left: 32rpx; height: 100rpx; - line-height: 100rpx; - text-align: center; - background-color: #63b8af; - color: #fff; + margin-left: 32rpx; font-size: 32rpx; font-weight: bold; + line-height: 100rpx; + color: #fff; + text-align: center; + background-color: #63b8af; + border-radius: 64rpx; } diff --git a/pages/main/customBox.vue b/pages/main/customBox.vue index 50031ff..17b474e 100644 --- a/pages/main/customBox.vue +++ b/pages/main/customBox.vue @@ -129,10 +129,12 @@ $bluetooth.closeBluetoothConnection() }) + // #ifdef MP-WEIXIN uni.reportEvent('open_door', { result: code, duration: new Date().getTime() - timestamp }) + // #endif if (code === 0) { uni.showToast({ diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue index 0b72e2e..2b85cb3 100644 --- a/pages/main/lockDetail.vue +++ b/pages/main/lockDetail.vue @@ -363,15 +363,19 @@ onlineToken: onlineToken.value }) if (type === 'open') { + // #ifdef MP-WEIXIN uni.reportEvent('open_door', { result: code, duration: new Date().getTime() - timestamp }) + // #endif } else if (type === 'close') { + // #ifdef MP-WEIXIN uni.reportEvent('close_door', { result: code, duration: new Date().getTime() - timestamp }) + // #endif } if (code === 0) { $bluetooth diff --git a/pages/main/mine.vue b/pages/main/mine.vue index 4a3e249..67085e5 100644 --- a/pages/main/mine.vue +++ b/pages/main/mine.vue @@ -129,6 +129,7 @@ this.buttonInfo = await this.getButtonInfo() this.env = await env[await getApp().globalData.getEnvConfig()] this.envVersion = getApp().globalData.envVersion + // eslint-disable-next-line guard-for-in,no-restricted-syntax for (let key in env) { this.envList.push({ @@ -136,7 +137,6 @@ key }) } - console.log(this.envList) }, methods: { ...mapActions(useBasicStore, ['getButtonInfo', 'routeJump']), diff --git a/pages/main/notificationList.vue b/pages/main/notificationList.vue index 17337d0..89956f9 100644 --- a/pages/main/notificationList.vue +++ b/pages/main/notificationList.vue @@ -322,18 +322,18 @@ } .u-swipe-action { - overflow: inherit !important; - width: 700rpx; display: flex; flex-wrap: wrap; justify-content: space-between; + width: 700rpx; padding-bottom: 140rpx !important; + overflow: inherit !important; } .u-swipe-action-item { overflow: inherit !important; - border-radius: 32rpx !important; background: transparent !important; + border-radius: 32rpx !important; } .u-swipe-action-item__right { @@ -342,8 +342,8 @@ } .u-swipe-action-item__content { - border-radius: 32rpx !important; margin-left: 25rpx; + border-radius: 32rpx !important; } .u-swipe-action-item__right__button { @@ -357,14 +357,14 @@ } .notification { - border-radius: 32rpx; - margin-top: 32rpx; + position: relative; display: flex; + align-items: center; + justify-content: space-between; width: 636rpx; padding: 32rpx; - justify-content: space-between; - align-items: center; - position: relative; + margin-top: 32rpx; + border-radius: 32rpx; box-shadow: 2rpx 2rpx 10rpx rgba(0, 0, 0, 0.3); .icon { @@ -373,44 +373,44 @@ } .point { + position: absolute; + top: 41rpx; + left: 72rpx; width: 16rpx; height: 16rpx; background-color: #ff0000; border-radius: 50%; - position: absolute; - top: 41rpx; - left: 72rpx; } .content { width: 550rpx; - font-size: 28rpx; - color: #6c6c6c; - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + font-size: 28rpx; font-weight: bold; + color: #6c6c6c; + white-space: nowrap; } .time { - font-size: 24rpx; - color: #6c6c6c; margin-top: 5rpx; + font-size: 24rpx; font-weight: bold; + color: #6c6c6c; } } .delete { + position: fixed; + right: 30rpx; + bottom: 80rpx; + display: flex; + align-items: center; + justify-content: center; width: 100rpx; height: 100rpx; - border-radius: 50%; background-color: #5db5aa; - position: fixed; - bottom: 80rpx; - right: 30rpx; - display: flex; - justify-content: center; - align-items: center; + border-radius: 50%; .delete-image { width: 45rpx; @@ -426,29 +426,29 @@ } .empty-list-text { - text-align: center; font-size: 32rpx; color: #999999; + text-align: center; } .tips { - margin-top: 40vh; padding: 32rpx 0; - text-align: center; + margin-top: 40vh; font-size: 28rpx; color: #999999; + text-align: center; } .button-login { - border-radius: 46rpx; width: 650rpx; height: 120rpx; - line-height: 120rpx; - text-align: center; margin-left: 50rpx; - background: #63b8af; - color: #ffffff; font-size: 48rpx; font-weight: bold; + line-height: 120rpx; + color: #ffffff; + text-align: center; + background: #63b8af; + border-radius: 46rpx; } diff --git a/pages/p2p/p2pPlayer.vue b/pages/p2p/p2pPlayer.vue index 3ae152b..2359966 100644 --- a/pages/p2p/p2pPlayer.vue +++ b/pages/p2p/p2pPlayer.vue @@ -286,10 +286,12 @@ $bluetooth.closeBluetoothConnection() }) + // #ifdef MP-WEIXIN uni.reportEvent('open_door', { result: code, duration: new Date().getTime() - timestamp }) + // #endif if (code === 0) { uni.showToast({ diff --git a/stores/basic.js b/stores/basic.js index 300a5a0..91c4afb 100644 --- a/stores/basic.js +++ b/stores/basic.js @@ -440,7 +440,7 @@ export const useBasicStore = defineStore('basic', { // 设备信息 deviceInfo: null, // 胶囊按钮的位置信息 - buttonInfo: null, + buttonInfo: {}, // 分享配置 shareConfig: {} } From 79ce6203829e582a9798cb402933023e6ba979a5 Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Fri, 6 Jun 2025 15:43:01 +0800 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0manifest.json?= =?UTF-8?q?=E5=92=8Cpages.json=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=9B=BE=E6=A0=87=E5=92=8C=E9=A1=B5=E9=9D=A2=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E7=A6=81=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 145 ++++++++++++++++++++++++++++++++++++-------------- pages.json | 9 ++-- 2 files changed, 112 insertions(+), 42 deletions(-) diff --git a/manifest.json b/manifest.json index f1b7ea3..a906b3e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,42 +1,109 @@ { - "name" : "wx-starlock", - "appid" : "__UNI__933D519", - "description" : "", - "versionName" : "1.3.0", - "versionCode" : "37", - "mp-weixin" : { - "appid" : "wx9829a39e65550757", - "setting" : { - "urlCheck" : true, - "minified" : true - }, - "permission" : { - "scope.bluetooth" : { - "desc" : "蓝牙将用于控制和管理您的智能门锁" - } - }, - "requiredPrivateInfos" : [ "getLocation" ], - "usingComponents" : true, - "lazyCodeLoading" : "requiredComponents", - "optimization" : { - "subPackages" : true - }, - "plugins" : { - "xp2p" : { - "version" : "latest", - "provider" : "wx1319af22356934bf", - "export" : "exportForXp2pPlugin.js" - }, - "wmpf-voip" : { - "version" : "latest", - "provider" : "wxf830863afde621eb", - "genericsImplementation" : { - "call-page-plugin" : { - "custombox" : "pages/main/customBox" - } - } - } - } + "name": "wx-starlock", + "appid": "__UNI__933D519", + "description": "", + "versionName": "1.3.0", + "versionCode": "37", + "mp-weixin": { + "appid": "wx9829a39e65550757", + "setting": { + "urlCheck": true, + "minified": true }, - "vueVersion" : "3" + "permission": { + "scope.bluetooth": { + "desc": "蓝牙将用于控制和管理您的智能门锁" + } + }, + "requiredPrivateInfos": ["getLocation"], + "usingComponents": true, + "lazyCodeLoading": "requiredComponents", + "optimization": { + "subPackages": true + }, + "plugins": { + "xp2p": { + "version": "latest", + "provider": "wx1319af22356934bf", + "export": "exportForXp2pPlugin.js" + }, + "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": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "modules": { + "Bluetooth": {} + }, + "splashscreen": { + "waiting": false + } + } } diff --git a/pages.json b/pages.json index b06cfb4..cf2e4a7 100644 --- a/pages.json +++ b/pages.json @@ -116,19 +116,22 @@ { "path": "login", "style": { - "navigationBarTitleText": "登录" + "navigationBarTitleText": "登录", + "disableScroll": true } }, { "path": "register", "style": { - "navigationBarTitleText": "注册" + "navigationBarTitleText": "注册", + "disableScroll": true } }, { "path": "forgotPassword", "style": { - "navigationBarTitleText": "忘记密码" + "navigationBarTitleText": "忘记密码", + "disableScroll": true } }, { From d38a578c052b689f881fda674fcfe4db398a1282 Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Mon, 9 Jun 2025 10:08:40 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8E=88=E6=9D=83=E7=9B=B8=E5=85=B3=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/p2p/authorizeWechat.vue | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pages/p2p/authorizeWechat.vue b/pages/p2p/authorizeWechat.vue index a87155f..0334a35 100644 --- a/pages/p2p/authorizeWechat.vue +++ b/pages/p2p/authorizeWechat.vue @@ -78,15 +78,20 @@ const data = list.value.find(item => item.sn === authResult.data.wxDeviceSn) - if (authResult?.code === 0 && authResult?.data?.wxOpenid === getStorage('openid') && data) { - isAuthorized.value = true - requestFinish.value = true - if (data.status === 1) { - reject.value = false - } else if (data.status === 0) { + if (authResult?.code === 0 && data) { + if (authResult?.data?.wxOpenid === getStorage('openid')) { + if (data.status === 1) { + reject.value = false + } else if (data.status === 0) { + reject.value = false + weChatTicketsFlag.value = false + } + } else { reject.value = true weChatTicketsFlag.value = true } + isAuthorized.value = true + requestFinish.value = true uni.hideLoading() } else { requestFinish.value = true @@ -125,6 +130,8 @@ }) uni.hideLoading() isAuthorized.value = true + reject.value = false + weChatTicketsFlag.value = false } else { uni.hideLoading() uni.showToast({ @@ -220,6 +227,8 @@ wxDeviceSn: result.data.WXIoTDeviceInfo.SN } }) + reject.value = false + weChatTicketsFlag.value = false uni.showToast({ title: '授权成功', icon: 'none' From 056ccd463e47600c7be3e6914ea1101846285fad Mon Sep 17 00:00:00 2001 From: fanpeng <438123081@qq.com> Date: Mon, 9 Jun 2025 14:37:37 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=99=BB=E5=BD=95=E4=B8=8E=E4=B8=8A=E4=BC=A0=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 9 +++ pages/main/mine.vue | 26 ++++++- pages/user/updateEmail.vue | 51 +++++++------ pages/user/updateName.vue | 24 +++---- pages/user/updatePassword.vue | 53 +++++++------- pages/user/userInfo.vue | 132 ++++++++++++++++++++++------------ pages/user/verifyEmail.vue | 39 +++++----- 7 files changed, 204 insertions(+), 130 deletions(-) diff --git a/api/user.js b/api/user.js index c927885..a160ff4 100644 --- a/api/user.js +++ b/api/user.js @@ -136,3 +136,12 @@ export function getWebUrlRequest(data) { data }) } + +// 退出登录 +export function logoutRequest(data) { + return request({ + url: '/v3/user/logout', + method: 'POST', + data + }) +} diff --git a/pages/main/mine.vue b/pages/main/mine.vue index 67085e5..5af3ffe 100644 --- a/pages/main/mine.vue +++ b/pages/main/mine.vue @@ -56,9 +56,14 @@ >切换环境 + + + + + 因智能门锁与账号绑定,登录为手机号登录 @@ -105,7 +110,7 @@ import { useBasicStore } from '@/stores/basic' import { useUserStore } from '@/stores/user' import { useLockStore } from '@/stores/lock' - import { phoneLoginRequest } from '@/api/user' + import { phoneLoginRequest, logoutRequest } from '@/api/user' import env from '@/config/env' import { setStorage, getStorage, removeStorage } from '@/utils/storage' import { useNotificationStore } from '@/stores/notification' @@ -260,6 +265,25 @@ type } }) + }, + logout() { + uni.showModal({ + title: '提示', + content: '确定退出登录吗?', + success: async res => { + if (res.confirm) { + await logoutRequest() + removeStorage('token') + removeStorage('openid') + removeStorage('userInfo') + removeStorage('lockList') + this.routeJump({ + name: 'login', + type: 'reLaunch' + }) + } + } + }) } } } diff --git a/pages/user/updateEmail.vue b/pages/user/updateEmail.vue index 1999c9a..441b380 100644 --- a/pages/user/updateEmail.vue +++ b/pages/user/updateEmail.vue @@ -168,28 +168,27 @@ } .input-email { - border-radius: 16rpx; - background: #ffffff; - margin-left: 35rpx; - margin-top: 48rpx; - height: 108rpx; width: 616rpx; - padding-left: 32rpx; + height: 108rpx; padding-right: 32rpx; + padding-left: 32rpx; + margin-top: 48rpx; + margin-left: 35rpx; + background: #ffffff; + border-radius: 16rpx; } .button-verify { - margin-top: 48rpx; - height: 108rpx; width: 265rpx; - line-height: 108rpx; - border-radius: 16rpx; - text-align: center; - font-size: 32rpx; + height: 108rpx; + margin-top: 48rpx; margin-left: 35rpx; - - background: #63b8af; + font-size: 32rpx; + line-height: 108rpx; color: #ffffff; + text-align: center; + background: #63b8af; + border-radius: 16rpx; } .view-top { @@ -198,14 +197,14 @@ } .input-verify { - border-radius: 16rpx; - background: #ffffff; - margin-left: 35rpx; - margin-top: 48rpx; - height: 108rpx; width: 316rpx; - padding-left: 32rpx; + height: 108rpx; padding-right: 32rpx; + padding-left: 32rpx; + margin-top: 48rpx; + margin-left: 35rpx; + background: #ffffff; + border-radius: 16rpx; } .input-placeholder { @@ -216,15 +215,15 @@ } .button { - margin-top: 32rpx; - margin-left: 35rpx; width: 680rpx; height: 96rpx; + margin-top: 32rpx; + margin-left: 35rpx; + font-size: 32rpx; + line-height: 96rpx; + color: #ffffff; + text-align: center; background: #63b8af; border-radius: 16rpx; - line-height: 96rpx; - text-align: center; - font-size: 32rpx; - color: #ffffff; } diff --git a/pages/user/updateName.vue b/pages/user/updateName.vue index 229b3b5..ca237d2 100644 --- a/pages/user/updateName.vue +++ b/pages/user/updateName.vue @@ -84,14 +84,14 @@ diff --git a/pages/user/updatePassword.vue b/pages/user/updatePassword.vue index 031d61b..ba2acca 100644 --- a/pages/user/updatePassword.vue +++ b/pages/user/updatePassword.vue @@ -145,14 +145,14 @@ diff --git a/pages/user/userInfo.vue b/pages/user/userInfo.vue index d69cfe3..c6f907b 100644 --- a/pages/user/userInfo.vue +++ b/pages/user/userInfo.vue @@ -1,6 +1,7 @@