7889dbb6 by 杨炀

no message

1 parent a67ee05d
......@@ -22,11 +22,14 @@
</template>
</el-input>
<a class="text-primary text-sm mt10" href="https://www.worlddancesport.org/Athlete/List" target="_blank">
<el-icon><Link /></el-icon>
{{language==0?'去WDSF官网查询我的会员号':'Search my WSDF MIN on the WDSF official website'}}
<el-icon>
<Link/>
</el-icon>
{{ language == 0 ? '去WDSF官网查询我的会员号' : 'Search my WSDF MIN on the WDSF official website' }}
</a>
<Vcode :successText="successVcode" :failText="failVcode" :slider-text="sliderText" :show="showVcode" :z-index="2999" @success="codeSuccess()"></Vcode>
<Vcode :successText="successVcode" :failText="failVcode" :slider-text="sliderText" :show="showVcode"
:z-index="2999" @success="codeSuccess()"></Vcode>
</el-form-item>
<div class="h30"></div>
<div class="leftboderTT">{{ language == 0 ? '个人信息' : 'Personal information' }}
......@@ -96,7 +99,7 @@
<template #footer>
<div class="dialog-footer text-center">
<el-button type="primary" class="btn-lineG w200px" round @click="submitForm">
{{language == 0 ? '确定' : 'Save' }}
{{ language == 0 ? '确定' : 'Save' }}
</el-button>
</div>
</template>
......@@ -155,8 +158,10 @@ const data = reactive({
successVcode: '验证通过!',
sliderText: '拖动滑块完成拼图',
})
const {form, show, showVcode, title, labels, uType, isMe, isCodeTrue, card, cptId,
failVcode,successVcode,sliderText} = toRefs(data)
const {
form, show, showVcode, title, labels, uType, isMe, isCodeTrue, card, cptId,
failVcode, successVcode, sliderText
} = toRefs(data)
let editgay = false
let groupId = '0'
......@@ -185,25 +190,28 @@ const open = (params) => {
editgay = false
} else {// 编辑舞伴
editgay = true
if(params.form){
if (params.form) {
form.value = params.form
}else {
} else {
getFormById(params.id)
}
}
}
}
defineExpose({open})
function getMyInfo() {
match.getMyPersonInfo().then(res => {
form.value = res.data
})
}
function getFormById(id) {
match.getPersonInfoById(id).then(res => {
form.value = res.data
})
}
watch(show, (value) => {
if (!value) {
card.value = ''
......@@ -219,11 +227,11 @@ watch(show, (value) => {
function submitForm() {
if (!form.value.passportNumber) {
ElMessage.warning(language.value == 0 ?'请输入你的证件号':'Please fill in your passport number')
ElMessage.warning(language.value == 0 ? '请输入你的证件号' : 'Please fill in your passport number')
return
}
if (!form.value.birth) {
ElMessage.warning(language.value == 0 ?'请输入你的出生日期':'Please fill in your birthday')
ElMessage.warning(language.value == 0 ? '请输入你的出生日期' : 'Please fill in your birthday')
return
}
// if (!form.value.picUrl) {
......@@ -231,11 +239,11 @@ function submitForm() {
// return
// }
if (!form.value.sex) {
ElMessage.warning(language.value == 0 ?'请选择性别':'Please select your gender')
ElMessage.warning(language.value == 0 ? '请选择性别' : 'Please select your gender')
return
}
if (!form.value.passportUrl||form.value.passportUrl==''||form.value.passportUrl.length==0) {
ElMessage.warning(language.value == 0 ?'请上传证件':'Please upload passport file')
if (!form.value.passportUrl || form.value.passportUrl == '' || form.value.passportUrl.length == 0) {
ElMessage.warning(language.value == 0 ? '请上传证件' : 'Please upload passport file')
return
}
if (editgay) {
......@@ -245,7 +253,7 @@ function submitForm() {
form.value.passportUrl = form.value.passportUrl[0].url
}
match.editPersonInfo(form.value).then(res => {
ElMessage.success(language.value == 0 ? '保存成功' :'Successfully')
ElMessage.success(language.value == 0 ? '保存成功' : 'Successfully')
show.value = false
emit('submitForm')
})
......@@ -270,16 +278,17 @@ function submitForm() {
if (Array.isArray(form.value.passportUrl)) {
form.value.passportUrl = form.value.passportUrl[0].url
}
if(groupId=='0'||!groupId){
if (groupId == '0' || !groupId) {
addPersonal()
} else {
if(groupId){
if (groupId) {
addGroupMember()
}
}
}
}
}
function addPersonal() {
match.savePersonForMyPerson2(form.value).then(res => {
ElMessage.success('保存成功')
......@@ -287,15 +296,17 @@ function addPersonal() {
emit('submitForm', res.data)
})
}
function addGroupMember() {
form.value.groupId = groupId
match.savePersonForMyGroup(form.value).then(res => {
ElMessage.success(language.value == 0 ?'保存成功':'Save successful')
ElMessage.success(language.value == 0 ? '保存成功' : 'Save successful')
show.value = false
emit('submitForm')
})
}
function cancel() {
show.value = false
showVcode.value = false
......@@ -324,9 +335,9 @@ function codeSuccess(msg) {
console.log('验证通过' + msg);
showVcode.value = false
isCodeTrue.value = true
checkWdsfAthletes({card: card.value,groupId:groupId}).then(res => {
if (res.data.wdsfFlag==-1) {
ElMessage.warning(language.value == 0 ?'您添加的运动员代表国家/地区,与团体账号注册的国家/地区不符,无法添加':'The athlete \'s representing, does not match the group account‘s country/region and cannot be added.')
checkWdsfAthletes({card: card.value, groupId: groupId}).then(res => {
if (res.data.wdsfFlag == -1) {
ElMessage.warning(language.value == 0 ? '您添加的运动员代表国家/地区,与团体账号注册的国家/地区不符,无法添加' : 'The athlete \'s representing, does not match the group account‘s country/region and cannot be added.')
isCodeTrue.value = false
return
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!