提交 b763e22a authored 作者: matian's avatar matian

feat:代码提交

上级 7798190a
VITE_LOGIN_URL=https://login2.ezijing.com/auth/login/index VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_SHARE_URL=https://accounts.ezijing.com VITE_SHARE_URL=https://accounts.ezijing.com
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="main_header"> <div class="main_header">
<van-nav-bar fixed :title="title" left-arrow @click-left="onClickLeft"> <van-nav-bar fixed :title="title" left-arrow @click-left="onClickLeft">
<template #right> <template #right>
<van-icon name="contact" size="28" @click="onClickRight" /> <van-icon v-if="pathName === '/'" name="contact" size="28" @click="onClickRight" />
</template> </template>
</van-nav-bar> </van-nav-bar>
</div> </div>
...@@ -20,6 +20,11 @@ export default { ...@@ -20,6 +20,11 @@ export default {
default: false default: false
} }
}, },
computed: {
pathName() {
return window.location.pathname
}
},
methods: { methods: {
// 首页返回按钮 // 首页返回按钮
onClickLeft() { onClickLeft() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="main"> <div class="main">
<!-- 展示页面 --> <!-- 展示页面 -->
<div class="show_content"> <div class="show_content">
<img class="show_content_img" :src="data.desc" /> <div class="show_content_img" v-html="data.desc"></div>
<div class="show_content_btn" @click="handleSubmit">{{ data.title }}</div> <div class="show_content_btn" @click="handleSubmit">{{ data.title }}</div>
</div> </div>
</div> </div>
...@@ -41,8 +41,6 @@ export default { ...@@ -41,8 +41,6 @@ export default {
.show_content_img { .show_content_img {
margin-top: 0.84rem; margin-top: 0.84rem;
width: 6.9rem; width: 6.9rem;
height: 10.1rem;
border: 1px solid #707070;
} }
.show_content_btn { .show_content_btn {
width: 6.42rem; width: 6.42rem;
......
<template> <template>
<div class="main"> <div class="main">
<div class="main_content"> <div class="main_content">
<img class="main_content_banner" :src="data.desc" alt="" /> <div class="main_content_banner" v-html="data.desc"></div>
<div class="main_content_form"> <div class="main_content_form">
<van-form @submit="onSubmit"> <van-form>
<div v-for="(listIt, formIndex) in formList" :key="formIndex" class="main_content_form_list"> <div v-for="(listIt, formIndex) in formList" :key="formIndex" class="main_content_form_list">
<img <img
src="https://webapp-pub.ezijing.com/highway/h5/form_minus.png" src="https://webapp-pub.ezijing.com/highway/h5/form_minus.png"
class="btn_minus" class="btn_minus"
@click="handleMinus" @click="handleMinus(formIndex)"
v-if="formList.length > 1" v-if="formList.length > 1 && formIndex !== 0"
/> />
<div class="formItemList_item" v-for="(item, index) in listIt" :key="index"> <div class="formItemList_item" v-for="(item, index) in listIt" :key="index">
<!-- 输入框 --> <!-- 输入框 -->
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
:rules="[{ required: item.required, message: item.placeholder }]" :rules="[{ required: item.required, message: item.placeholder }]"
clearable clearable
border border
:disabled="formIndex === 0 && (item.key === 'mobile' || item.key === 'name')"
/> />
</div> </div>
<!-- 单选框 --> <!-- 单选框 -->
...@@ -88,7 +89,7 @@ ...@@ -88,7 +89,7 @@
</van-form> </van-form>
</div> </div>
<div class="main_content_footer"> <div class="main_content_footer">
<template v-if="isShowSkip !== '1'"> <template v-if="data.can_skip_pay === 1">
<van-checkbox v-model="checkedPay" shape="square" class="main_content_skipPay"> <van-checkbox v-model="checkedPay" shape="square" class="main_content_skipPay">
{{ data.skip_pay_title }}</van-checkbox {{ data.skip_pay_title }}</van-checkbox
> >
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
round round
block block
native-type="submit" native-type="submit"
:class="[isShowSkip === '1' ? 'main_content_btn1' : 'main_content_btn']" :class="[data.can_skip_pay === 1 ? 'main_content_btn' : 'main_content_btn1']"
@click="onSubmit" @click="onSubmit"
>{{ data.title }}</van-button >{{ data.title }}</van-button
> >
...@@ -113,9 +114,15 @@ export default { ...@@ -113,9 +114,15 @@ export default {
props: { props: {
stepList: { type: Array }, stepList: { type: Array },
data: { type: Object }, data: { type: Object },
// eslint-disable-next-line vue/require-prop-type-constructor stepIndex: { type: Number },
stepIndex: 0, isShowSkip: { type: String },
isShowSkip: { type: String } personalInfo: { type: Object },
detailList: {
type: Object
},
myInfoList: {
type: Array
}
}, },
data() { data() {
return { return {
...@@ -131,22 +138,73 @@ export default { ...@@ -131,22 +138,73 @@ export default {
} }
}, },
mounted() { mounted() {
window.localStorage.setItem('stepIndex', this.stepIndex) const orderInfoList = this.$route.query.activity_detail_list // 点击我的订单也去支付,返回来拿到的表单数据
this.$store.commit('saveStepIndex', this.stepIndex) const userFields = JSON.parse(this.stepList[this.stepIndex].user_fields)
// if (this.$route.query.activity_detail_id) {
if (this.$store.state.stepForm.length) { if (!orderInfoList.length) {
this.formList = this.$store.state.stepForm this.handleAdd()
return
}
// eslint-disable-next-line vue/no-mutating-props
// 订单拿回的数据回显
this.formList = orderInfoList
.sort((a, b) => {
return a.num - b.num
})
.reduce((a, b) => {
const arr = []
userFields.forEach(item => {
const find = Object.assign(
{},
allFormList.find(d => d.key === item.key)
)
find.value = b[item.key]
arr.push(find)
})
a.push(arr)
return a
}, [])
} else { } else {
this.handleAdd() // 详情拿回的数据回显
if (!this.myInfoList.length) {
this.handleAdd()
return
}
this.myInfoList.map((item, index) => {
if (item.mobile === this.detailList.info.mobile) {
item.num = 0
} else {
item.num = index + 1
}
return item
})
// eslint-disable-next-line vue/no-mutating-props
this.formList = this.myInfoList
.sort((a, b) => {
return a.num - b.num
})
.reduce((a, b) => {
const arr = []
userFields.forEach(item => {
const find = Object.assign(
{},
allFormList.find(d => d.key === item.key)
)
find.value = b[item.key]
arr.push(find)
})
a.push(arr)
return a
}, [])
} }
console.log(this.formList, '1111')
}, },
methods: { methods: {
// 提交 // 提交
onSubmit() { onSubmit() {
const result = [] const result = []
window.localStorage.setItem('stepForm', JSON.stringify(this.formList)) console.log(this.formList, 'this.formList')
console.log(window.localStorage.getItem('stepForm'))
this.$store.commit('setFormList', this.formList)
this.formList.forEach(item => { this.formList.forEach(item => {
const resultObj = {} const resultObj = {}
item.forEach(obj => { item.forEach(obj => {
...@@ -155,14 +213,10 @@ export default { ...@@ -155,14 +213,10 @@ export default {
result.push(resultObj) result.push(resultObj)
}) })
if (JSON.parse(window.localStorage.getItem('detailList'))?.other_fill_in?.list.length) { if (this.detailList.other_fill_in?.list.length) {
this.join_rand = JSON.parse( this.join_rand = this.detailList.self_fill_in.list[0]?.pay_records[0].join_rand
window.localStorage.getItem('detailList') } else if (this.detailList.self_fill_in?.list.length) {
).other_fill_in.list[0].pay_records.join_rand this.join_rand = this.detailList.self_fill_in.list[0]?.pay_records[0].join_rand
} else if (JSON.parse(window.localStorage.getItem('detailList'))?.self_fill_in?.list.length) {
this.join_rand = JSON.parse(
window.localStorage.getItem('detailList')
).self_fill_in.list[0].pay_records.join_rand
} else { } else {
this.join_rand = '' this.join_rand = ''
} }
...@@ -175,11 +229,12 @@ export default { ...@@ -175,11 +229,12 @@ export default {
company_id: '', company_id: '',
join_rand: this.join_rand join_rand: this.join_rand
} }
console.log(this.data.order, 'this.data.order')
saveStepInfo(params).then(res => { saveStepInfo(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.stepOrderInfo = res.data this.stepOrderInfo = res.data
window.localStorage.setItem('stepOrderInfo', JSON.stringify(this.stepOrderInfo)) console.log(this.stepOrderInfo)
this.$store.commit('setStepOrderInfo', this.stepOrderInfo) window.localStorage.setItem('stepOrderInfo', JSON.stringify(this.stepOrderInfo.list))
if (this.checkedPay) { if (this.checkedPay) {
const lastorder = this.stepList[this.stepList.length - 1].order const lastorder = this.stepList[this.stepList.length - 1].order
if (lastorder === this.data.order) { if (lastorder === this.data.order) {
...@@ -188,10 +243,17 @@ export default { ...@@ -188,10 +243,17 @@ export default {
this.$emit('next') this.$emit('next')
} }
} else { } else {
console.log(this.join_rand, 'this.join_rand')
this.$router.push({ this.$router.push({
path: '/OrderConfirm', path: '/OrderConfirm',
query: { query: {
stepOrderInfo: this.stepOrderInfo // stepOrderInfo: JSON.stringify(this.stepOrderInfo),
detailListName: JSON.stringify(this.detailList.activity.name),
activityId: JSON.stringify(this.data.activity_id),
join_rand: this.join_rand,
stepIndex: JSON.stringify(this.stepIndex),
activity_detail_id: this.data.id,
pay_price: JSON.stringify(this.stepOrderInfo.pay_price)
} }
}) })
} }
...@@ -217,9 +279,9 @@ export default { ...@@ -217,9 +279,9 @@ export default {
if (this.formList.length === 1) { if (this.formList.length === 1) {
this.formList[0].forEach(item => { this.formList[0].forEach(item => {
if (item.key === 'name') { if (item.key === 'name') {
return (item.value = JSON.parse(window.localStorage.getItem('detailList')).info.name) return (item.value = this.personalInfo.name)
} else if (item.key === 'mobile') { } else if (item.key === 'mobile') {
return (item.value = JSON.parse(window.localStorage.getItem('detailList')).info.mobile) return (item.value = this.personalInfo.mobile)
} }
}) })
} }
...@@ -266,9 +328,9 @@ export default { ...@@ -266,9 +328,9 @@ export default {
.main_content_banner { .main_content_banner {
margin-top: 0.84rem; margin-top: 0.84rem;
width: 6.9rem; width: 6.9rem;
height: 2.97rem; // height: 2.97rem;
border: 1px solid #707070; // border: 1px solid #707070;
border-radius: 0.2rem; // border-radius: 0.2rem;
} }
.main_content_form { .main_content_form {
width: 6.9rem; width: 6.9rem;
...@@ -299,7 +361,6 @@ export default { ...@@ -299,7 +361,6 @@ export default {
} }
.main_content_footer { .main_content_footer {
height: 1.81rem; height: 1.81rem;
// margin-top: 1.02rem;
position: fixed; position: fixed;
bottom: 0.3rem; bottom: 0.3rem;
background: #fff; background: #fff;
...@@ -329,16 +390,17 @@ export default { ...@@ -329,16 +390,17 @@ export default {
} }
} }
} }
::v-deep .van-icon { ::v-deep .van-checkbox__icon .van-icon {
width: 0.24rem; width: 0.25rem;
height: 0.24rem; height: 0.26rem;
text-align: center; text-align: center;
margin-top: 0.06rem;
} }
::v-deep .van-checkbox__icon { ::v-deep .van-checkbox__icon .van-checkbox__icon {
font-size: 0.16rem; font-size: 0.16rem;
} }
::v-deep .van-checkbox__label { ::v-deep .van-checkbox__icon .van-checkbox__label {
color: #999999; color: #999999;
margin-top: 0.1rem; margin-top: -0.9rem;
} }
</style> </style>
...@@ -97,37 +97,7 @@ export default { ...@@ -97,37 +97,7 @@ export default {
const params = { id: item.id } const params = { id: item.id }
getActivityDetail(params).then(res => { getActivityDetail(params).then(res => {
this.detailList = res.data this.detailList = res.data
window.localStorage.setItem('detailList', JSON.stringify(this.detailList))
JSON.parse(window.localStorage.getItem('detailList'))
this.$store.commit('setDetailList', this.detailList)
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) {
const stepList = this.detailList.activity.details
window.localStorage.setItem('stepList', JSON.stringify(stepList))
} else if (details > 0) {
const stepList = this.detailList.activity.details.splice(0, details + 1)
window.localStorage.setItem('stepList', JSON.stringify(stepList))
}
}
})
} 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) {
const stepList = this.detailList.activity.details
window.localStorage.setItem('stepList', JSON.stringify(stepList))
} else if (details > 0) {
const stepList = this.detailList.activity.details.splice(0, details + 1)
window.localStorage.setItem('stepList', JSON.stringify(stepList))
}
}
})
}
this.handleSign(item) this.handleSign(item)
}) })
}, },
...@@ -147,17 +117,21 @@ export default { ...@@ -147,17 +117,21 @@ export default {
}) })
.then(() => { .then(() => {
this.$router.push({ this.$router.push({
path: '/SignMainPage' path: '/SignMainPage',
query: {
id: item.id
}
}) })
}) })
.catch(() => { .catch(() => {})
// on cancel
})
// 没有需要填写的步骤 // 没有需要填写的步骤
} else if (!this.detailList.other_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) { if (this.detailList.self_fill_in.need_fill_in_status) {
this.$router.push({ this.$router.push({
path: '/SignMainPage' path: '/SignMainPage',
query: {
id: item.id
}
}) })
} else { } else {
Dialog.confirm({ Dialog.confirm({
...@@ -169,7 +143,10 @@ export default { ...@@ -169,7 +143,10 @@ export default {
}) })
.then(() => { .then(() => {
this.$router.push({ this.$router.push({
path: '/SignMainPage' path: '/SignMainPage',
query: {
id: item.id
}
}) })
}) })
.catch(() => {}) .catch(() => {})
......
...@@ -6,9 +6,14 @@ ...@@ -6,9 +6,14 @@
<van-tabs v-model="active" animated sticky> <van-tabs v-model="active" animated sticky>
<van-tab v-for="(it, index) in orderTab" :key="index" :title="it.title"> <van-tab v-for="(it, index) in orderTab" :key="index" :title="it.title">
<div v-if="getDataByType(it.type).length" class="main_content_ticket"> <div v-if="getDataByType(it.type).length" class="main_content_ticket">
<van-button round icon="https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/ticket.png"> <a href="https://accounts.ezijing.com/h5/payment">
开发票 <van-button
</van-button> round
icon="https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/ticket.png"
>
开发票
</van-button>
</a>
</div> </div>
<!-- 订单列表 --> <!-- 订单列表 -->
<div v-if="getDataByType(it.type).length" class="main_content_orderList"> <div v-if="getDataByType(it.type).length" class="main_content_orderList">
...@@ -90,11 +95,13 @@ export default { ...@@ -90,11 +95,13 @@ export default {
} }
}, },
handlePay(item) { handlePay(item) {
console.log(item.list, 'item') console.log(item, 'item')
this.$router.push({ this.$router.push({
path: 'OrderConfirm', path: '/signMainPage',
query: { query: {
orderList: item activityId: item.list[0].activity_id,
activity_detail_id: item.list[0].pay_record.activity_detail_id,
activity_detail_list: item.list
} }
}) })
} }
......
...@@ -4,12 +4,11 @@ ...@@ -4,12 +4,11 @@
<commonheader @back="handlePrev" :callBack="true" :title="title" /> <commonheader @back="handlePrev" :callBack="true" :title="title" />
<div class="main_content"> <div class="main_content">
<div class="main_content_list"> <div class="main_content_list">
<!-- {{ stepOrderInfo }} -->
<van-checkbox-group v-model="selctOrderData" ref="checkboxGroup" @change="checkItem"> <van-checkbox-group v-model="selctOrderData" ref="checkboxGroup" @change="checkItem">
<div class="main_content_list_card" v-for="(item, index) in stepOrderInfo.list" :key="index"> <div class="main_content_list_card" v-for="(item, index) in stepOrderInfo" :key="index">
<div class="card_header"> <div class="card_header">
<van-checkbox :name="item" :disabled="item.pay_record.pay_status === '1'"></van-checkbox> <van-checkbox :name="item" :disabled="item.pay_record.pay_status === '1'"></van-checkbox>
<span class="card_header_title">{{ stepName }}</span> <span class="card_header_title">{{ JSON.parse($route.query.detailListName) }}</span>
</div> </div>
<div class="card_con"> <div class="card_con">
<p>{{ item.name }} {{ item.mobile }}</p> <p>{{ item.name }} {{ item.mobile }}</p>
...@@ -17,15 +16,13 @@ ...@@ -17,15 +16,13 @@
<div class="card_fotter"> <div class="card_fotter">
<div class="card_fotter_left"> <div class="card_fotter_left">
<span class="price">¥</span> <span class="price">¥</span>
<span class="price_num">{{ stepOrderInfo.pay_price }}<span class="price_num"></span></span> <span class="price_num">{{ payPrice }}<span class="price_num"></span></span>
</div> </div>
<div class="card_fotter_left card_fotter_right"> <div class="card_fotter_left card_fotter_right">
<span class="price">单位已优惠</span> <span class="price">单位已优惠</span>
<span class="price">¥</span> <span class="price">¥</span>
<span class="price_num">{{ <span class="price_num">{{
(Number(stepOrderInfo.pay_price).toFixed(2) - Number(item.pay_record.pay_amount).toFixed(2)).toFixed( (Number(payPrice).toFixed(2) - Number(item.pay_record.pay_amount).toFixed(2)).toFixed(2)
2
)
}}</span> }}</span>
</div> </div>
</div> </div>
...@@ -40,7 +37,7 @@ ...@@ -40,7 +37,7 @@
<div class="main_footer_total_top"> <div class="main_footer_total_top">
<div class="total_text">合计:</div> <div class="total_text">合计:</div>
<div class="total_sign">¥</div> <div class="total_sign">¥</div>
<div class="price">{{ totalPrice }}.00</div> <div class="price">{{ totalPrice }}</div>
</div> </div>
<div class="main_footer_total_bottom"> <div class="main_footer_total_bottom">
<div class="company_yh">单位已优惠</div> <div class="company_yh">单位已优惠</div>
...@@ -55,7 +52,7 @@ ...@@ -55,7 +52,7 @@
</template> </template>
<script> <script>
import { getActivityDetail } from '../api' import { getPayInfo } from '../api'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
export default { export default {
components: { Commonheader }, components: { Commonheader },
...@@ -66,7 +63,8 @@ export default { ...@@ -66,7 +63,8 @@ export default {
isAll: false, isAll: false,
numVsible: true, numVsible: true,
payDetail: {}, payDetail: {},
selctOrderData: [] // 选中的数据 selctOrderData: [], // 选中的数据
stepOrderInfo: []
} }
}, },
...@@ -74,44 +72,41 @@ export default { ...@@ -74,44 +72,41 @@ export default {
totalPrice() { totalPrice() {
return this.selctOrderData.map(item => Number(item.pay_record.pay_amount)).reduce((pre, nex) => (pre += nex), 0) return this.selctOrderData.map(item => Number(item.pay_record.pay_amount)).reduce((pre, nex) => (pre += nex), 0)
}, },
payPrice() {
return JSON.parse(this.$route.query.pay_price)
},
totalCompanyPrice() { totalCompanyPrice() {
return this.selctOrderData return this.selctOrderData
.map(item => Number(this.stepOrderInfo.pay_price) - Number(item.pay_record.pay_amount)) .map(item => Number(this.payPrice) - Number(item.pay_record.pay_amount))
.reduce((pre, nex) => (pre += nex), 0) .reduce((pre, nex) => (pre += nex), 0)
}, },
stepOrderInfo() {
return this.$route.query.stepOrderInfo || this.$route.query.orderList stepIndex() {
}, return JSON.parse(this.$route.query.stepIndex)
stepName() {
return JSON.parse(window.localStorage.getItem('detailList')).activity.name
} }
// disabledList() {
// return this.stepOrderInfo.map(item => item.pay_record.pay_status === '1')
// }
}, },
mounted() { mounted() {
console.log(this.$route.query.orderList) this.stepOrderInfo = JSON.parse(window.localStorage.getItem('stepOrderInfo'))
console.log(JSON.parse(window.localStorage.getItem('stepOrderInfo')))
// this.getActivityDetail()
}, },
methods: { methods: {
// getActivityDetail() {
// const params = { id: this.$route.query.orderList.list[0].activity_id }
// getActivityDetail(params).then(res => {
// console.log(res)
// // this.stepOrderInfo = res.data
// })
// },
checkItem() { checkItem() {
if (this.selctOrderData.length === this.stepOrderInfo.list.length) { if (this.selctOrderData.length === this.stepOrderInfo.length) {
this.isAll = true this.isAll = true
} else { } else {
this.isAll = false this.isAll = false
} }
}, },
handlePrev() { handlePrev() {
console.log(this.stepIndex, 'kkk')
this.$router.push({ this.$router.push({
path: '/SignMainPage', path: '/SignMainPage',
query: { query: {
currentIndex: window.localStorage.getItem('stepIndex'), isShowSkip: '1',
isShowSkip: '1' activityId: JSON.parse(this.$route.query.activityId),
stepIndex: this.stepIndex
} }
}) })
}, },
...@@ -119,20 +114,42 @@ export default { ...@@ -119,20 +114,42 @@ export default {
this.$refs.checkboxGroup.toggleAll(this.isAll) this.$refs.checkboxGroup.toggleAll(this.isAll)
}, },
onSubmit() { onSubmit() {
console.log(this.selctOrderData) if (this.selctOrderData.length && this.totalPrice === 0) {
if (this.selctOrderData.lenth && this.totalPrice === 0) {
this.$router.push('/') this.$router.push('/')
} else { } 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') {
const findIndex = this.selctOrderData.findIndex(id => id.id === item.id)
this.selctOrderData.splice(findIndex, 1)
}
})
}
const params = {
pay_record_ids: this.selctOrderData.map(item => item.pay_record.id).toString(),
join_rand: this.$route.query.join_rand
}
console.log(this.$route.query.activity_detail_id, 'selecer')
getPayInfo(params).then(res => {
this.payDetail = res.data
this.payDetail.order_id = res.data.order_id
this.$router.push({ this.$router.push({
path: '/PayDetail', path: '/PayDetail',
query: { query: {
pay_record_ids: this.selctOrderData.map(item => item.pay_record.id).toString(), pay_record_ids: this.payDetail.order_id,
join_rand: this.$route.query.orderList.join_rand payDetail: res.data,
stepIndex: this.stepIndex,
activityId: JSON.parse(this.$route.query.activityId),
activity_detail_id: this.$route.query.activity_detail_id
} }
}) })
} })
}, }
onClickRight() {}
} }
} }
</script> </script>
...@@ -140,12 +157,12 @@ export default { ...@@ -140,12 +157,12 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .main {
background-color: #f7f7f7; background-color: #f7f7f7;
height: 100vh; // height: 100vh;
.main_content { .main_content {
padding: 0.51rem 0.3rem 0.3rem 0.3rem; padding: 0.51rem 0.3rem 0.3rem 0.3rem;
margin-top: 0.9rem; margin-top: 0.9rem;
.main_content_list { .main_content_list {
padding-bottom: 0.6rem; padding-bottom: 1.2rem;
.main_content_list_card { .main_content_list_card {
height: 2.16rem; height: 2.16rem;
background: #fff; background: #fff;
......
...@@ -22,6 +22,18 @@ ...@@ -22,6 +22,18 @@
> >
复制链接在浏览器打开去支付 复制链接在浏览器打开去支付
</div> </div>
<div class="main_btn">
<van-button
round
class="main_btn_order"
@click="$router.push('/')"
v-if="parseInt(this.detailList.activity.details.slice(-1).id) === 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_order" @click="$router.push('/MyOrder')">我的订单</van-button>
</div>
<div id="value">{{ payDetail.url }}</div> <div id="value">{{ payDetail.url }}</div>
</div> </div>
</div> </div>
...@@ -31,7 +43,7 @@ ...@@ -31,7 +43,7 @@
import QrcodeVue from 'qrcode.vue' import QrcodeVue from 'qrcode.vue'
import Clipboard from 'clipboard' import Clipboard from 'clipboard'
import { Toast } from 'vant' import { Toast } from 'vant'
import { getPayInfo, getPayStatus } from '../api' import { getActivityDetail, getPayStatus } from '../api'
import commonheader from '../components/Commonheader.vue' import commonheader from '../components/Commonheader.vue'
export default { export default {
...@@ -45,11 +57,15 @@ export default { ...@@ -45,11 +57,15 @@ export default {
qrcodeUrl: '', qrcodeUrl: '',
clipboard: null, clipboard: null,
status: '', // 支付状态 status: '', // 支付状态
payDetail: {}, time: null,
join_rand: '' detailList: {},
activity_detail_id: ''
} }
}, },
computed: { computed: {
payDetail() {
return this.$route.query.payDetail
},
pay_record_ids() { pay_record_ids() {
return this.$route.query.pay_record_ids return this.$route.query.pay_record_ids
} }
...@@ -77,46 +93,51 @@ export default { ...@@ -77,46 +93,51 @@ export default {
}, },
getPayStatus() { getPayStatus() {
const params = { const params = {
order_id: this.payDetail.order_id order_id: this.pay_record_ids
} }
getPayStatus(params).then(res => { getPayStatus(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.status = res.data.status this.status = res.data.status
if (this.status === 2) { if (res.data.status === 1) {
this.$route.push('/') clearInterval(this.time)
if (this.$route.query.activityId) {
this.getActivityDetail()
}
} }
} }
}) })
}, },
getPayDetail() { getActivityDetail() {
if (JSON.parse(window.localStorage.getItem('detailList'))?.other_fill_in?.list.length) { this.activity_detail_id = this.$route.query.activity_detail_id
this.join_rand = JSON.parse( console.log(this.$route.query.activityId, 'activityId')
window.localStorage.getItem('detailList') const params = { id: this.$route.query.activityId }
).other_fill_in.list[0].pay_records.join_rand getActivityDetail(params).then(res => {
} else if (JSON.parse(window.localStorage.getItem('detailList'))?.self_fill_in?.list.length) { this.detailList = res.data
this.join_rand = JSON.parse( if (parseInt(this.detailList.activity.details.slice(-1).id) === parseInt(this.activity_detail_id)) {
window.localStorage.getItem('detailList') console.log('1111tohome')
).self_fill_in.list[0].pay_records.join_rand this.$router.push('/')
} else { } else {
this.join_rand = this.$route.query.join_rand || '' console.log(this.$route.query.activityId, 'this.$route.query.activityId', '来了')
} this.$router.push({
const params = { path: 'SignMainPage',
pay_record_ids: this.pay_record_ids, query: {
join_rand: this.join_rand activityId: this.$route.query.activityId
} }
getPayInfo(params).then(res => { })
this.payDetail = res.data }
setTimeout(this.getPayStatus(), 1000)
}) })
} }
}, },
destroyed() {
clearInterval(this.time)
},
mounted() { mounted() {
this.getPayDetail() clearInterval(this.time)
this.time = setInterval(() => {
this.getPayStatus()
}, 5000)
this.getQrcodeUrl() this.getQrcodeUrl()
this.initClipboard() this.initClipboard()
if (this.payDetail.order_id) {
setTimeout(this.getPayStatus(), 1000)
}
} }
} }
</script> </script>
...@@ -156,6 +177,17 @@ export default { ...@@ -156,6 +177,17 @@ export default {
} }
} }
} }
.main_btn {
display: flex;
justify-content: center;
.main_btn_home {
background: #b80140;
color: #fff;
}
.main_btn_order {
margin-left: 0.2rem;
}
}
#value { #value {
font-size: 0.3rem; font-size: 0.3rem;
opacity: 0; opacity: 0;
......
...@@ -2,17 +2,28 @@ ...@@ -2,17 +2,28 @@
<div class="main"> <div class="main">
<commonheader @back="handlePrev" :callBack="true" :title="title" /> <commonheader @back="handlePrev" :callBack="true" :title="title" />
<!-- 展示 --> <!-- 展示 -->
<img-show :stepList="stepList" :data="setpItem" @prev="handlePrev" @next="handleNext" v-if="setpItem.type === 1" /> <template v-if="Object.keys(stepList).length">
<!-- 表单 --> <img-show
<sign-form :stepList="stepList"
:data="setpItem" :data="setpItem"
:stepList="stepList" @prev="handlePrev"
:stepIndex="stepIndex" @next="handleNext"
@prev="handlePrev" v-if="setpItem.type === 1"
@next="handleNext" />
v-if="setpItem.type === 2" <!-- 表单 -->
:isShowSkip="isShowSkip" <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"
/>
</template>
</div> </div>
</template> </template>
...@@ -20,37 +31,93 @@ ...@@ -20,37 +31,93 @@
import SignForm from '../components/SignForm.vue' import SignForm from '../components/SignForm.vue'
import ImgShow from '../components/ImgShow.vue' import ImgShow from '../components/ImgShow.vue'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
import { getActivityDetail } from '../api'
export default { export default {
components: { SignForm, ImgShow, Commonheader }, components: { SignForm, ImgShow, Commonheader },
data() { data() {
return { return {
title: '报名主页面', title: '报名主页面',
stepIndex: 0, stepIndex: 0,
isShowSkip: '' isShowSkip: '',
stepList: [],
detailList: {
info: {}
}
} }
}, },
computed: { computed: {
stepItemid() {
return JSON.parse(window.localStorage.getItem('detailList')).other_fill_in.id
},
stepList() {
return JSON.parse(window.localStorage.getItem('stepList'))
},
setpItem() { setpItem() {
return this.stepList[this.stepIndex] if (this.$route.query.stepIndex) {
return this.stepList[this.$route.query.stepIndex]
} else {
return this.stepList[this.stepIndex]
}
} }
}, },
mounted() { mounted() {
// this.stepIndex = window.localStorage.getItem('stepIndex') this.activity_detail_id = this.$route.query.activity_detail_id
if (this.$route.query.isShowSkip) { if (this.$route.query.isShowSkip) {
this.isShowSkip = this.$route.query.isShowSkip this.isShowSkip = this.$route.query.isShowSkip
} else { } else {
this.isShowSkip = '' this.isShowSkip = ''
} }
this.getActivityDetail()
}, },
methods: { 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)
} else {
this.stepIndex = newIndex < 0 ? 0 : newIndex
}
})
},
handlePrev() { handlePrev() {
// this.stepIndex--
if (this.stepIndex <= 0) { if (this.stepIndex <= 0) {
this.$router.push('/') this.$router.push('/')
} else { } else {
......
...@@ -9,10 +9,7 @@ const store = new Vuex.Store({ ...@@ -9,10 +9,7 @@ const store = new Vuex.Store({
user: {}, user: {},
allSettings: {}, allSettings: {},
stepIndex: 0, stepIndex: 0,
detailList: {}, stepResult: []
stepResult: [],
stepForm: [],
stepOrderInfo: {}
}, },
mutations: { mutations: {
setUser(state, user) { setUser(state, user) {
...@@ -24,17 +21,9 @@ const store = new Vuex.Store({ ...@@ -24,17 +21,9 @@ const store = new Vuex.Store({
saveStepIndex(state, stepIndex) { saveStepIndex(state, stepIndex) {
state.stepIndex = stepIndex state.stepIndex = stepIndex
}, },
setDetailList(state, detailList) {
state.detailList = detailList
},
setStepResult(state, stepResult) { setStepResult(state, stepResult) {
state.stepResult = stepResult state.stepResult = stepResult
},
setFormList(state, stepForm) {
state.stepForm = stepForm
},
setStepOrderInfo(state, stepOrderInfo) {
state.stepOrderInfo = stepOrderInfo
} }
}, },
actions: { actions: {
......
...@@ -14,7 +14,8 @@ const allFormList = [ ...@@ -14,7 +14,8 @@ const allFormList = [
name: '性别', name: '性别',
key: 'gender', key: 'gender',
required: true, required: true,
optionlist: [ value: '0',
optionList: [
{ id: '0', option: '未知' }, { id: '0', option: '未知' },
{ id: '1', option: '男' }, { id: '1', option: '男' },
{ id: '2', option: '女' } { id: '2', option: '女' }
...@@ -136,7 +137,7 @@ const allFormList = [ ...@@ -136,7 +137,7 @@ const allFormList = [
name: '早餐', name: '早餐',
key: 'breakfast', key: 'breakfast',
placeholder: '请选择早餐', placeholder: '请选择早餐',
rue: '', value: '',
required: true, required: true,
optionList: ['有', '无'], optionList: ['有', '无'],
showPicker: false showPicker: false
......
...@@ -15,7 +15,8 @@ export default defineConfig({ ...@@ -15,7 +15,8 @@ export default defineConfig({
}, },
proxy: { proxy: {
'/api/highway': { '/api/highway': {
target: 'http://localhost-activity-frontend.ezijing.com', // target: 'http://localhost-activity-frontend.ezijing.com',
target: 'https://activity-frontend-api.ezijing.com',
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/api\/highway/, '') rewrite: path => path.replace(/^\/api\/highway/, '')
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论