feat(userManagement): 长按标题弹窗确认后重置设备用户并上报

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-09-04 17:36:48 +08:00
co-authored by Claude Opus 4.7
parent 507915f2c4
commit 69d8fa75a5
@@ -344,15 +344,30 @@ Page({
})
},
/** 长按标题:清除设备用户信息并全部重新下发(不上报) */
/** 长按标题:弹窗确认后重置设备用户 */
onLongPressSectionTitle() {
wx.showModal({
title: '重置设备用户',
content: '清除设备用户,重新下发',
cancelText: '取消',
confirmText: '确定',
success: (res) => {
if (!res.confirm) return
this._doReset()
},
})
},
/** 清空设备用户,重新下发全部正常用户,并按同数量上报用户 id */
_doReset() {
if (!this._ensureConnected()) return
const allUsers = this._buildAllUsers()
if (!allUsers.length) {
const normalUsers = allUsers.filter(u => u.delFlag !== 1)
if (!normalUsers.length) {
wx.showToast({ title: '暂无用户可下发', icon: 'none' })
return
}
this._clearAndSync(allUsers, null)
this._clearAndSync(normalUsers, normalUsers)
},
/** 清除设备用户后重新下发;reportUsers 为 null 时不上报后台 */