1. 添加说明性文案
2. 修复开关门bug
This commit is contained in:
parent
e97763af57
commit
2a55f76d6a
@ -50,6 +50,7 @@
|
|||||||
class="button-add" @click="toSearchDevice"></image>
|
class="button-add" @click="toSearchDevice"></image>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
|
<view class="tips">因智能门锁与账号绑定,登录为手机号登录</view>
|
||||||
<label for="phone">
|
<label for="phone">
|
||||||
<view class="button-login">登录</view>
|
<view class="button-login">登录</view>
|
||||||
</label>
|
</label>
|
||||||
@ -263,7 +264,6 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button-login {
|
.button-login {
|
||||||
margin-top: 40vh;
|
|
||||||
border-radius: 46rpx;
|
border-radius: 46rpx;
|
||||||
width: 650rpx;
|
width: 650rpx;
|
||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
@ -388,4 +388,12 @@ page {
|
|||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
margin-top: 40vh;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
<view class="button-logout" @click="logout">退出</view>
|
<view class="button-logout" @click="logout">退出</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
|
<view class="tips">因智能门锁与账号绑定,登录为手机号登录</view>
|
||||||
<label for="phone">
|
<label for="phone">
|
||||||
<view class="button-login">登录</view>
|
<view class="button-login">登录</view>
|
||||||
</label>
|
</label>
|
||||||
@ -232,7 +233,6 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button-login {
|
.button-login {
|
||||||
margin-top: 40vh;
|
|
||||||
border-radius: 46rpx;
|
border-radius: 46rpx;
|
||||||
width: 650rpx;
|
width: 650rpx;
|
||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
@ -244,4 +244,12 @@ page {
|
|||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
margin-top: 35vh;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
|
<view class="tips">为了你的账号安全,修改账号前请先使用验证码验证</view>
|
||||||
<view class="view-top">
|
<view class="view-top">
|
||||||
<input type="number" class="input" :value="verificationCode" maxlength="20" placeholder="请输入验证码"
|
<input type="number" class="input" :value="verificationCode" maxlength="20" placeholder="请输入验证码"
|
||||||
placeholder-class="input-placeholder" @input="updateInput"></input>
|
placeholder-class="input-placeholder" @input="updateInput"></input>
|
||||||
@ -99,6 +100,12 @@ page {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.tips {
|
||||||
|
padding: 24rpx 32rpx 0 32rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
.button-verify {
|
.button-verify {
|
||||||
margin-top: 48rpx;
|
margin-top: 48rpx;
|
||||||
height: 108rpx;
|
height: 108rpx;
|
||||||
|
|||||||
@ -644,37 +644,24 @@ export const useBluetoothStore = defineStore('ble', {
|
|||||||
const that = this
|
const that = this
|
||||||
let timer1
|
let timer1
|
||||||
let timer2
|
let timer2
|
||||||
const flag = true
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
uni.startBluetoothDevicesDiscovery({
|
uni.startBluetoothDevicesDiscovery({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
timer2 = setTimeout(() => {
|
timer2 = setTimeout(() => {
|
||||||
setTimeout(() => {
|
|
||||||
if(flag) {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '长时间未搜索到任何设备,请确认微信的附近设备权限开启后再试',
|
|
||||||
showCancel: false,
|
|
||||||
confirmText: '确定',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
uni.stopBluetoothDevicesDiscovery()
|
uni.stopBluetoothDevicesDiscovery()
|
||||||
clearInterval(timer1)
|
clearInterval(timer1)
|
||||||
}, 10000)
|
}, 10500)
|
||||||
timer1 = setInterval(() => {
|
timer1 = setInterval(() => {
|
||||||
uni.getBluetoothDevices({
|
uni.getBluetoothDevices({
|
||||||
success(res) {
|
success(res) {
|
||||||
const deviceList = res.devices
|
const deviceList = res.devices
|
||||||
if(deviceList.length !== 0) {
|
|
||||||
flag = false
|
|
||||||
}
|
|
||||||
for(let i = 0; i < deviceList.length; i++) {
|
for(let i = 0; i < deviceList.length; i++) {
|
||||||
if(deviceList[i]?.name === that.currentLockInfo.name) {
|
if(deviceList[i]?.name === that.currentLockInfo.name) {
|
||||||
const uuid = deviceList[i]?.advertisServiceUUIDs[0]
|
const uuid = deviceList[i]?.advertisServiceUUIDs[0]
|
||||||
if(uuid && uuid.slice(2,8)==='758824' && uuid.slice(30,32)==='01') {
|
if(uuid && uuid.slice(2,8)==='758824' && uuid.slice(30,32)==='01') {
|
||||||
clearInterval(timer1)
|
|
||||||
clearInterval(timer2)
|
|
||||||
uni.stopBluetoothDevicesDiscovery()
|
uni.stopBluetoothDevicesDiscovery()
|
||||||
|
clearTimeout(timer2)
|
||||||
|
clearInterval(timer1)
|
||||||
resolve(deviceList[i].deviceId)
|
resolve(deviceList[i].deviceId)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -690,7 +677,6 @@ export const useBluetoothStore = defineStore('ble', {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}, 300)
|
|
||||||
},
|
},
|
||||||
fail: async function (res) {
|
fail: async function (res) {
|
||||||
console.log('开始搜索失败', res)
|
console.log('开始搜索失败', res)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user