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

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

上级 1c366fa3
......@@ -49,3 +49,8 @@ export function importPeople(data) {
export function getOpenid(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,7 +44,16 @@ export default {
handlePrev() {
this.$emit('prev')
},
handleSubmit() {
async handleSubmit() {
const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
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 {
if (this.stepList[this.stepList.length - 1].num === this.data.num) {
this.$router.push({ path: '/' })
} else {
......@@ -52,6 +61,7 @@ export default {
}
}
}
}
}
</script>
......@@ -65,9 +75,9 @@ export default {
margin: 0.84rem auto;
.show_content_img {
// width: 6.9rem;
::v-deep{
p{
font-size: .24rem;
::v-deep {
p {
font-size: 0.24rem;
}
}
}
......
......@@ -132,6 +132,7 @@ import { Toast } from 'vant'
import BatchImport from '../components/BatchImport.vue'
import Commonheader from '../components/Commonheader.vue'
import { saveStepInfo, getOpenid } from '../api'
// updateUserInfo
import allFormList from '@/utils/formList'
export default {
components: { Commonheader, BatchImport },
......@@ -152,6 +153,7 @@ export default {
}
},
mounted() {
console.log(JSON.parse(window.localStorage.userInfo).mobile, 'phone')
if (this.isPc()) {
document.getElementById('main_footer').style.width = '400px'
}
......
......@@ -4,17 +4,13 @@
<commonheader :title="title" />
<div class="main_content">
<!-- banner卡片 -->
<img
class="main_content_banner"
src="https://webapp-pub.ezijing.com/highway/h5/banner-0420.png"
alt=""
/>
<img 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_tit">中国公路建设行业协会</div>
<ul class="main-content">
<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>
</li>
</ul>
......@@ -151,12 +147,20 @@ export default {
// 报名
async handleSignCheck(item) {
// 未登录
const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
if (!isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else {
this.getActivityDetail(item)
}
// const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
// if (!isLogin) {
// this.$router.push({
// path: '/SignMainPage',
// query: {
// stepIndex: 0,
// isLogin: true,
// loginId: item.id
// }
// })
// } else {
// this.getActivityDetail(item)
// }
},
// 获取活动详情
getActivityDetail(item) {
......@@ -172,7 +176,15 @@ export default {
const startTime = new Date(item.start_time.replace(/-/g, '/')).getTime()
const endTime = new Date(item.end_time.replace(/-/g, '/')).getTime()
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({
path: '/SignMainPage',
query: {
id: item.id
}
})
} else {
if (this.detailList.other_fill_in?.need_fill_in_status) {
// 有需要填写的步骤
Dialog.confirm({
title: '提示',
......@@ -203,8 +215,8 @@ export default {
}
})
// 没有需要填写的步骤
} else if (!this.detailList.other_fill_in.need_fill_in_status) {
if (this.detailList.self_fill_in.need_fill_in_status) {
} 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: {
......@@ -241,6 +253,7 @@ export default {
})
}
}
}
} else if (time >= endTime) {
Toast(`该活动将于${item.end_time}结束报名`)
} else if (time < startTime) {
......@@ -362,28 +375,28 @@ export default {
}
}
}
.main-content{
.main-content {
display: flex;
justify-content: space-between;
padding: 0 .2rem;
padding-top: .25rem;
li{
img{
padding: 0 0.2rem;
padding-top: 0.25rem;
li {
img {
width: 1.2rem;
display: block;
}
.text{
font-size: .24rem;
.text {
font-size: 0.24rem;
line-height: 100%;
color: #4E4E4E;
color: #4e4e4e;
text-align: center;
}
}
}
.border-line{
.border-line {
width: 6.2rem;
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 {
margin-top: 0.05rem;
......
......@@ -66,6 +66,7 @@ export default {
if (this.$route.query.id) {
this.getActivityDetail()
} else {
console.log(JSON.parse(window.localStorage.orderStepDetails), '12322')
this.setData(JSON.parse(window.localStorage.orderStepDetails))
}
} else {
......@@ -101,9 +102,9 @@ export default {
})
}
let sliceData = []
if (data.other_fill_in.need_fill_in_status) {
if (data.other_fill_in?.need_fill_in_status) {
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')
} else {
initInfo()
......@@ -150,7 +151,7 @@ export default {
sliceData.map(item => {
item.list = []
item.activityInfo = Object.assign({}, data.activity)
item.list.push(data.info)
data.info !== null && item.list.push(data.info)
return item
})
}
......
......@@ -40,6 +40,11 @@ httpRequest.interceptors.response.use(
if (data.code === 4001) {
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) {
router.push('/401')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论