feat:登录注册完成

This commit is contained in:
李伊帆
2026-10-09 14:29:58 +08:00
parent da83a58948
commit ee3ecc00eb
106 changed files with 4937 additions and 59 deletions

View File

@@ -0,0 +1,42 @@
import { ref } from 'vue'
const ROOM_OPTIONS = ['客厅', '主卧', '卧室', '厨房', '卫生间']
export function useCompleteDevice() {
const currentStep = 4
const deviceName = ref('Z2 空气净化器')
const serialMasked = ref('****A3B2')
const roomName = ref('客厅')
const roomOptions = ROOM_OPTIONS
function onPickRoom() {
uni.showActionSheet({
itemList: roomOptions,
success: (res) => {
const picked = roomOptions[res.tapIndex]
if (picked) roomName.value = picked
},
})
}
function onFinishAdd() {
const name = deviceName.value.trim()
if (!name) {
uni.showToast({ title: '请输入设备名称', icon: 'none' })
return
}
uni.showToast({ title: '添加成功', icon: 'success' })
setTimeout(() => {
uni.reLaunch({ url: '/pages/device/index' })
}, 400)
}
return {
currentStep,
deviceName,
serialMasked,
roomName,
onPickRoom,
onFinishAdd,
}
}