提交 2cf5d451 authored 作者: lihuihui's avatar lihuihui

进入报名页面 不直接跳转登录,展示页先显示,到表单填写在跳转登录

上级 1c366fa3
...@@ -49,3 +49,8 @@ export function importPeople(data) { ...@@ -49,3 +49,8 @@ export function importPeople(data) {
export function getOpenid(data) { export function getOpenid(data) {
return httpRequest.post('/api/usercenter/v2/frontend/wechat/get-openid', data) return httpRequest.post('/api/usercenter/v2/frontend/wechat/get-openid', data)
} }
// 获取openid
export function updateUserInfo(data) {
return httpRequest.post('/api/usercenter/v2/frontend/user/update-user', data)
}
...@@ -44,11 +44,21 @@ export default { ...@@ -44,11 +44,21 @@ export default {
handlePrev() { handlePrev() {
this.$emit('prev') this.$emit('prev')
}, },
handleSubmit() { async handleSubmit() {
if (this.stepList[this.stepList.length - 1].num === this.data.num) { const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
this.$router.push({ path: '/' }) if (!isLogin) {
const datas = this.stepList.filter(item => item.type === 1)
if (datas[datas.length - 1].num === this.data.num) {
window.location.href = `https://login.ezijing.com/auth/login/index?rd=${window.location.origin}/SignMainPage?id=${this.$route.query.id}`
} else {
this.$emit('next')
}
} else { } else {
this.$emit('next') if (this.stepList[this.stepList.length - 1].num === this.data.num) {
this.$router.push({ path: '/' })
} else {
this.$emit('next')
}
} }
} }
} }
...@@ -65,9 +75,9 @@ export default { ...@@ -65,9 +75,9 @@ export default {
margin: 0.84rem auto; margin: 0.84rem auto;
.show_content_img { .show_content_img {
// width: 6.9rem; // width: 6.9rem;
::v-deep{ ::v-deep {
p{ p {
font-size: .24rem; font-size: 0.24rem;
} }
} }
} }
......
...@@ -132,6 +132,7 @@ import { Toast } from 'vant' ...@@ -132,6 +132,7 @@ import { Toast } from 'vant'
import BatchImport from '../components/BatchImport.vue' import BatchImport from '../components/BatchImport.vue'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
import { saveStepInfo, getOpenid } from '../api' import { saveStepInfo, getOpenid } from '../api'
// updateUserInfo
import allFormList from '@/utils/formList' import allFormList from '@/utils/formList'
export default { export default {
components: { Commonheader, BatchImport }, components: { Commonheader, BatchImport },
...@@ -152,6 +153,7 @@ export default { ...@@ -152,6 +153,7 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(JSON.parse(window.localStorage.userInfo).mobile, 'phone')
if (this.isPc()) { if (this.isPc()) {
document.getElementById('main_footer').style.width = '400px' document.getElementById('main_footer').style.width = '400px'
} }
......
...@@ -4,17 +4,13 @@ ...@@ -4,17 +4,13 @@
<commonheader :title="title" /> <commonheader :title="title" />
<div class="main_content"> <div class="main_content">
<!-- banner卡片 --> <!-- banner卡片 -->
<img <img class="main_content_banner" src="https://webapp-pub.ezijing.com/highway/h5/banner-0420.png" alt="" />
class="main_content_banner"
src="https://webapp-pub.ezijing.com/highway/h5/banner-0420.png"
alt=""
/>
<!-- 动态 --> <!-- 动态 -->
<div class="main_content_dt"> <div class="main_content_dt">
<div class="main_content_dt_tit">中国公路建设行业协会</div> <div class="main_content_dt_tit">中国公路建设行业协会</div>
<ul class="main-content"> <ul class="main-content">
<li v-for="(item, index) in navList" :key="index" @click="handleNav(item)"> <li v-for="(item, index) in navList" :key="index" @click="handleNav(item)">
<img :src="item.icon"> <img :src="item.icon" />
<div class="text">{{ item.text }}</div> <div class="text">{{ item.text }}</div>
</li> </li>
</ul> </ul>
...@@ -151,12 +147,20 @@ export default { ...@@ -151,12 +147,20 @@ export default {
// 报名 // 报名
async handleSignCheck(item) { async handleSignCheck(item) {
// 未登录 // 未登录
const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin')) this.getActivityDetail(item)
if (!isLogin) { // const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` // if (!isLogin) {
} else { // this.$router.push({
this.getActivityDetail(item) // path: '/SignMainPage',
} // query: {
// stepIndex: 0,
// isLogin: true,
// loginId: item.id
// }
// })
// } else {
// this.getActivityDetail(item)
// }
}, },
// 获取活动详情 // 获取活动详情
getActivityDetail(item) { getActivityDetail(item) {
...@@ -172,51 +176,22 @@ export default { ...@@ -172,51 +176,22 @@ export default {
const startTime = new Date(item.start_time.replace(/-/g, '/')).getTime() const startTime = new Date(item.start_time.replace(/-/g, '/')).getTime()
const endTime = new Date(item.end_time.replace(/-/g, '/')).getTime() const endTime = new Date(item.end_time.replace(/-/g, '/')).getTime()
if (time >= startTime && time < endTime) { if (time >= startTime && time < endTime) {
if (this.detailList.other_fill_in.need_fill_in_status) { if (this.detailList.self_fill_in === null && this.detailList.other_fill_in === null) {
// 有需要填写的步骤 this.$router.push({
Dialog.confirm({ path: '/SignMainPage',
title: '提示', query: {
message: '还有报名流程未交费', id: item.id
confirmButtonText: '继续报名',
cancelButtonText:
this.detailList.self_fill_in.need_fill_in_status === false ? (canJump ? '开始学习' : '') : '',
closeOnClickOverlay: true,
beforeClose: (action, done) => {
if (action === 'overlay') {
window.location.href = window.location.origin
} else {
done(true)
}
} }
}) })
.then(() => { } else {
this.$router.push({ if (this.detailList.other_fill_in?.need_fill_in_status) {
path: '/SignMainPage', // 有需要填写的步骤
query: {
id: item.id
}
})
})
.catch(() => {
if (canJump) {
window.location.href = canJump.jump_url
}
})
// 没有需要填写的步骤
} else if (!this.detailList.other_fill_in.need_fill_in_status) {
if (this.detailList.self_fill_in.need_fill_in_status) {
this.$router.push({
path: '/SignMainPage',
query: {
id: item.id
}
})
} else {
Dialog.confirm({ Dialog.confirm({
title: '提示', title: '提示',
message: '', message: '还有报名流程未交费',
confirmButtonText: '重新报名', confirmButtonText: '继续报名',
cancelButtonText: canJump ? '开始学习' : '', cancelButtonText:
this.detailList.self_fill_in.need_fill_in_status === false ? (canJump ? '开始学习' : '') : '',
closeOnClickOverlay: true, closeOnClickOverlay: true,
beforeClose: (action, done) => { beforeClose: (action, done) => {
if (action === 'overlay') { if (action === 'overlay') {
...@@ -239,6 +214,44 @@ export default { ...@@ -239,6 +214,44 @@ export default {
window.location.href = canJump.jump_url window.location.href = canJump.jump_url
} }
}) })
// 没有需要填写的步骤
} else if (!this.detailList.other_fill_in?.need_fill_in_status) {
if (this.detailList.self_fill_in?.need_fill_in_status) {
this.$router.push({
path: '/SignMainPage',
query: {
id: item.id
}
})
} else {
Dialog.confirm({
title: '提示',
message: '',
confirmButtonText: '重新报名',
cancelButtonText: canJump ? '开始学习' : '',
closeOnClickOverlay: true,
beforeClose: (action, done) => {
if (action === 'overlay') {
window.location.href = window.location.origin
} else {
done(true)
}
}
})
.then(() => {
this.$router.push({
path: '/SignMainPage',
query: {
id: item.id
}
})
})
.catch(() => {
if (canJump) {
window.location.href = canJump.jump_url
}
})
}
} }
} }
} else if (time >= endTime) { } else if (time >= endTime) {
...@@ -362,28 +375,28 @@ export default { ...@@ -362,28 +375,28 @@ export default {
} }
} }
} }
.main-content{ .main-content {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 0 .2rem; padding: 0 0.2rem;
padding-top: .25rem; padding-top: 0.25rem;
li{ li {
img{ img {
width: 1.2rem; width: 1.2rem;
display: block; display: block;
} }
.text{ .text {
font-size: .24rem; font-size: 0.24rem;
line-height: 100%; line-height: 100%;
color: #4E4E4E; color: #4e4e4e;
text-align: center; text-align: center;
} }
} }
} }
.border-line{ .border-line {
width: 6.2rem; width: 6.2rem;
margin: 0 auto 0.35rem; margin: 0 auto 0.35rem;
border-bottom: .01rem dashed rgba(196, 196, 196, 1); border-bottom: 0.01rem dashed rgba(196, 196, 196, 1);
} }
::v-deep .van-icon-arrow { ::v-deep .van-icon-arrow {
margin-top: 0.05rem; margin-top: 0.05rem;
......
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
if (this.$route.query.id) { if (this.$route.query.id) {
this.getActivityDetail() this.getActivityDetail()
} else { } else {
console.log(JSON.parse(window.localStorage.orderStepDetails), '12322')
this.setData(JSON.parse(window.localStorage.orderStepDetails)) this.setData(JSON.parse(window.localStorage.orderStepDetails))
} }
} else { } else {
...@@ -101,9 +102,9 @@ export default { ...@@ -101,9 +102,9 @@ export default {
}) })
} }
let sliceData = [] let sliceData = []
if (data.other_fill_in.need_fill_in_status) { if (data.other_fill_in?.need_fill_in_status) {
initInfo('other_fill_in') initInfo('other_fill_in')
} else if (data.self_fill_in.need_fill_in_status) { } else if (data.self_fill_in?.need_fill_in_status) {
initInfo('self_fill_in') initInfo('self_fill_in')
} else { } else {
initInfo() initInfo()
...@@ -150,7 +151,7 @@ export default { ...@@ -150,7 +151,7 @@ export default {
sliceData.map(item => { sliceData.map(item => {
item.list = [] item.list = []
item.activityInfo = Object.assign({}, data.activity) item.activityInfo = Object.assign({}, data.activity)
item.list.push(data.info) data.info !== null && item.list.push(data.info)
return item return item
}) })
} }
......
...@@ -40,6 +40,11 @@ httpRequest.interceptors.response.use( ...@@ -40,6 +40,11 @@ httpRequest.interceptors.response.use(
if (data.code === 4001) { if (data.code === 4001) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}`
} }
// 未登录
if (data.code === 1) {
// window.location.href = `${import.meta.env.VITE_LOGIN_URL}`
return
}
// 没有权限 // 没有权限
if (data.code === 4008 || data.code === 5018) { if (data.code === 4008 || data.code === 5018) {
router.push('/401') router.push('/401')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论