diff --git a/src/api/auth/index.js b/src/api/auth/index.js index 3a90252..30c29db 100644 --- a/src/api/auth/index.js +++ b/src/api/auth/index.js @@ -50,3 +50,18 @@ export const voteAPI = (data) => { data, }) } +export const deadlineAPI = (data) => { + return request({ + url: '/api/children/competition/get/registration/deadline', + method: 'POST', + data, + }) +} + +export const voteStatus = (data) => { + return request({ + url: '/api/children/competition/get/vote/status', + method: 'POST', + data, + }) +} diff --git a/src/assets/image/ddf3227@2x.png b/src/assets/image/ddf3227@2x.png new file mode 100644 index 0000000..4084a14 Binary files /dev/null and b/src/assets/image/ddf3227@2x.png differ diff --git a/src/assets/image/zdf3228@2x.png b/src/assets/image/zdf3228@2x.png new file mode 100644 index 0000000..290f7ea Binary files /dev/null and b/src/assets/image/zdf3228@2x.png differ diff --git a/src/router/index.js b/src/router/index.js index 2c2673c..1ff2d93 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,5 +1,6 @@ // router/index.js import { createRouter, createWebHistory } from 'vue-router'; +import {deadlineAPI} from "@/api/auth/index.js"; const routes = [ { path: '/', @@ -10,6 +11,7 @@ const routes = [ name: 'login', component: () => import('@/views/login/index.vue'), beforeEnter: (to, from, next) => { + localStorage.clear() next() } diff --git a/src/store/auth/index.js b/src/store/auth/index.js index 21f6769..753c477 100644 --- a/src/store/auth/index.js +++ b/src/store/auth/index.js @@ -2,7 +2,7 @@ import {ref,computed} from 'vue' import {createGlobalState,useStorage} from '@vueuse/core' import { competitionApply, - competitionWorks, + competitionWorks, deadlineAPI, loginRegister, sendCode, uploadFile, @@ -26,6 +26,7 @@ export const useAuth=createGlobalState(()=>{ const showTextCode=computed(()=>{ return isCountingDown.value ? `${countdown.value}s` : '获取验证码' }) + const resultType=useStorage('resultType', '', localStorage) const sendVote=async ()=>{ const res= await voteAPI({workUid:workUid.value}) @@ -40,6 +41,15 @@ export const useAuth=createGlobalState(()=>{ } } + const showText=computed(()=>{ + if (['success'].includes(resultType.value)){ + return '提交成功' + }else if (['end'].includes(resultType.value)){ + return '报名已结束' + }else if (['hasVoted'].includes(resultType.value)){ + return '您已投过票' + } + }) const genderOptions=ref([ {text:'男',value:'男'}, {text:'女',value:'女'} @@ -133,8 +143,12 @@ export const useAuth=createGlobalState(()=>{ const res=await competitionApply(data) if(res.status===0){ message.success('报名成功') - - router.push('/result') + router.push({ + path: '/result', + query: { + type: 'success' + } + }) } } let timer = null; @@ -213,6 +227,8 @@ export const useAuth=createGlobalState(()=>{ })*/ } return { + showText, + resultType, sendVote, workData, workUid, diff --git a/src/views/confirm/size1920/index.vue b/src/views/confirm/size1920/index.vue index 5868706..bf92f65 100644 --- a/src/views/confirm/size1920/index.vue +++ b/src/views/confirm/size1920/index.vue @@ -9,12 +9,16 @@ const {clickApply,formData,openMask1,goBack} =useAuth()