|
@@ -21,8 +21,8 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="form-item">
|
|
<view class="form-item">
|
|
|
- <text class="label">昵称</text>
|
|
|
|
|
- <input class="input" type="nickname" v-model="form.nickname" placeholder="请输入昵称" />
|
|
|
|
|
|
|
+ <text class="label">姓名</text>
|
|
|
|
|
+ <input class="input" type="nickname" v-model="form.nickname" placeholder="请输入姓名" />
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="form-item">
|
|
<view class="form-item">
|
|
@@ -80,8 +80,7 @@ const form = ref({
|
|
|
phone: '',
|
|
phone: '',
|
|
|
age: '',
|
|
age: '',
|
|
|
sex: 0,
|
|
sex: 0,
|
|
|
- address: '',
|
|
|
|
|
- phone2: ''
|
|
|
|
|
|
|
+ address: ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const region = ref<string[]>([])
|
|
const region = ref<string[]>([])
|
|
@@ -179,10 +178,33 @@ const getCurrentLocation = async () => {
|
|
|
|
|
|
|
|
const onSubmit = async () => {
|
|
const onSubmit = async () => {
|
|
|
if (submitting.value) return
|
|
if (submitting.value) return
|
|
|
- if (!form.value.nickname || !form.value.avatar) {
|
|
|
|
|
- uni.showToast({ title: '请填写昵称和选择头像', icon: 'none' })
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 检查所有必需字段
|
|
|
|
|
+ if (!form.value.avatar) {
|
|
|
|
|
+ uni.showToast({ title: '请选择头像', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!form.value.nickname) {
|
|
|
|
|
+ uni.showToast({ title: '请输入姓名', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!form.value.phone) {
|
|
|
|
|
+ uni.showToast({ title: '请输入手机号', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!form.value.age) {
|
|
|
|
|
+ uni.showToast({ title: '请输入年龄', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!form.value.sex) {
|
|
|
|
|
+ uni.showToast({ title: '请选择性别', icon: 'none' })
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!form.value.address) {
|
|
|
|
|
+ uni.showToast({ title: '请选择或自动获取省/市', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
submitting.value = true
|
|
submitting.value = true
|
|
|
try {
|
|
try {
|
|
|
const token = uni.getStorageSync('token')
|
|
const token = uni.getStorageSync('token')
|