// pages/addUser/addUser.ts Page({ data: { userType: 'employee', employeeId: '9527', employeeInfo: { name: '王旭', company: '技术部·研发组', gender: '男', age: '32岁' }, height: '', weight: '' }, /** tabs 切换:清空查询结果、重置表单 */ onTabTap(e: WechatMiniprogram.TouchEvent) { const tab = e.currentTarget.dataset.value as string this.setData({ userType: tab as 'employee' | 'family', }) }, onTapType(e: WechatMiniprogram.TouchEvent) { const type = e.currentTarget.dataset.type as string this.setData({ userType: type }) }, onCancel() { wx.navigateBack({ delta: 1 }) }, onSave() { // 保存用户信息(待接入) } })