fix: 解决发现的兼容问题

This commit is contained in:
fanpeng 2025-06-06 15:20:34 +08:00
parent 4c7c1af3f5
commit d9158dcc99
9 changed files with 59 additions and 42 deletions

View File

@ -19,6 +19,7 @@
sn: '', sn: '',
// //
getEnvConfig() { getEnvConfig() {
// #ifdef MP-WEIXIN
const envVersionStorage = getStorage('envVersion') const envVersionStorage = getStorage('envVersion')
if (envVersionStorage) { if (envVersionStorage) {
return envVersionStorage return envVersionStorage
@ -29,6 +30,7 @@
if (this.envVersion === 'trial') { if (this.envVersion === 'trial') {
return 'XHJ' return 'XHJ'
} }
// #endif
return 'DEV' return 'DEV'
} }
}, },

View File

@ -275,7 +275,9 @@
} }
const { code, data, message } = await createKeyRequest(params) const { code, data, message } = await createKeyRequest(params)
if (code === 0) { if (code === 0) {
// #ifdef MP-WEIXIN
uni.reportEvent('create_key', {}) uni.reportEvent('create_key', {})
// #endif
this.updateKeySearch({ this.updateKeySearch({
...this.keySearch, ...this.keySearch,
pageNo: 1 pageNo: 1

View File

@ -455,7 +455,9 @@
}) })
uni.hideLoading() uni.hideLoading()
if (requestCode === 0) { if (requestCode === 0) {
// #ifdef MP-WEIXIN
uni.reportEvent('create_password', {}) uni.reportEvent('create_password', {})
// #endif
$lock.updatePasswordSearch({ $lock.updatePasswordSearch({
...$lock.passwordSearch, ...$lock.passwordSearch,
pageNo: 1 pageNo: 1
@ -562,7 +564,10 @@
} }
const { code, data, message } = await createPsaawordRequest(params) const { code, data, message } = await createPsaawordRequest(params)
if (code === 0) { if (code === 0) {
// #ifdef MP-WEIXIN
uni.reportEvent('create_password', {}) uni.reportEvent('create_password', {})
// #endif
$lock.updatePasswordSearch({ $lock.updatePasswordSearch({
...$lock.passwordSearch, ...$lock.passwordSearch,
pageNo: 1 pageNo: 1
@ -638,23 +643,23 @@
} }
.text { .text {
padding: 0 32rpx;
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: 50rpx; margin-bottom: 50rpx;
color: #262626;
font-size: 26rpx; font-size: 26rpx;
padding: 0 32rpx; color: #262626;
} }
.button { .button {
border-radius: 64rpx;
width: 686rpx; width: 686rpx;
margin-left: 32rpx;
height: 100rpx; height: 100rpx;
line-height: 100rpx; margin-left: 32rpx;
text-align: center;
background-color: #63b8af;
color: #fff;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
line-height: 100rpx;
color: #fff;
text-align: center;
background-color: #63b8af;
border-radius: 64rpx;
} }
</style> </style>

View File

@ -129,10 +129,12 @@
$bluetooth.closeBluetoothConnection() $bluetooth.closeBluetoothConnection()
}) })
// #ifdef MP-WEIXIN
uni.reportEvent('open_door', { uni.reportEvent('open_door', {
result: code, result: code,
duration: new Date().getTime() - timestamp duration: new Date().getTime() - timestamp
}) })
// #endif
if (code === 0) { if (code === 0) {
uni.showToast({ uni.showToast({

View File

@ -363,15 +363,19 @@
onlineToken: onlineToken.value onlineToken: onlineToken.value
}) })
if (type === 'open') { if (type === 'open') {
// #ifdef MP-WEIXIN
uni.reportEvent('open_door', { uni.reportEvent('open_door', {
result: code, result: code,
duration: new Date().getTime() - timestamp duration: new Date().getTime() - timestamp
}) })
// #endif
} else if (type === 'close') { } else if (type === 'close') {
// #ifdef MP-WEIXIN
uni.reportEvent('close_door', { uni.reportEvent('close_door', {
result: code, result: code,
duration: new Date().getTime() - timestamp duration: new Date().getTime() - timestamp
}) })
// #endif
} }
if (code === 0) { if (code === 0) {
$bluetooth $bluetooth

View File

@ -129,6 +129,7 @@
this.buttonInfo = await this.getButtonInfo() this.buttonInfo = await this.getButtonInfo()
this.env = await env[await getApp().globalData.getEnvConfig()] this.env = await env[await getApp().globalData.getEnvConfig()]
this.envVersion = getApp().globalData.envVersion this.envVersion = getApp().globalData.envVersion
// eslint-disable-next-line guard-for-in,no-restricted-syntax // eslint-disable-next-line guard-for-in,no-restricted-syntax
for (let key in env) { for (let key in env) {
this.envList.push({ this.envList.push({
@ -136,7 +137,6 @@
key key
}) })
} }
console.log(this.envList)
}, },
methods: { methods: {
...mapActions(useBasicStore, ['getButtonInfo', 'routeJump']), ...mapActions(useBasicStore, ['getButtonInfo', 'routeJump']),

View File

@ -322,18 +322,18 @@
} }
.u-swipe-action { .u-swipe-action {
overflow: inherit !important;
width: 700rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
width: 700rpx;
padding-bottom: 140rpx !important; padding-bottom: 140rpx !important;
overflow: inherit !important;
} }
.u-swipe-action-item { .u-swipe-action-item {
overflow: inherit !important; overflow: inherit !important;
border-radius: 32rpx !important;
background: transparent !important; background: transparent !important;
border-radius: 32rpx !important;
} }
.u-swipe-action-item__right { .u-swipe-action-item__right {
@ -342,8 +342,8 @@
} }
.u-swipe-action-item__content { .u-swipe-action-item__content {
border-radius: 32rpx !important;
margin-left: 25rpx; margin-left: 25rpx;
border-radius: 32rpx !important;
} }
.u-swipe-action-item__right__button { .u-swipe-action-item__right__button {
@ -357,14 +357,14 @@
} }
.notification { .notification {
border-radius: 32rpx; position: relative;
margin-top: 32rpx;
display: flex; display: flex;
align-items: center;
justify-content: space-between;
width: 636rpx; width: 636rpx;
padding: 32rpx; padding: 32rpx;
justify-content: space-between; margin-top: 32rpx;
align-items: center; border-radius: 32rpx;
position: relative;
box-shadow: 2rpx 2rpx 10rpx rgba(0, 0, 0, 0.3); box-shadow: 2rpx 2rpx 10rpx rgba(0, 0, 0, 0.3);
.icon { .icon {
@ -373,44 +373,44 @@
} }
.point { .point {
position: absolute;
top: 41rpx;
left: 72rpx;
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
background-color: #ff0000; background-color: #ff0000;
border-radius: 50%; border-radius: 50%;
position: absolute;
top: 41rpx;
left: 72rpx;
} }
.content { .content {
width: 550rpx; width: 550rpx;
font-size: 28rpx;
color: #6c6c6c;
white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #6c6c6c;
white-space: nowrap;
} }
.time { .time {
font-size: 24rpx;
color: #6c6c6c;
margin-top: 5rpx; margin-top: 5rpx;
font-size: 24rpx;
font-weight: bold; font-weight: bold;
color: #6c6c6c;
} }
} }
.delete { .delete {
position: fixed;
right: 30rpx;
bottom: 80rpx;
display: flex;
align-items: center;
justify-content: center;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
border-radius: 50%;
background-color: #5db5aa; background-color: #5db5aa;
position: fixed; border-radius: 50%;
bottom: 80rpx;
right: 30rpx;
display: flex;
justify-content: center;
align-items: center;
.delete-image { .delete-image {
width: 45rpx; width: 45rpx;
@ -426,29 +426,29 @@
} }
.empty-list-text { .empty-list-text {
text-align: center;
font-size: 32rpx; font-size: 32rpx;
color: #999999; color: #999999;
text-align: center;
} }
.tips { .tips {
margin-top: 40vh;
padding: 32rpx 0; padding: 32rpx 0;
text-align: center; margin-top: 40vh;
font-size: 28rpx; font-size: 28rpx;
color: #999999; color: #999999;
text-align: center;
} }
.button-login { .button-login {
border-radius: 46rpx;
width: 650rpx; width: 650rpx;
height: 120rpx; height: 120rpx;
line-height: 120rpx;
text-align: center;
margin-left: 50rpx; margin-left: 50rpx;
background: #63b8af;
color: #ffffff;
font-size: 48rpx; font-size: 48rpx;
font-weight: bold; font-weight: bold;
line-height: 120rpx;
color: #ffffff;
text-align: center;
background: #63b8af;
border-radius: 46rpx;
} }
</style> </style>

View File

@ -286,10 +286,12 @@
$bluetooth.closeBluetoothConnection() $bluetooth.closeBluetoothConnection()
}) })
// #ifdef MP-WEIXIN
uni.reportEvent('open_door', { uni.reportEvent('open_door', {
result: code, result: code,
duration: new Date().getTime() - timestamp duration: new Date().getTime() - timestamp
}) })
// #endif
if (code === 0) { if (code === 0) {
uni.showToast({ uni.showToast({

View File

@ -440,7 +440,7 @@ export const useBasicStore = defineStore('basic', {
// 设备信息 // 设备信息
deviceInfo: null, deviceInfo: null,
// 胶囊按钮的位置信息 // 胶囊按钮的位置信息
buttonInfo: null, buttonInfo: {},
// 分享配置 // 分享配置
shareConfig: {} shareConfig: {}
} }