This commit is contained in:
刘正航
2026-04-21 22:45:19 +08:00
commit b5237f9038
159 changed files with 7769 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
const { request } = require('../../utils/request')
Page({
data: {
form: {
username: '',
password: '',
nickname: '',
company: '',
title: '',
phone: ''
},
loading: false
},
onInput(e) {
const field = e.currentTarget.dataset.field
this.setData({ [`form.${field}`]: (e.detail.value || '').trim() })
},
async submit() {
if (this.data.loading) return
const { username, password } = this.data.form
if (!username || !password) {
wx.showToast({ title: '用户名和密码必填', icon: 'none' })
return
}
this.setData({ loading: true })
try {
await request({ url: '/auth/register', method: 'POST', data: this.data.form })
wx.showToast({ title: '注册成功', icon: 'success' })
setTimeout(() => wx.navigateBack(), 350)
} finally {
this.setData({ loading: false })
}
}
})