提交 455a498e authored 作者: matian's avatar matian

代码提交

上级 b763e22a
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LOGIN_URL=https://login.ezijing.com/highway/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LOGIN_URL=https://login.ezijing.com/highway/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LOGIN_URL=https://login.ezijing.com/highway/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
......@@ -122,7 +122,8 @@ export default {
},
myInfoList: {
type: Array
}
},
order_join_rand: { type: String }
},
data() {
return {
......@@ -138,12 +139,16 @@ export default {
}
},
mounted() {
console.log(this.stepList, 'stepList')
console.log(this.data, 'data')
const orderInfoList = this.$route.query.activity_detail_list // 点击我的订单也去支付,返回来拿到的表单数据
console.log(orderInfoList, 'orderInfoList')
const userFields = JSON.parse(this.stepList[this.stepIndex].user_fields)
console.log(this.$route.query.activity_detail_id, '0000')
if (this.$route.query.activity_detail_id) {
if (!orderInfoList.length) {
if (orderInfoList !== undefined) {
this.handleAdd()
return
}
// eslint-disable-next-line vue/no-mutating-props
// 订单拿回的数据回显
......@@ -165,6 +170,7 @@ export default {
return a
}, [])
} else {
console.log(this.myInfoList, 'this.myInfoList')
// 详情拿回的数据回显
if (!this.myInfoList.length) {
this.handleAdd()
......@@ -212,15 +218,14 @@ export default {
})
result.push(resultObj)
})
if (this.detailList.other_fill_in?.list.length) {
this.join_rand = this.detailList.self_fill_in.list[0]?.pay_records[0].join_rand
} else if (this.detailList.self_fill_in?.list.length) {
this.join_rand = this.detailList.self_fill_in.list[0]?.pay_records[0].join_rand
console.log(this.detailList.self_fill_in.list[0])
if (this.data.id === this.detailList.other_fill_in.list[0]?.pay_records.activity_detail_id) {
this.join_rand = this.detailList.other_fill_in.list[0]?.pay_records.join_rand
} else if (this.data.id === this.detailList.self_fill_in.list[0]?.pay_records.activity_detail_id) {
this.join_rand = this.detailList.self_fill_in.list[0]?.pay_records.join_rand
} else {
this.join_rand = ''
this.join_rand = this.order_join_rand || ''
}
console.log(this.join_rand)
const params = {
activity_id: this.data.activity_id,
activity_detail_id: this.data.id,
......@@ -250,7 +255,7 @@ export default {
// stepOrderInfo: JSON.stringify(this.stepOrderInfo),
detailListName: JSON.stringify(this.detailList.activity.name),
activityId: JSON.stringify(this.data.activity_id),
join_rand: this.join_rand,
join_rand: this.stepOrderInfo.list[0].pay_record.join_rand,
stepIndex: JSON.stringify(this.stepIndex),
activity_detail_id: this.data.id,
pay_price: JSON.stringify(this.stepOrderInfo.pay_price)
......@@ -266,6 +271,7 @@ export default {
},
// 表单项增加
handleAdd() {
console.log('000', '0000')
const userFields = JSON.parse(this.data.user_fields).concat()
const allUserFields = userFields.reduce((a, b) => {
const data = allFormList.find(item => item.key === b.key)
......@@ -327,7 +333,7 @@ export default {
padding: 0.21rem 0.3rem 4.13rem 0.3rem;
.main_content_banner {
margin-top: 0.84rem;
width: 6.9rem;
width: 100%;
// height: 2.97rem;
// border: 1px solid #707070;
// border-radius: 0.2rem;
......
......@@ -240,9 +240,16 @@ export default {
display: flex;
justify-content: space-between;
.activity_list_top_tit {
width: 3.2rem;
font-size: 0.28rem;
font-weight: 400;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
-moz-text-overflow: ellipsis;
white-space: nowrap;
}
.activity_list_top_date {
font-size: 0.22rem;
......
......@@ -7,10 +7,7 @@
<van-tab v-for="(it, index) in orderTab" :key="index" :title="it.title">
<div v-if="getDataByType(it.type).length" class="main_content_ticket">
<a href="https://accounts.ezijing.com/h5/payment">
<van-button
round
icon="https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/ticket.png"
>
<van-button round icon="https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/ticket.png">
开发票
</van-button>
</a>
......@@ -101,7 +98,8 @@ export default {
query: {
activityId: item.list[0].activity_id,
activity_detail_id: item.list[0].pay_record.activity_detail_id,
activity_detail_list: item.list
activity_detail_list: item.list,
join_rand: item.join_rand
}
})
}
......
......@@ -84,16 +84,13 @@ export default {
stepIndex() {
return JSON.parse(this.$route.query.stepIndex)
}
// disabledList() {
// return this.stepOrderInfo.map(item => item.pay_record.pay_status === '1')
// }
},
mounted() {
this.stepOrderInfo = JSON.parse(window.localStorage.getItem('stepOrderInfo'))
},
methods: {
checkItem() {
if (this.selctOrderData.length === this.stepOrderInfo.length) {
if (this.selctOrderData.length === this.stepOrderInfo.filter(item => item.pay_record.pay_status !== '1').length) {
this.isAll = true
} else {
this.isAll = false
......@@ -114,14 +111,13 @@ export default {
this.$refs.checkboxGroup.toggleAll(this.isAll)
},
onSubmit() {
if (this.selctOrderData.length && this.totalPrice === 0) {
this.$router.push('/')
} else {
this.getPayDetail()
}
// if (this.selctOrderData.length && this.totalPrice === 0) {
// this.$router.push('/')
// } else {
this.getPayDetail()
// }
},
getPayDetail() {
console.log(this.stepOrderInfo.list)
if (this.stepOrderInfo.length) {
this.stepOrderInfo.forEach((item, index) => {
if (item.pay_record.pay_status === '1') {
......@@ -157,7 +153,7 @@ export default {
<style lang="scss" scoped>
.main {
background-color: #f7f7f7;
// height: 100vh;
height: 100vh;
.main_content {
padding: 0.51rem 0.3rem 0.3rem 0.3rem;
margin-top: 0.9rem;
......
......@@ -24,13 +24,19 @@
</div>
<div class="main_btn">
<van-button
class="main_btn_home"
round
class="main_btn_order"
@click="$router.push('/')"
v-if="parseInt(this.detailList.activity.details.slice(-1).id) === parseInt(this.activity_detail_id)"
v-if="lastStepId === parseInt(this.activity_detail_id)"
>首页</van-button
>
<van-button round class="main_btn_home" @click="getActivityDetail" v-else>继续报名</van-button>
<van-button
round
class="main_btn_home"
@click="continueSign"
v-if="lastStepId !== parseInt(this.activity_detail_id) && this.status === 1"
>继续报名</van-button
>
<van-button round class="main_btn_order" @click="$router.push('/MyOrder')">我的订单</van-button>
</div>
......@@ -59,7 +65,8 @@ export default {
status: '', // 支付状态
time: null,
detailList: {},
activity_detail_id: ''
activity_detail_id: '',
lastStepId: ''
}
},
computed: {
......@@ -113,17 +120,33 @@ export default {
const params = { id: this.$route.query.activityId }
getActivityDetail(params).then(res => {
this.detailList = res.data
if (parseInt(this.detailList.activity.details.slice(-1).id) === parseInt(this.activity_detail_id)) {
console.log('1111tohome')
this.$router.push('/')
} else {
console.log(this.$route.query.activityId, 'this.$route.query.activityId', '来了')
this.$router.push({
path: 'SignMainPage',
query: {
activityId: this.$route.query.activityId
}
})
this.lastStepId = this.detailList.activity.details.slice(-1).id
const currentStep = this.detailList.activity.details.find(item => item.id === this.activity_detail_id)
console.log(currentStep, 'currentStep')
if (res.data.status === 1 && currentStep.can_jump === 1) {
window.open(currentStep.jump_url)
}
// if (res.data.status === 1 || item) {
// if (parseInt(this.detailList.activity.details.slice(-1).id) === parseInt(this.activity_detail_id)) {
// console.log('1111tohome')
// this.$router.push('/')
// } else {
// console.log(this.$route.query.activityId, 'this.$route.query.activityId', '来了')
// this.$router.push({
// path: 'SignMainPage',
// query: {
// activityId: this.$route.query.activityId
// }
// })
// }
// }
})
},
continueSign() {
this.$router.push({
path: 'SignMainPage',
query: {
activityId: this.$route.query.activityId
}
})
}
......@@ -132,6 +155,7 @@ export default {
clearInterval(this.time)
},
mounted() {
this.getActivityDetail()
clearInterval(this.time)
this.time = setInterval(() => {
this.getPayStatus()
......
<template>
<div class="main">
<commonheader @back="handlePrev" :callBack="true" :title="title" />
<!-- 展示 -->
<template v-if="Object.keys(stepList).length">
<img-show
:stepList="stepList"
:data="setpItem"
@prev="handlePrev"
@next="handleNext"
v-if="setpItem.type === 1"
/>
<!-- 表单 -->
<sign-form
:myInfoList="myInfoList"
:personalInfo="detailList.info"
:data="setpItem"
:stepList="stepList"
:stepIndex="stepIndex"
@prev="handlePrev"
@next="handleNext"
v-if="setpItem.type === 2"
:isShowSkip="isShowSkip"
:detailList="detailList"
:order_join_rand="$route.query.join_rand"
/>
</template>
</div>
</template>
<script>
import SignForm from '../components/SignForm.vue'
import ImgShow from '../components/ImgShow.vue'
import Commonheader from '../components/Commonheader.vue'
import { getActivityDetail } from '../api'
export default {
components: { SignForm, ImgShow, Commonheader },
data() {
return {
title: '报名主页面',
stepIndex: 0,
isShowSkip: '',
stepList: [],
detailList: {
info: {}
}
}
},
computed: {
setpItem() {
if (this.$route.query.stepIndex) {
return this.stepList[this.$route.query.stepIndex]
} else {
return this.stepList[this.stepIndex]
}
}
},
mounted() {
this.activity_detail_id = this.$route.query.activity_detail_id
this.getActivityDetail()
},
methods: {
// 获取活动详情
getActivityDetail() {
const params = { id: this.$route.query.id || this.$route.query.activityId }
getActivityDetail(params).then(res => {
this.detailList = res.data
this.myInfoList = res.data.other_fill_in.list
// console.log(this.detailList.activity.details.slice(-1), '0000')
if (this.detailList.other_fill_in.need_fill_in_status) {
this.detailList.activity.details.forEach(item => {
if (item.id === this.detailList.other_fill_in.need_fill_in_id) {
const details = this.detailList.activity.details.indexOf(item)
console.log(details, '111')
if (details === 0) {
this.stepList = res.data.activity.details
console.log(this.stepList, '1')
} else if (details > 0) {
console.log(details, 'details')
this.stepList = this.detailList.activity.details.splice(details)
console.log(this.stepList, '2')
}
}
})
} else {
if (this.detailList.self_fill_in.need_fill_in_status) {
this.detailList.activity.details.forEach(item => {
if (item.id === this.detailList.self_fill_in.need_fill_in_id) {
const details = this.detailList.activity.details.indexOf(item)
console.log(details, '222')
if (details === 0) {
this.stepList = res.data.activity.details
console.log(this.stepList, '3')
} else if (details > 0) {
console.log(details, 'details1')
this.stepList = this.detailList.activity.details.splice(details)
console.log(this.stepList, '4')
}
}
})
} else {
this.stepList = res.data.activity.details
console.log(this.stepList, '5')
}
}
const newIndex = this.stepList.findIndex(item => {
return item.id === this.$route.query.activity_detail_id
})
if (this.$route.query.stepIndex) {
this.stepIndex = parseInt(this.$route.query.stepIndex)
} else {
this.stepIndex = newIndex < 0 ? 0 : newIndex
}
})
},
handlePrev() {
if (this.stepIndex <= 0) {
this.$router.push('/')
} else {
this.stepIndex--
}
},
handleNext() {
this.stepIndex++
}
}
}
</script>
<style lang="scss" scoped></style>
......@@ -22,6 +22,7 @@
v-if="setpItem.type === 2"
:isShowSkip="isShowSkip"
:detailList="detailList"
:order_join_rand="$route.query.join_rand"
/>
</template>
</div>
......@@ -57,64 +58,67 @@ export default {
},
mounted() {
this.activity_detail_id = this.$route.query.activity_detail_id
if (this.$route.query.isShowSkip) {
this.isShowSkip = this.$route.query.isShowSkip
} else {
this.isShowSkip = ''
}
this.getActivityDetail()
},
methods: {
// 获取活动详情
getActivityDetail() {
console.log(this.$route.query.activityId)
const params = { id: this.$route.query.id || this.$route.query.activityId }
getActivityDetail(params).then(res => {
this.detailList = res.data
this.myInfoList = res.data.other_fill_in.list
console.log(this.detailList.activity.details.slice(-1), '0000')
if (this.detailList.other_fill_in.need_fill_in_status) {
this.detailList.activity.details.forEach(item => {
if (item.id === this.detailList.other_fill_in.need_fill_in_id) {
const details = this.detailList.activity.details.indexOf(item)
if (details === 0) {
this.stepList = res.data.activity.details
console.log(this.stepList, '1')
} else if (details > 0) {
console.log(details, 'details')
this.stepList = this.detailList.activity.details.splice(details)
console.log(this.stepList, '2')
}
}
})
} else {
if (this.detailList.self_fill_in.need_fill_in_status) {
this.detailList.activity.details.forEach(item => {
if (item.id === this.detailList.self_fill_in.need_fill_in_id) {
const details = this.detailList.activity.details.indexOf(item)
if (details === 0) {
this.stepList = res.data.activity.details
console.log(this.stepList, '3')
} else if (details > 0) {
console.log(details, 'details1')
this.stepList = this.detailList.activity.details.splice(details)
console.log(this.stepList, '4')
}
}
})
} else {
this.stepList = res.data.activity.details
console.log(this.stepList, '5')
}
}
const newIndex = this.stepList.findIndex(item => {
return item.id === this.$route.query.activity_detail_id
})
if (this.$route.query.stepIndex) {
this.stepIndex = parseInt(this.$route.query.stepIndex)
getActivityDetail({ id: this.$route.query.id }).then(res => {
const data = res.data
if (data.other_fill_in.need_fill_in_status === false && data.self_fill_in.need_fill_in_status === false) {
// 重新报名
} else {
this.stepIndex = newIndex < 0 ? 0 : newIndex
// if (data.other_fill_in.need_fill_in_status) {
// }
}
// this.detailList = res.data
// this.myInfoList = res.data.other_fill_in.list
// // console.log(this.detailList.activity.details.slice(-1), '0000')
// if (this.detailList.other_fill_in.need_fill_in_status) {
// this.detailList.activity.details.forEach(item => {
// if (item.id === this.detailList.other_fill_in.need_fill_in_id) {
// const details = this.detailList.activity.details.indexOf(item)
// console.log(details, '111')
// if (details === 0) {
// this.stepList = res.data.activity.details
// console.log(this.stepList, '1')
// } else if (details > 0) {
// console.log(details, 'details')
// this.stepList = this.detailList.activity.details.splice(details)
// console.log(this.stepList, '2')
// }
// }
// })
// } else {
// if (this.detailList.self_fill_in.need_fill_in_status) {
// this.detailList.activity.details.forEach(item => {
// if (item.id === this.detailList.self_fill_in.need_fill_in_id) {
// const details = this.detailList.activity.details.indexOf(item)
// console.log(details, '222')
// if (details === 0) {
// this.stepList = res.data.activity.details
// console.log(this.stepList, '3')
// } else if (details > 0) {
// console.log(details, 'details1')
// this.stepList = this.detailList.activity.details.splice(details)
// console.log(this.stepList, '4')
// }
// }
// })
// } else {
// this.stepList = res.data.activity.details
// console.log(this.stepList, '5')
// }
// }
// const newIndex = this.stepList.findIndex(item => {
// return item.id === this.$route.query.activity_detail_id
// })
// if (this.$route.query.stepIndex) {
// this.stepIndex = parseInt(this.$route.query.stepIndex)
// } else {
// this.stepIndex = newIndex < 0 ? 0 : newIndex
// }
})
},
handlePrev() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论