报名校验
Showing
3 changed files
with
92 additions
and
50 deletions
| ... | @@ -798,10 +798,11 @@ export function getZNList(params) { | ... | @@ -798,10 +798,11 @@ export function getZNList(params) { |
| 798 | } | 798 | } |
| 799 | 799 | ||
| 800 | // 团体报名校验 | 800 | // 团体报名校验 |
| 801 | export function preCheckForGroup(groupId) { | 801 | export function preCheckForGroup(groupId, type) { |
| 802 | return request({ | 802 | return request({ |
| 803 | url: `/systemj/personInfo/preCheckForGroup/${groupId}`, | 803 | url: `/systemj/personInfo/preCheckForGroup/${groupId}`, |
| 804 | method: 'get' | 804 | method: 'get', |
| 805 | params: { type } | ||
| 805 | }) | 806 | }) |
| 806 | } | 807 | } |
| 807 | 808 | ... | ... |
| 1 | import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus' | 1 | import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus' |
| 2 | import {useStorage} from "@vueuse/core/index"; | 2 | import { useStorage } from '@vueuse/core/index' |
| 3 | 3 | ||
| 4 | const language= useStorage('language',0) | 4 | const language = useStorage('language', 0) |
| 5 | let loadingInstance | 5 | let loadingInstance |
| 6 | 6 | ||
| 7 | export default { | 7 | export default { |
| ... | @@ -23,19 +23,19 @@ export default { | ... | @@ -23,19 +23,19 @@ export default { |
| 23 | }, | 23 | }, |
| 24 | // 弹出提示 | 24 | // 弹出提示 |
| 25 | alert(content) { | 25 | alert(content) { |
| 26 | return ElMessageBox.alert(content, language.value==0 ? language.value==0 ? '系统提示' :'Tips' :'Tips') | 26 | return ElMessageBox.alert(content, language.value == 0 ? language.value == 0 ? '系统提示' : 'Tips' : 'Tips') |
| 27 | }, | 27 | }, |
| 28 | // 错误提示 | 28 | // 错误提示 |
| 29 | alertError(content) { | 29 | alertError(content) { |
| 30 | return ElMessageBox.alert(content, language.value==0 ? language.value==0 ? '系统提示' :'Tips' :'Tips', { type: 'error' }) | 30 | return ElMessageBox.alert(content, language.value == 0 ? language.value == 0 ? '系统提示' : 'Tips' : 'Tips', { type: 'error' }) |
| 31 | }, | 31 | }, |
| 32 | // 成功提示 | 32 | // 成功提示 |
| 33 | alertSuccess(content) { | 33 | alertSuccess(content) { |
| 34 | return ElMessageBox.alert(content, language.value==0 ? '系统提示' :'Tips', { type: 'success' }) | 34 | return ElMessageBox.alert(content, language.value == 0 ? '系统提示' : 'Tips', { type: 'success' }) |
| 35 | }, | 35 | }, |
| 36 | // 警告提示 | 36 | // 警告提示 |
| 37 | alertWarning(content) { | 37 | alertWarning(content) { |
| 38 | return ElMessageBox.alert(content, language.value==0 ? '系统提示' :'Tips', { type: 'warning' }) | 38 | return ElMessageBox.alert(content, language.value == 0 ? '系统提示' : 'Tips', { type: 'warning' }) |
| 39 | }, | 39 | }, |
| 40 | // 通知提示 | 40 | // 通知提示 |
| 41 | notify(content) { | 41 | notify(content) { |
| ... | @@ -55,17 +55,17 @@ export default { | ... | @@ -55,17 +55,17 @@ export default { |
| 55 | }, | 55 | }, |
| 56 | // 确认窗体 | 56 | // 确认窗体 |
| 57 | confirm(content) { | 57 | confirm(content) { |
| 58 | return ElMessageBox.confirm(content, language.value==0 ? '系统提示' :'Tips', { | 58 | return ElMessageBox.confirm(content, language.value == 0 ? '系统提示' : 'Tips', { |
| 59 | confirmButtonText: language.value==0 ? '确定' :'OK', | 59 | confirmButtonText: language.value == 0 ? '确定' : 'OK', |
| 60 | cancelButtonText: language.value==0 ? '取消' :'Cancel', | 60 | cancelButtonText: language.value == 0 ? '取消' : 'Cancel', |
| 61 | type: 'warning' | 61 | type: 'warning' |
| 62 | }) | 62 | }) |
| 63 | }, | 63 | }, |
| 64 | // 提交内容 | 64 | // 提交内容 |
| 65 | prompt(content) { | 65 | prompt(content) { |
| 66 | return ElMessageBox.prompt(content, language.value==0 ? '系统提示' :'Tips', { | 66 | return ElMessageBox.prompt(content, language.value == 0 ? '系统提示' : 'Tips', { |
| 67 | confirmButtonText: language.value==0 ? '确定' :'OK', | 67 | confirmButtonText: language.value == 0 ? '确定' : 'OK', |
| 68 | cancelButtonText: language.value==0 ? '取消' :'Cancel', | 68 | cancelButtonText: language.value == 0 ? '取消' : 'Cancel', |
| 69 | type: 'warning' | 69 | type: 'warning' |
| 70 | }) | 70 | }) |
| 71 | }, | 71 | }, | ... | ... |
| ... | @@ -588,16 +588,19 @@ function goTeamSign() { | ... | @@ -588,16 +588,19 @@ function goTeamSign() { |
| 588 | ) | 588 | ) |
| 589 | return | 589 | return |
| 590 | } | 590 | } |
| 591 | router.push({ | 591 | |
| 592 | path: `${route.params.id}/teamSignCn`, | 592 | handelPreCheckForGroup( |
| 593 | query: { | 593 | router.push({ |
| 594 | matchId: matchId.value, | 594 | path: `${route.params.id}/teamSignCn`, |
| 595 | groupId: groupId.value, | 595 | query: { |
| 596 | signType: matchData.value.signType, | 596 | matchId: matchId.value, |
| 597 | languageSource: matchData.value.languageSource, | 597 | groupId: groupId.value, |
| 598 | isNational: false | 598 | signType: matchData.value.signType, |
| 599 | } | 599 | languageSource: matchData.value.languageSource, |
| 600 | }) | 600 | isNational: false |
| 601 | } | ||
| 602 | }) | ||
| 603 | ) | ||
| 601 | } else { | 604 | } else { |
| 602 | // 国际赛 | 605 | // 国际赛 |
| 603 | if (group?.type != '4' && matchData.value.countryLimit == '1') { | 606 | if (group?.type != '4' && matchData.value.countryLimit == '1') { |
| ... | @@ -612,16 +615,18 @@ function goTeamSign() { | ... | @@ -612,16 +615,18 @@ function goTeamSign() { |
| 612 | ) | 615 | ) |
| 613 | return | 616 | return |
| 614 | } | 617 | } |
| 615 | router.push({ | 618 | handelPreCheckForGroup( |
| 616 | path: `${route.params.id}/teamSign`, | 619 | router.push({ |
| 617 | query: { | 620 | path: `${route.params.id}/teamSign`, |
| 618 | matchId: matchId.value, | 621 | query: { |
| 619 | groupId: groupId.value, | 622 | matchId: matchId.value, |
| 620 | signType: matchData.value.signType, | 623 | groupId: groupId.value, |
| 621 | isNational: true, | 624 | signType: matchData.value.signType, |
| 622 | languageSource: matchData.value.languageSource | 625 | isNational: true, |
| 623 | } | 626 | languageSource: matchData.value.languageSource |
| 624 | }) | 627 | } |
| 628 | }) | ||
| 629 | ) | ||
| 625 | } | 630 | } |
| 626 | } | 631 | } |
| 627 | 632 | ||
| ... | @@ -754,17 +759,7 @@ function switchSignType() { | ... | @@ -754,17 +759,7 @@ function switchSignType() { |
| 754 | switch (matchData.value.signType) { | 759 | switch (matchData.value.signType) { |
| 755 | case '0':// 个人 | 760 | case '0':// 个人 |
| 756 | if (user.utype == '1') { | 761 | if (user.utype == '1') { |
| 757 | match.preCheckForPerson().then(res => { | 762 | handelGeRenNext() |
| 758 | if (res.data == 1) { | ||
| 759 | goPersonalSign() | ||
| 760 | } else { | ||
| 761 | return proxy.$modal.msgError( | ||
| 762 | language.value == 0 | ||
| 763 | ? '您绑定的WDSF会员号已过期,请先到WDSF官网激活您的会员号。' | ||
| 764 | : 'Your bound WDSF Number has expired. Please activate your WDSF Number on the WDSF official website first.' | ||
| 765 | ) | ||
| 766 | } | ||
| 767 | }) | ||
| 768 | } | 763 | } |
| 769 | if (user.utype == '2') { | 764 | if (user.utype == '2') { |
| 770 | ElMessageBox.confirm( | 765 | ElMessageBox.confirm( |
| ... | @@ -796,7 +791,9 @@ function switchSignType() { | ... | @@ -796,7 +791,9 @@ function switchSignType() { |
| 796 | ) | 791 | ) |
| 797 | } | 792 | } |
| 798 | if (user.utype == '2') { | 793 | if (user.utype == '2') { |
| 799 | match.preCheckForGroup(groupId.value).then(goTeamSign) | 794 | // match.preCheckForGroup(groupId.value).then(goTeamSign) |
| 795 | // handelPreCheckForGroup(goTeamSign) | ||
| 796 | goTeamSign() | ||
| 800 | } | 797 | } |
| 801 | if (user.utype == '3') { | 798 | if (user.utype == '3') { |
| 802 | // 团队活动 且 游客 | 799 | // 团队活动 且 游客 |
| ... | @@ -805,12 +802,14 @@ function switchSignType() { | ... | @@ -805,12 +802,14 @@ function switchSignType() { |
| 805 | break | 802 | break |
| 806 | case '2':// 团体队伍 | 803 | case '2':// 团体队伍 |
| 807 | if (user.utype == '1') { | 804 | if (user.utype == '1') { |
| 808 | match.preCheckForGroup(groupId.value).then(goPersonalSign) | 805 | // match.preCheckForGroup(groupId.value).then(goPersonalSign) |
| 809 | // goPersonalSign() | 806 | // goPersonalSign() |
| 807 | handelPreCheckForGroup(goPersonalSign) | ||
| 810 | } | 808 | } |
| 811 | if (user.utype == '2') { | 809 | if (user.utype == '2') { |
| 812 | match.preCheckForGroup(groupId.value).then(goTeamSign) | 810 | // handelPreCheckForGroup(goTeamSign) |
| 813 | // goTeamSign() | 811 | // match.preCheckForGroup(groupId.value).then(goTeamSign) |
| 812 | goTeamSign() | ||
| 814 | } | 813 | } |
| 815 | if (user.utype == '3') { | 814 | if (user.utype == '3') { |
| 816 | // 游客 | 815 | // 游客 |
| ... | @@ -820,8 +819,35 @@ function switchSignType() { | ... | @@ -820,8 +819,35 @@ function switchSignType() { |
| 820 | } | 819 | } |
| 821 | } | 820 | } |
| 822 | 821 | ||
| 822 | async function handelGeRenNext() { | ||
| 823 | const res = await match.preCheckForPerson({ type: '1' }) | ||
| 824 | // 不给报名 | ||
| 825 | if (res.data == 0) { | ||
| 826 | await proxy.$modal.confirm( | ||
| 827 | language.value == 0 | ||
| 828 | ? '您绑定的WDSF会员号已过期,请先到WDSF官网激活您的会员号。' | ||
| 829 | : 'Your bound WDSF Number has expired. Please activate your WDSF Number on the WDSF official website first.' | ||
| 830 | ) | ||
| 831 | return | ||
| 832 | } | ||
| 833 | // 正常报名 | ||
| 834 | if (res.data == 1) { | ||
| 835 | goPersonalSign() | ||
| 836 | } | ||
| 837 | // 提示 | ||
| 838 | if (res.data == 2) { | ||
| 839 | await proxy.$modal.confirm( | ||
| 840 | language.value == 0 | ||
| 841 | ? '运动员的WDSF会员号已变更,是否更新?' | ||
| 842 | : 'The athlete`s WDSF membership number has been changed. Should it be updated?' | ||
| 843 | ) | ||
| 844 | await match.preCheckForPerson({ type: '2' }) | ||
| 845 | await goPersonalSign() | ||
| 846 | } | ||
| 847 | } | ||
| 848 | |||
| 823 | function applyInvitation() { | 849 | function applyInvitation() { |
| 824 | var obj = { | 850 | const obj = { |
| 825 | title: language.value == 0 ? '邀请函申请' : 'Visa Invitation Letter ', | 851 | title: language.value == 0 ? '邀请函申请' : 'Visa Invitation Letter ', |
| 826 | cptId: matchId.value | 852 | cptId: matchId.value |
| 827 | } | 853 | } |
| ... | @@ -835,6 +861,21 @@ const openPickup = () => { | ... | @@ -835,6 +861,21 @@ const openPickup = () => { |
| 835 | } | 861 | } |
| 836 | proxy.$refs['pickupRef'].open(obj) | 862 | proxy.$refs['pickupRef'].open(obj) |
| 837 | } | 863 | } |
| 864 | |||
| 865 | async function handelPreCheckForGroup(fn) { | ||
| 866 | const res = await match.preCheckForGroup(groupId.value, '1') | ||
| 867 | if (res.data == 1 || res.data == 0) { | ||
| 868 | await fn() | ||
| 869 | } | ||
| 870 | if (res.data == 2) { | ||
| 871 | await proxy.$modal.confirm( | ||
| 872 | language.value == 0 | ||
| 873 | ? '运动员的WDSF会员号已变更,是否更新?' | ||
| 874 | : 'The athlete`s WDSF membership number has been changed. Should it be updated?') | ||
| 875 | await match.preCheckForGroup(groupId.value, '2') | ||
| 876 | await fn() | ||
| 877 | } | ||
| 878 | } | ||
| 838 | </script> | 879 | </script> |
| 839 | 880 | ||
| 840 | <style lang="scss" scoped> | 881 | <style lang="scss" scoped> | ... | ... |
-
Please register or sign in to post a comment