|
@ -2,49 +2,93 @@ |
|
|
<view> |
|
|
<view> |
|
|
<form class="padding-lr cu-form-group flex-direction"> |
|
|
<form class="padding-lr cu-form-group flex-direction"> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="title padding-bottom-sm"><span v-show="!userInfo" class="text-red padding-right-xs">*</span>姓名</view> |
|
|
<view class="title padding-bottom-sm"> |
|
|
<input :disabled="userInfo ? true : false" placeholder="请输入真实姓名" name="input" type="text" v-model="name" /> |
|
|
<span class="text-red padding-right-xs" v-show="!userInfo">*</span>姓名 |
|
|
|
|
|
</view> |
|
|
|
|
|
<input |
|
|
|
|
|
:disabled="(userinfo && userInfo.id) ? true : false" |
|
|
|
|
|
name="input" |
|
|
|
|
|
placeholder="请输入真实姓名" |
|
|
|
|
|
type="text" |
|
|
|
|
|
v-model="name" |
|
|
|
|
|
/> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="title padding-bottom-sm"><span v-show="!userInfo" class="text-red padding-right-xs">*</span>身份证</view> |
|
|
<view class="title padding-bottom-sm"> |
|
|
<input :disabled="userInfo ? true : false" placeholder="请输入身份证号" name="input" type="text" v-model="idCard" /> |
|
|
<span class="text-red padding-right-xs" v-show="!(userinfo && userInfo.id)">*</span>身份证 |
|
|
|
|
|
</view> |
|
|
|
|
|
<input |
|
|
|
|
|
:disabled="(userinfo && userInfo.id) ? true : false" |
|
|
|
|
|
name="input" |
|
|
|
|
|
placeholder="请输入身份证号" |
|
|
|
|
|
type="text" |
|
|
|
|
|
v-model="idCard" |
|
|
|
|
|
/> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="title padding-bottom-sm"><span v-show="!userInfo" class="text-red padding-right-xs">*</span>联系方式</view> |
|
|
<view class="title padding-bottom-sm"> |
|
|
<input :disabled="userInfo ? true : false" placeholder="请输入手机号码" name="input" type="number" v-model="phone" /> |
|
|
<span class="text-red padding-right-xs" v-show="!(userinfo && userInfo.id)">*</span>联系方式 |
|
|
|
|
|
</view> |
|
|
|
|
|
<input |
|
|
|
|
|
:disabled="(userinfo && userInfo.id) ? true : false" |
|
|
|
|
|
name="input" |
|
|
|
|
|
placeholder="请输入手机号码" |
|
|
|
|
|
type="number" |
|
|
|
|
|
v-model="phone" |
|
|
|
|
|
/> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="title padding-bottom-sm"><span v-show="!userInfo" class="text-red padding-right-xs">*</span>身份</view> |
|
|
<view class="title padding-bottom-sm"> |
|
|
<radio-group class="block" @change="RadioChange" v-if="!userInfo"> |
|
|
<span class="text-red padding-right-xs" v-show="!(userinfo && userInfo.id)">*</span>身份 |
|
|
|
|
|
</view> |
|
|
|
|
|
<radio-group @change="RadioChange" class="block" v-if="!(userinfo && userInfo.id)"> |
|
|
<view class="flex"> |
|
|
<view class="flex"> |
|
|
<view class="flex-sub margin-tb-sm" v-for="(identity,index) in identitys" :key="index"> |
|
|
<view :key="index" class="flex-sub margin-tb-sm" v-for="(identity,index) in identitys"> |
|
|
<label class="flex justify-between align-center"> |
|
|
<label class="flex justify-between align-center"> |
|
|
<radio class="round margin-right-xs" :checked="index === current" :value="identity.value"></radio> |
|
|
<radio |
|
|
|
|
|
:checked="index === current" |
|
|
|
|
|
:value="identity.value" |
|
|
|
|
|
class="round margin-right-xs" |
|
|
|
|
|
></radio> |
|
|
<text class="flex-sub" style="font-size: 34rpx;">{{ identity.name }}</text> |
|
|
<text class="flex-sub" style="font-size: 34rpx;">{{ identity.name }}</text> |
|
|
</label> |
|
|
</label> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</radio-group> |
|
|
</radio-group> |
|
|
<input v-else disabled name="input" type="text" :value="current === 0 ? '学生' : current === 1 ? '教师' : '工作人员'" /> |
|
|
<input |
|
|
|
|
|
:value="current === 0 ? '学生' : current === 1 ? '教师' : '工作人员'" |
|
|
|
|
|
disabled |
|
|
|
|
|
name="input" |
|
|
|
|
|
type="text" |
|
|
|
|
|
v-else |
|
|
|
|
|
/> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
<view class="title padding-bottom-sm"><span v-show="!userInfo" class="text-red padding-right-xs">*</span>学号</view> |
|
|
<view class="title padding-bottom-sm"> |
|
|
<input :disabled="userInfo ? true : false" placeholder="请输入学号" name="input" type="text" v-model="studentID" /> |
|
|
<span class="text-red padding-right-xs" v-show="!(userinfo && userInfo.id)">*</span>学号 |
|
|
|
|
|
</view> |
|
|
|
|
|
<input |
|
|
|
|
|
:disabled="(userinfo && userInfo.id) ? true : false" |
|
|
|
|
|
name="input" |
|
|
|
|
|
placeholder="请输入学号" |
|
|
|
|
|
type="text" |
|
|
|
|
|
v-model="studentID" |
|
|
|
|
|
/> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</form> |
|
|
</form> |
|
|
<user-agreement v-if="!userInfo" @changeIntentions='changeIntentions'></user-agreement> |
|
|
<user-agreement @changeIntentions="changeIntentions" v-if="!(userinfo && userInfo.id)"></user-agreement> |
|
|
<button v-show="!userInfo" class="bg-cyan margin primary-btn" hover-class="cc-active" @tap="handleSubmitUserInfo">确认提交</button> |
|
|
<button |
|
|
|
|
|
@tap="handleSubmitUserInfo" |
|
|
|
|
|
class="bg-cyan margin primary-btn" |
|
|
|
|
|
hover-class="cc-active" |
|
|
|
|
|
v-show="!(userinfo && userInfo.id)" |
|
|
|
|
|
>确认提交</button> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { showToast } from 'common/script/util'; |
|
|
showToast |
|
|
import { SUBMIT_USER_INFO } from 'api/api'; |
|
|
} from 'common/script/util'; |
|
|
|
|
|
import { |
|
|
|
|
|
SUBMIT_USER_INFO |
|
|
|
|
|
} from 'api/api'; |
|
|
|
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
@ -53,7 +97,8 @@ |
|
|
name: '', |
|
|
name: '', |
|
|
idCard: '', |
|
|
idCard: '', |
|
|
phone: '', |
|
|
phone: '', |
|
|
identitys: [{ |
|
|
identitys: [ |
|
|
|
|
|
{ |
|
|
value: '0', |
|
|
value: '0', |
|
|
name: '学生', |
|
|
name: '学生', |
|
|
}, |
|
|
}, |
|
@ -68,7 +113,7 @@ |
|
|
], |
|
|
], |
|
|
studentID: '', |
|
|
studentID: '', |
|
|
current: 0, |
|
|
current: 0, |
|
|
agree: false |
|
|
agree: false, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -106,38 +151,27 @@ |
|
|
try { |
|
|
try { |
|
|
if (!this.checkRules()) return; |
|
|
if (!this.checkRules()) return; |
|
|
|
|
|
|
|
|
const { |
|
|
const { name, idCard, phone, studentID, current } = this; |
|
|
name, |
|
|
|
|
|
idCard, |
|
|
|
|
|
phone, |
|
|
|
|
|
studentID, |
|
|
|
|
|
current |
|
|
|
|
|
} = this; |
|
|
|
|
|
const params = { |
|
|
const params = { |
|
|
param: { |
|
|
param: { |
|
|
idCard, |
|
|
idCard, |
|
|
name, |
|
|
name, |
|
|
no: studentID, |
|
|
no: studentID, |
|
|
phone, |
|
|
phone, |
|
|
post: current |
|
|
post: current, |
|
|
} |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const res = await this.$http.post(SUBMIT_USER_INFO, params); |
|
|
const res = await this.$http.post(SUBMIT_USER_INFO, params); |
|
|
const { |
|
|
const { success, code, msg, data } = res.data; |
|
|
success, |
|
|
|
|
|
code, |
|
|
|
|
|
msg, |
|
|
|
|
|
data |
|
|
|
|
|
} = res.data; |
|
|
|
|
|
if (success && code === 200) { |
|
|
if (success && code === 200) { |
|
|
this.success = true; |
|
|
this.success = true; |
|
|
this.setUserInfo(data); |
|
|
this.setUserInfo(data); |
|
|
this.openPage(pagePath) |
|
|
this.openPage(pagePath); |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: msg || '提交基本信息成功', |
|
|
title: msg || '提交基本信息成功', |
|
|
icon: 'none' |
|
|
icon: 'none', |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
@ -145,7 +179,7 @@ |
|
|
if (error.msg) { |
|
|
if (error.msg) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: error.msg || '提交基本信息失败', |
|
|
title: error.msg || '提交基本信息失败', |
|
|
icon: 'none' |
|
|
icon: 'none', |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|