提交 7798190a authored 作者: matian's avatar matian

feat:代码更新

上级 8a65949a
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
VITE_LOGIN_URL=https://login2.ezijing.com/auth/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
......@@ -11,6 +11,7 @@
"clipboard": "^2.0.8",
"element-ui": "^2.15.6",
"qrcode.vue": "^1.7.0",
"qs": "^6.10.3",
"query-string": "^7.0.1",
"vant": "^2.12.44",
"vue": "^2.6.14",
......@@ -2180,7 +2181,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
......@@ -3440,8 +3440,7 @@
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"node_modules/functional-red-black-tree": {
"version": "1.0.1",
......@@ -3462,7 +3461,6 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
......@@ -3583,7 +3581,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.1"
},
......@@ -3634,7 +3631,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
"dev": true,
"engines": {
"node": ">= 0.4"
},
......@@ -4498,7 +4494,6 @@
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
......@@ -4997,10 +4992,9 @@
}
},
"node_modules/qs": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"dev": true,
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"dependencies": {
"side-channel": "^1.0.4"
},
......@@ -5338,7 +5332,6 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dev": true,
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
......@@ -8067,7 +8060,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
......@@ -9026,8 +9018,7 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"functional-red-black-tree": {
"version": "1.0.1",
......@@ -9045,7 +9036,6 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
......@@ -9139,7 +9129,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
......@@ -9176,8 +9165,7 @@
"has-symbols": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
"dev": true
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
},
"has-tostringtag": {
"version": "1.0.0",
......@@ -9849,8 +9837,7 @@
"object-inspect": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
"dev": true
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
},
"object-keys": {
"version": "1.1.1",
......@@ -10223,10 +10210,9 @@
"requires": {}
},
"qs": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"dev": true,
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"requires": {
"side-channel": "^1.0.4"
}
......@@ -10487,7 +10473,6 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dev": true,
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
......
......@@ -14,6 +14,7 @@
"clipboard": "^2.0.8",
"element-ui": "^2.15.6",
"qrcode.vue": "^1.7.0",
"qs": "^6.10.3",
"query-string": "^7.0.1",
"vant": "^2.12.44",
"vue": "^2.6.14",
......
......@@ -27,3 +27,6 @@ export function uploadFile(data) {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
export function getAllSetting() {
return httpRequest.get('/api/highway/v1/util/common-map')
}
......@@ -4,3 +4,27 @@ import httpRequest from '@/utils/axios'
export function getUser() {
return httpRequest.get('/api/passport/account/get-user-info')
}
// 获取活动列表
export function getActivityList(params) {
return httpRequest.get('/api/highway/v1/activity/list', { params })
}
// 获取活动详情
export function getActivityDetail(params) {
return httpRequest.get('/api/highway/v1/activity/view', { params })
}
// 保存步骤信息
export function saveStepInfo(data) {
return httpRequest.post('/api/highway/v1/activity/step', data)
}
// 保存步骤信息
export function getPayInfo(data) {
return httpRequest.post('/api/highway/v1/activity/qr', data)
}
// 支付状态查询
export function getPayStatus(params) {
return httpRequest.get('/api/highway/v1/activity/pay-status', { params })
}
// 支付状态查询
export function getOrderList(params) {
return httpRequest.get('/api/highway/v1/activity/order', { params })
}
<template>
<div>
<van-nav-bar title="标题" left-text="返回" left-arrow fixed @click-left="onClickLeft">
<div class="main_header">
<van-nav-bar fixed :title="title" left-arrow @click-left="onClickLeft">
<template #right>
<van-icon name="contact" size="28" @click="onClickRight" />
</template>
......@@ -10,10 +10,20 @@
<script>
export default {
props: {
title: {
type: String,
default: ''
},
callBack: {
type: Boolean,
default: false
}
},
methods: {
// 首页返回按钮
onClickLeft() {
history.go(-1)
this.callBack ? this.$emit('back') : history.back()
},
// 右侧按钮 个人中心
onClickRight() {
......@@ -33,4 +43,9 @@ export default {
::v-deep .van-icon-contact {
color: #000;
}
.main_header {
position: fixed;
top: 0;
z-index: 2000;
}
</style>
......@@ -2,37 +2,51 @@
<div class="main">
<!-- 展示页面 -->
<div class="show_content">
<!-- <div class="show_content_img"> -->
<img
class="show_content_img"
src="https://img1.baidu.com/it/u=2404515989,4194507540&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500"
alt=""
/>
<!-- </div> -->
<div class="show_content_btn">报名填写</div>
<img class="show_content_img" :src="data.desc" />
<div class="show_content_btn" @click="handleSubmit">{{ data.title }}</div>
</div>
</div>
</template>
<script>
export default {}
export default {
props: {
stepList: { type: Array },
data: { type: Object },
// eslint-disable-next-line vue/require-prop-type-constructor
stepIndex: 0
},
methods: {
handleSubmit() {
const lastorder = this.stepList[this.stepList.length - 1].order
if (lastorder === this.data.order) {
this.$router.push('/')
} else {
this.$emit('next')
}
}
},
mounted() {
window.localStorage.setItem('stepForm', this.formList)
}
}
</script>
<style lang="scss" scoped>
.main {
background: #f7f7f7;
.show_content {
padding: 0.21rem 0.3rem 3.13rem 0.3rem;
.show_content_img {
margin-top: 0.84rem;
width: 6.9rem;
height: 6.81rem;
// background: rgba(255, 255, 255, 0.39);
height: 10.1rem;
border: 1px solid #707070;
}
.show_content_btn {
width: 6.42rem;
height: 0.88rem;
margin: 1.24rem auto;
background: #b80140;
border-radius: 0.44rem;
font-weight: 500;
......@@ -40,6 +54,10 @@ export default {}
font-size: 0.3rem;
text-align: center;
line-height: 0.88rem;
position: fixed;
bottom: 0.4rem;
left: 50%;
transform: translateX(-50%);
}
}
}
......
<template>
<div class="main">
<div class="main_content">
<div class="main_content_banner"></div>
<img class="main_content_banner" :src="data.desc" alt="" />
<div class="main_content_form">
<van-form @submit="onSubmit">
<div v-for="(listIt, index) in formList" :key="index" class="main_content_form_list">
<div v-for="(listIt, formIndex) in formList" :key="formIndex" class="main_content_form_list">
<img
src="https://webapp-pub.ezijing.com/highway/h5/form_minus.png"
class="btn_minus"
@click="handleMinus"
v-if="formList.length > 1"
/>
<div class="formItemList_item" v-for="(item, index) in listIt" :key="index">
<!-- 输入框 -->
<div v-if="item.type === 'input'">
<van-field
ref="input"
v-model="item.value"
:name="item.name"
:label="item.label"
:name="item.key"
:label="item.name"
:placeholder="item.placeholder"
:rules="[{ required: item.isRequired, message: item.placeholder }]"
v-if="item.type === 'input'"
:rules="[{ required: item.required, message: item.placeholder }]"
clearable
border
/>
</div>
<!-- 单选框 -->
<van-field :name="item.name" :label="item.label" v-if="item.type === 'radio'">
<div v-if="item.type === 'radio'">
<van-field :name="item.key" :label="item.name" border>
<template #input>
<van-radio-group v-model="item.value" direction="horizontal">
<div v-for="(it, index) in item.radioList" :key="index">
<div v-for="(it, index) in item.optionList" :key="index">
<van-radio :name="it.id">{{ it.option }}</van-radio>
</div>
</van-radio-group>
</template>
</van-field>
</div>
<!-- 选择器 -->
<div v-if="item.type === 'select'">
<van-field
border
clickable
:name="item.name"
:value="value"
:label="item.label"
:name="item.key"
v-model="item.value"
:label="item.name"
:placeholder="item.placeholder"
@click="showPicker = true"
v-if="item.type === 'select'"
@click="showSelectPicker(formIndex, index)"
/>
<!-- 选择弹框 -->
<van-popup v-model="item.showPicker" position="bottom">
<van-picker
show-toolbar
:columns="item.optionList"
@confirm="onConfirm"
@cancel="showPicker = false"
/>
<van-popup v-model="showPicker" position="bottom" v-if="item.type === 'select'">
<!-- <van-calendar v-model="showPicker" @confirm="onConfirm" /> -->
<van-picker show-toolbar :columns="item.radioList" @confirm="onConfirm" @cancel="showPicker = false" />
</van-popup>
</div>
<div class="btn_operate">
<img
src="https://webapp-pub.ezijing.com/highway/h5/form_minus.png"
alt=""
class="btn_minus"
@click="handleMinus"
v-if="formList.length > 1"
<!-- 时间 -->
<div v-if="item.type === 'datetime'">
<van-field
border
clickable
:name="item.key"
v-model="item.value"
:label="item.name"
:placeholder="item.placeholder"
@click="showTime(formIndex, index)"
/>
<!-- 时间弹框 -->
<van-popup v-model="item.showPicker" position="bottom">
<van-datetime-picker type="datetime" @confirm="onConfirmTime" @cancel="showPickerTime = false" />
</van-popup>
</div>
</div>
<div class="btn_operate">
<img
src="https://webapp-pub.ezijing.com/highway/h5/form_add.png"
alt=""
class="btn_add"
@click="handleAdd"
v-if="index === formList.length - 1"
v-if="formIndex === formList.length - 1"
/>
</div>
</div>
<div class="main_content_btns">
<van-button round block native-type="submit" class="main_content_btn">提交</van-button>
</div>
</van-form>
</div>
<div class="main_content_footer">
<template v-if="isShowSkip !== '1'">
<van-checkbox v-model="checkedPay" shape="square" class="main_content_skipPay">
{{ data.skip_pay_title }}</van-checkbox
>
</template>
<van-button
round
block
native-type="submit"
:class="[isShowSkip === '1' ? 'main_content_btn1' : 'main_content_btn']"
@click="onSubmit"
>{{ data.title }}</van-button
>
</div>
</div>
</div>
</template>
<script>
import { saveStepInfo } from '../api'
import allFormList from '@/utils/formList'
export default {
props: {
stepList: { type: Array },
data: { type: Object },
// eslint-disable-next-line vue/require-prop-type-constructor
stepIndex: 0,
isShowSkip: { type: String }
},
data() {
return {
value: '',
checkedPay: false,
index: 0,
cIndex: 0,
showPicker: false,
showPickerTime: false,
formList: [],
formItemList: [
{
type: 'input',
label: '姓名',
placeholder: '请输入姓名',
isRequired: true,
name: 'name',
value: ''
},
{
type: 'input',
label: '电话',
placeholder: '请输入电话',
isRequired: true,
name: 'mobile',
value: ''
},
{
type: 'radio',
label: '性别',
name: 'sex',
isRequired: true,
radioList: [
{ id: '0', option: '女' },
{ id: '1', option: '男' }
]
},
{
type: 'select',
label: '房型',
name: 'hotelType',
placeholder: '请选择房型',
isRequired: true,
value: '',
radioList: ['单间', '标间']
}
]
form: {},
stepOrderInfo: {},
join_rand: ''
}
},
mounted() {
window.localStorage.setItem('stepIndex', this.stepIndex)
this.$store.commit('saveStepIndex', this.stepIndex)
//
if (this.$store.state.stepForm.length) {
this.formList = this.$store.state.stepForm
} else {
this.handleAdd()
}
},
methods: {
// 提交
onSubmit() {
const result = []
window.localStorage.setItem('stepForm', JSON.stringify(this.formList))
console.log(window.localStorage.getItem('stepForm'))
this.$store.commit('setFormList', this.formList)
this.formList.forEach(item => {
const resultObj = {}
item.forEach(obj => {
resultObj[obj.name] = obj.value
resultObj[obj.key] = obj.value
})
result.push(resultObj)
})
// console.log(result)
if (JSON.parse(window.localStorage.getItem('detailList'))?.other_fill_in?.list.length) {
this.join_rand = JSON.parse(
window.localStorage.getItem('detailList')
).other_fill_in.list[0].pay_records.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 {
this.join_rand = ''
}
console.log(this.join_rand)
const params = {
activity_id: this.data.activity_id,
activity_detail_id: this.data.id,
need_skip: this.checkedPay ? '1' : '0',
users_info: result,
company_id: '',
join_rand: this.join_rand
}
saveStepInfo(params).then(res => {
if (res.code === 0) {
this.stepOrderInfo = res.data
window.localStorage.setItem('stepOrderInfo', JSON.stringify(this.stepOrderInfo))
this.$store.commit('setStepOrderInfo', this.stepOrderInfo)
if (this.checkedPay) {
const lastorder = this.stepList[this.stepList.length - 1].order
if (lastorder === this.data.order) {
this.$router.push('/')
} else {
this.$emit('next')
}
} else {
this.$router.push({
path: '/OrderConfirm',
query: {
list: result
stepOrderInfo: this.stepOrderInfo
}
})
}
}
})
},
......@@ -141,54 +204,54 @@ export default {
},
// 表单项增加
handleAdd() {
const arr = [
{
type: 'input',
label: '姓名',
placeholder: '请输入姓名',
isRequired: true,
name: 'name',
value: ''
const userFields = JSON.parse(this.data.user_fields).concat()
const allUserFields = userFields.reduce((a, b) => {
const data = allFormList.find(item => item.key === b.key)
if (data) {
a.push(Object.assign({}, data))
}
return a
}, [])
this.formList.push(allUserFields)
if (this.formList.length === 1) {
this.formList[0].forEach(item => {
if (item.key === 'name') {
return (item.value = JSON.parse(window.localStorage.getItem('detailList')).info.name)
} else if (item.key === 'mobile') {
return (item.value = JSON.parse(window.localStorage.getItem('detailList')).info.mobile)
}
})
}
},
{
type: 'input',
label: '电话',
placeholder: '请输入电话',
isRequired: true,
name: 'mobile',
value: ''
onConfirmTime(time) {
this.formList[this.index][this.cIndex].value = this.bgDate(time)
this.formList[this.index][this.cIndex].showPicker = false
},
{
type: 'radio',
label: '性别',
name: 'sex',
isRequired: true,
radioList: [
{ id: '0', option: '女' },
{ id: '1', option: '男' }
]
bgDate(val) {
const d = new Date(val)
const date = `${d.getFullYear()}-${this.toDo(d.getMonth() + 1)}-${this.toDo(d.getDate())} ${this.toDo(
d.getHours()
)}:${this.toDo(d.getMinutes())}:${this.toDo(d.getSeconds())}`
return date
},
{
type: 'select',
label: '房型',
name: 'hotelType',
placeholder: '请选择房型',
isRequired: true,
value: '',
radioList: ['单间', '标间'],
minDate: new Date(2020, 0, 1),
maxDate: new Date(2025, 10, 1),
currentDate: new Date()
}
]
this.formList.push(arr)
// console.log(this.formList, '123')
// console.log('000', this.formList)
toDo(n) {
return n < 10 ? `0${n}` : n
},
showTime(index, cIndex) {
this.formList[index][cIndex].showPicker = true
this.index = index
this.cIndex = cIndex
},
showSelectPicker(index, cIndex) {
this.formList[index][cIndex].showPicker = true
this.index = index
this.cIndex = cIndex
},
onConfirm(value) {
this.value = value
this.showPicker = false
this.formList[this.index][this.cIndex].value = value
this.formList[this.index][this.cIndex].showPicker = false
}
}
}
......@@ -197,25 +260,31 @@ export default {
<style lang="scss" scoped>
.main {
background-color: #f7f7f7;
height: 100vh;
.main_content {
padding: 0.21rem 0.3rem 3.13rem 0.3rem;
padding: 0.21rem 0.3rem 4.13rem 0.3rem;
.main_content_banner {
margin-top: 0.84rem;
width: 6.9rem;
height: 2.97rem;
background: rgba(255, 255, 255, 0.39);
border: 1px solid #707070;
border-radius: 0.2rem;
}
.main_content_form {
width: 6.9rem;
opacity: 1;
border-radius: 0.2rem;
border-radius: 20px;
margin-top: 0.32rem;
}
.main_content_form_list {
margin-top: 0.43rem;
background: #fff;
.btn_minus {
float: right;
width: 0.5072rem;
height: 0.5072rem;
margin: 0.3rem 0.3rem 0 0;
}
}
.btn_operate {
float: right;
......@@ -228,13 +297,48 @@ export default {
margin-right: 0.31rem;
}
}
.main_content_btns {
margin-top: 1.02rem;
.main_content_footer {
height: 1.81rem;
// margin-top: 1.02rem;
position: fixed;
bottom: 0.3rem;
background: #fff;
width: 100%;
margin-left: -0.3rem;
margin-bottom: -0.3rem;
.main_content_skipPay {
font-size: 0.24rem;
font-weight: 400;
color: #999999;
margin-left: 0.8rem;
opacity: 1;
}
.main_content_btn {
width: 6.9rem;
background: #b80140;
color: #ffffff;
margin-left: 0.28rem;
}
.main_content_btn1 {
width: 6.9rem;
background: #b80140;
color: #ffffff;
margin-left: 0.28rem;
margin-top: 0.4rem;
}
}
}
}
::v-deep .van-icon {
width: 0.24rem;
height: 0.24rem;
text-align: center;
}
::v-deep .van-checkbox__icon {
font-size: 0.16rem;
}
::v-deep .van-checkbox__label {
color: #999999;
margin-top: 0.1rem;
}
</style>
<template>
<div class="main">
<!-- 头部标题 -->
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed>
<template #right>
<van-icon name="contact" size="28" @click="onClickRight" />
</template>
</van-nav-bar> -->
<commonheader />
<commonheader :title="title" />
<div class="main_content">
<!-- banner卡片 -->
<!-- <div class="main_content_banner"></div> -->
<img
class="main_content_banner"
src="https://img1.baidu.com/it/u=1407750889,3441968730&fm=253&fmt=auto&app=120&f=JPEG?w=1200&h=799"
......@@ -41,13 +35,17 @@
<div class="main_content_activity">
<div class="main_content_activity_tit">会议</div>
<!-- 活动列表 -->
<div class="main_content_activity_list" v-for="(item, index) in activityList" :key="index" @click="handleSign">
<div class="activity_list_left">
<div class="activity_list_left_tit">{{ item.title }}</div>
<div class="activity_list_left_con">{{ item.desc }}</div>
<div
class="main_content_activity_list"
v-for="(item, index) in activityList"
:key="index"
@click="handleSignCheck(item)"
>
<div class="activity_list_top">
<div class="activity_list_top_tit">{{ item.name }}</div>
<div class="activity_list_top_date">{{ item.activity_time }}</div>
</div>
<div class="activity_list_right">
<div class="activity_list_right_date">{{ item.date }}</div>
<div class="activity_list_bottom">
<van-icon name="arrow" size="14" />
</div>
</div>
......@@ -57,40 +55,18 @@
</template>
<script>
import { Dialog } from 'vant'
import { Toast, Dialog } from 'vant'
import { getActivityList, getActivityDetail } from '../api'
import Commonheader from '../components/Commonheader.vue'
export default {
components: { Commonheader },
data() {
return {
isSign: false,
activityList: [
{
title: '和地方的房价高合金和服务范围',
desc: '的南非举办峰会上发表时间和部分称为举步维艰还不如风景还是不错看剧本看见办法',
date: '2022-12-02'
},
{
title: '和地方的房价高合金和服务范围',
desc: '的南非举办峰会上发表时间和部分称为举步维艰还不如风景还是不错看剧本看见办法',
date: '2022-12-02'
},
{
title: '和地方的房价高合金和服务范围',
desc: '的南非举办峰会上发表时间和部分称为举步维艰还不如风景还是不错看剧本看见办法',
date: '2022-12-02'
},
{
title: '和地方的房价高合金和服务范围',
desc: '的南非举办峰会上发表时间和部分称为举步维艰还不如风景还是不错看剧本看见办法',
date: '2022-12-02'
},
{
title: '和地方的房价高合金和服务范围',
desc: '的南非举办峰会上发表时间和部分称为举步维艰还不如风景还是不错看剧本看见办法',
date: '2022-12-02'
}
]
title: '首页',
ismySign: true,
isOtherSign: true,
activityList: [], // 活动列表
detailList: {} // 活动详情
}
},
methods: {
......@@ -100,28 +76,116 @@ export default {
onClickRight() {
this.$router.push('/PersonalCenter')
},
handleSign() {
if (this.isSign === true) {
// 获取活动列表
getActivityList() {
getActivityList().then(res => {
this.activityList = res.data.list
})
},
// 报名
handleSignCheck(item) {
// 未登录
if (!this.$store.state.user) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else {
this.getActivityDetail(item)
//
}
},
// 获取活动详情
getActivityDetail(item) {
const params = { id: item.id }
getActivityDetail(params).then(res => {
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)
})
},
handleSign(item) {
const time = new Date().getTime()
const startTime = new Date(item.start_time).getTime()
const endTime = new Date(item.end_time).getTime()
if (time >= startTime && time < endTime) {
if (this.detailList.other_fill_in.need_fill_in_status) {
// 有需要填写的步骤
Dialog.confirm({
title: '标题',
title: '提示',
message: '还有报名流程未交费',
confirmButtonText: '继续报名',
cancelButtonText: '开始学习',
closeOnClickOverlay: true
})
.then(() => {
// on confirm
this.$router.push({
path: '/SignMainPage'
})
})
.catch(() => {
// on cancel
})
// 没有需要填写的步骤
} 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'
})
} else {
Dialog.confirm({
title: '提示',
message: '',
confirmButtonText: '重新报名',
cancelButtonText: '开始学习',
closeOnClickOverlay: true
})
.then(() => {
this.$router.push({
path: '/SignMainPage'
})
})
.catch(() => {})
}
}
} else if (time > endTime) {
Toast('该活动已结束,无法报名')
} else if (time < startTime) {
Toast('该活动尚未开始,暂无法报名')
}
}
},
mounted() {}
mounted() {
// 获取活动列表
this.getActivityList()
}
}
</script>
......@@ -130,15 +194,12 @@ export default {
background-color: #f7f7f7;
.main_content {
margin-top: 0.46rem;
height: 100%;
padding: 0.51rem 0.3rem 0.3rem 0.3rem;
padding: 0 0.3rem 0.3rem 0.3rem;
.main_content_banner {
width: 6.9rem;
margin-top: 1rem;
width: 100%;
height: 2.97rem;
// background-color: rgb(192, 162, 162);
border-radius: 0.1rem;
// background: url('https://img1.baidu.com/it/u=1407750889,3441968730&fm=253&fmt=auto&app=120&f=JPEG?w=1200&h=799') no-repeat;
// background-size: 100%;
}
.main_content_dt {
margin: 0.3rem 0 0.3rem 0;
......@@ -191,46 +252,31 @@ export default {
.main_content_activity_list {
box-sizing: border-box;
padding: 0.2rem 0.25rem 0.2rem 0.3rem;
// width: 6.9rem;
width: 100%;
height: 1.12rem;
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: column;
background-color: #fff;
border-radius: 0.2rem;
margin-top: 0.24rem;
.activity_list_left {
.activity_list_top {
display: flex;
flex-direction: column;
.activity_list_left_tit {
justify-content: space-between;
.activity_list_top_tit {
font-size: 0.28rem;
font-weight: 400;
color: #333333;
}
.activity_list_left_con {
margin-top: 0.2rem;
width: 4.08rem;
font-size: 0.24rem;
font-weight: 400;
color: #666666;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.activity_list_right {
display: flex;
flex-direction: column;
align-items: flex-end;
.activity_list_right_date {
.activity_list_top_date {
font-size: 0.22rem;
font-weight: 400;
color: #999999;
}
.activity_list_right_icon {
margin-top: 0.2rem;
}
.activity_list_bottom {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
}
......
<template>
<div class="main">
<!-- 头部标题 -->
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed>
<template #right>
<van-icon name="contact" size="28" />
</template>
</van-nav-bar> -->
<commonheader />
<commonheader :title="title" />
<div class="main_content">
<!-- 头部tab -->
<van-tabs v-model="active" animated sticky>
<van-tab v-for="(it, index) in orderTab" :key="index" :title="it.title">
<div 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">
开发票
</van-button>
</div>
<!-- 订单列表 -->
<div v-if="getDataByType(it.type).length" class="main_content_orderList">
<div class="orderList" v-for="(item, index) in getDataByType(it.type)" :key="index">
<div class="orderList_status">{{ payStatus[item.status] }}</div>
<div class="orderList_con">
<div class="orderList_con_left">
<div class="orderList_con_left_tit">{{ item.title }}</div>
<div class="orderList_con_left_num">人数:{{ item.num }}</div>
<div class="orderList_con_left_tit">{{ item.activity.name }}</div>
<div class="orderList_con_left_num">人数:{{ item.count }}</div>
</div>
<div class="orderList_con_price">¥{{ item.price }}</div>
<div class="orderList_con_price">¥{{ item.amount }}</div>
</div>
<div class="orderList_pay">
<div class="orderList_pay_tit">需付款:</div>
<div class="orderList_pay_price">{{ item.needPay }}</div>
<div class="orderList_pay_price">{{ item.amount }}</div>
</div>
<div class="orderList_btn">
<van-button round size="small" v-if="item.status === 'hasNopay' || item.status === 'partpay'"
>删除订单</van-button
>
<van-button
round
size="small"
style="margin-left: 0.42rem"
v-if="item.status === 'hasNopay' || item.status === 'partPay'"
@click="$router.push('PayDetail')"
v-if="item.status === 0 || item.status === 1"
@click="handlePay(item)"
>去支付</van-button
>
<!-- <van-button round size="small" style="margin-left: 0.42rem" v-if="item.status === 'isFinished'"
>开发票</van-button
> -->
<!-- <van-button round size="small" style="margin-left: 0.42rem" v-if="item.status === 'isTicket'"
>已开票</van-button
> -->
</div>
</div>
</div>
<van-empty v-else description="暂无订单" class="main_content_empty" />
</van-tab>
</van-tabs>
</div>
......@@ -57,72 +45,58 @@
</template>
<script>
import { getOrderList } from '../api'
import Commonheader from '../components/Commonheader.vue'
export default {
components: { Commonheader },
data() {
return {
title: '我的订单',
active: 0,
payStatus: {
hasNopay: '未支付',
partPay: '部分缴费',
isFinished: '已完成'
// isTicket: '已开票'
0: '未支付',
1: '部分缴费',
2: '已完成'
},
orderTab: [
{ title: '全部', type: 'all' },
{ title: '未支付', type: 'hasNopay' },
{ title: '部分缴费', type: 'partPay' },
{ title: '已完成', type: 'isFinished' }
// { title: '已开票', type: 'isTicket' }
],
orderList: [
{
status: 'hasNopay',
title: '的年纪俄方和金额是否接受',
price: '25',
num: 10,
needPay: '25'
},
{
status: 'partPay',
title: '端午节前后瑞回去',
price: '25',
num: 10,
needPay: '25'
},
{
status: 'isFinished',
title: '是佛教文化服务',
price: '25',
num: 10,
needPay: '25'
},
{
status: 'isTicket',
title: '呢减肥和复合物',
price: '25',
num: 10,
needPay: '25'
}
]
orderList: []
}
},
computed: {},
mounted() {
this.getOrderList()
},
methods: {
getOrderList() {
getOrderList().then(res => {
this.orderList = res.data
})
},
getDataByType(type) {
if (type === 'all') {
return this.orderList
} else if (type === 'hasNopay') {
return this.orderList.filter(item => item.status === 'hasNopay')
return this.orderList.filter(item => item.status === 0)
} else if (type === 'partPay') {
return this.orderList.filter(item => item.status === 'partPay')
return this.orderList.filter(item => item.status === 1)
} else if (type === 'isFinished') {
return this.orderList.filter(item => item.status === 'isFinished')
return this.orderList.filter(item => item.status === 2)
}
// else if (type === 'isTicket') {
// return this.orderList.filter(item => item.status === 'isTicket')
// }
},
handlePay(item) {
console.log(item.list, 'item')
this.$router.push({
path: 'OrderConfirm',
query: {
orderList: item
}
})
}
}
}
......@@ -130,18 +104,19 @@ export default {
<style lang="scss" scoped>
.main {
height: 100vh;
.main_content {
// background: #fff;
min-height: 100vh;
background-color: #f7f7f7;
.main_content {
height: 100%;
margin-top: 0.9rem;
.main_content_ticket {
padding-right: 0.3rem;
float: right;
margin-bottom: 0.3rem;
margin-top: -0.2rem;
margin-top: 0.8rem;
}
.main_content_orderList {
.orderList {
margin: 0.3rem;
padding: 0.3rem 0.2rem 0.3rem 0.34rem;
......@@ -214,5 +189,15 @@ export default {
}
}
}
.main_content_empty {
margin: 2rem 1rem;
}
}
}
::v-deep .van-sticky {
width: 100%;
position: fixed;
z-index: 1000;
top: 0.9rem;
}
</style>
<template>
<div class="main">
<!-- 头部标题 -->
<commonheader />
<commonheader @back="handlePrev" :callBack="true" :title="title" />
<div class="main_content">
<div class="main_content_list">
<van-checkbox-group v-model="selctOrderData" ref="checkboxGroup">
<div class="main_content_list_card" v-for="(item, index) in orderList" :key="index">
<!-- {{ stepOrderInfo }} -->
<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="card_header">
<van-checkbox :name="item"></van-checkbox>
<span class="card_header_title">{{ item.title }}</span>
<van-checkbox :name="item" :disabled="item.pay_record.pay_status === '1'"></van-checkbox>
<span class="card_header_title">{{ stepName }}</span>
</div>
<div class="card_con">
<p>{{ item.desc }}</p>
<p>{{ item.name }} {{ item.mobile }}</p>
</div>
<div class="card_fotter">
<div class="card_fotter_left">
<span class="price">¥</span>
<span class="price_num">{{ item.price }}<span class="price_num">.00</span></span>
<span class="price_num">{{ stepOrderInfo.pay_price }}<span class="price_num"></span></span>
</div>
<div class="card_fotter_left card_fotter_right">
<span class="price">单位已优惠</span>
<span class="price">¥</span>
<span class="price_num">{{ item.price }}<span class="price_num">.00</span></span>
<span class="price_num">{{
(Number(stepOrderInfo.pay_price).toFixed(2) - Number(item.pay_record.pay_amount).toFixed(2)).toFixed(
2
)
}}</span>
</div>
</div>
</div>
</van-checkbox-group>
</div>
</div>
<van-submit-bar :price="totalPrice" button-text="提交订单" :disabled="!selctOrderData.length" @submit="onSubmit">
<div class="main_footer">
<van-checkbox v-model="isAll" @click="checkAll">全选</van-checkbox>
</van-submit-bar>
<div class="main_footer_total">
<div class="main_footer_total_top"></div>
<div class="main_footer_total_top">
<div class="total_text">合计:</div>
<div class="total_sign">¥</div>
<div class="price">{{ totalPrice }}.00</div>
</div>
<div class="main_footer_total_bottom">
<div class="company_yh">单位已优惠</div>
<div class="company_sign">¥</div>
<div class="company_yh">{{ totalCompanyPrice.toFixed(2) }}</div>
</div>
</div>
<van-button round @click="handlePrev" class="prev_btn">上一页</van-button>
<van-button round :disabled="!selctOrderData.length" @click="onSubmit" class="pay_btn">去支付</van-button>
</div>
</div>
</template>
<script>
import { getActivityDetail } from '../api'
import Commonheader from '../components/Commonheader.vue'
export default {
components: { Commonheader },
data() {
return {
title: '订单确认',
isAll: false,
numVsible: true,
orderList: [
{
id: 1,
title: '订单点的电大点啊点订单点的电大点啊点',
desc: '张三;1234456789;男;北京市;某某',
price: 10,
num: 1
},
{
id: 2,
title: '订单点的电大点啊点订单点的电大点啊点',
desc: '张三;1234456789;男;北京市;某某',
price: 20,
num: 1
},
{
id: 3,
title: '订单点的电大点啊点订单点的电大点啊点',
desc: '张三;1234456789;男;北京市;某某',
price: 30,
num: 1
},
{
id: 4,
title: '订单点的电大点啊点订单点的电大点啊点',
desc: '张三;1234456789;男;北京市;某某',
price: 40,
num: 1
}
],
payDetail: {},
selctOrderData: [] // 选中的数据
}
},
computed: {
totalPrice() {
return this.selctOrderData.map(item => item.price * 100 * item.num).reduce((pre, nex) => (pre += nex), 0)
return this.selctOrderData.map(item => Number(item.pay_record.pay_amount)).reduce((pre, nex) => (pre += nex), 0)
},
totalCompanyPrice() {
return this.selctOrderData
.map(item => Number(this.stepOrderInfo.pay_price) - Number(item.pay_record.pay_amount))
.reduce((pre, nex) => (pre += nex), 0)
},
stepOrderInfo() {
return this.$route.query.stepOrderInfo || this.$route.query.orderList
},
stepName() {
return JSON.parse(window.localStorage.getItem('detailList')).activity.name
}
},
mounted() {
console.log(this.$route.query.orderList)
console.log(JSON.parse(window.localStorage.getItem('stepOrderInfo')))
// this.getActivityDetail()
},
methods: {
onClickLeft() {
history.go(-1)
// getActivityDetail() {
// const params = { id: this.$route.query.orderList.list[0].activity_id }
// getActivityDetail(params).then(res => {
// console.log(res)
// // this.stepOrderInfo = res.data
// })
// },
checkItem() {
if (this.selctOrderData.length === this.stepOrderInfo.list.length) {
this.isAll = true
} else {
this.isAll = false
}
},
handlePrev() {
this.$router.push({
path: '/SignMainPage',
query: {
currentIndex: window.localStorage.getItem('stepIndex'),
isShowSkip: '1'
}
})
},
checkAll() {
this.$refs.checkboxGroup.toggleAll(this.isAll)
},
onSubmit() {
console.log(this.selctOrderData)
if (this.selctOrderData.lenth && this.totalPrice === 0) {
this.$router.push('/')
} else {
this.$router.push({
path: '/PayDetail'
path: '/PayDetail',
query: {
pay_record_ids: this.selctOrderData.map(item => item.pay_record.id).toString(),
join_rand: this.$route.query.orderList.join_rand
}
})
}
},
onClickRight() {}
}
......@@ -148,11 +186,12 @@ export default {
align-items: center;
justify-items: center;
.price {
font-size: 0.14rem;
font-size: 0.2rem;
color: #b80140;
font-weight: 300;
}
.price_num {
font-size: 0.2rem;
font-size: 0.28rem;
font-weight: bold;
color: #b80140;
}
......@@ -165,5 +204,72 @@ export default {
}
}
}
.main_footer {
width: 100%;
height: 1.48rem;
background: #fff;
position: fixed;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
.main_footer_total {
// background: #000;
// width: 1.7rem;
height: 0.8rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.main_footer_total_top {
display: flex;
.total_text {
font-size: 0.24rem;
font-weight: 400;
color: #333333;
}
.total_sign {
font-size: 0.2rem;
color: #b80140;
}
.price {
font-size: 0.2rem;
font-weight: bold;
color: #b80140;
}
}
.main_footer_total_bottom {
display: flex;
.company_yh {
font-size: 0.24rem;
font-weight: 400;
color: #b80140;
}
.company_sign {
font-size: 0.2rem;
color: #b80140;
}
}
}
.prev_btn {
background: #f5f5f5;
font-size: 0.3rem;
font-weight: 500;
color: #333333;
}
.pay_btn {
background: #b80140;
font-size: 0.3rem;
font-weight: 500;
color: #ffffff;
}
}
}
::v-deep .van-checkbox__label {
font-size: 0.28rem;
font-weight: 400;
color: #999999;
}
</style>
<template>
<div class="main">
<commonheader />
<commonheader :title="title" />
<div class="main_content">
<div class="main_content_desc">1.打开支付宝扫码二维码支付,或长按保存二维码打开支付宝支付。</div>
<div class="main_content_qdCode">
<qrcode-vue :value="value" size="180" ref="qrcode" />
<qrcode-vue :value="payDetail.url" size="180" ref="qrcode" />
</div>
<div class="main_content_link">
2.
......@@ -22,7 +22,7 @@
>
复制链接在浏览器打开去支付
</div>
<div id="value">{{ value }}</div>
<div id="value">{{ payDetail.url }}</div>
</div>
</div>
</template>
......@@ -31,6 +31,7 @@
import QrcodeVue from 'qrcode.vue'
import Clipboard from 'clipboard'
import { Toast } from 'vant'
import { getPayInfo, getPayStatus } from '../api'
import commonheader from '../components/Commonheader.vue'
export default {
......@@ -40,9 +41,17 @@ export default {
},
data() {
return {
title: '订单支付',
qrcodeUrl: '',
value: 'http://www.baidu.com',
clipboard: null
clipboard: null,
status: '', // 支付状态
payDetail: {},
join_rand: ''
}
},
computed: {
pay_record_ids() {
return this.$route.query.pay_record_ids
}
},
methods: {
......@@ -65,11 +74,49 @@ export default {
Toast.fail('复制失败,请重新复制!')
this.clipboard.destroy()
})
},
getPayStatus() {
const params = {
order_id: this.payDetail.order_id
}
getPayStatus(params).then(res => {
if (res.code === 0) {
this.status = res.data.status
if (this.status === 2) {
this.$route.push('/')
}
}
})
},
getPayDetail() {
if (JSON.parse(window.localStorage.getItem('detailList'))?.other_fill_in?.list.length) {
this.join_rand = JSON.parse(
window.localStorage.getItem('detailList')
).other_fill_in.list[0].pay_records.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 {
this.join_rand = this.$route.query.join_rand || ''
}
const params = {
pay_record_ids: this.pay_record_ids,
join_rand: this.join_rand
}
getPayInfo(params).then(res => {
this.payDetail = res.data
setTimeout(this.getPayStatus(), 1000)
})
}
},
mounted() {
this.getPayDetail()
this.getQrcodeUrl()
this.initClipboard()
if (this.payDetail.order_id) {
setTimeout(this.getPayStatus(), 1000)
}
}
}
</script>
......
<template>
<div class="main">
<!-- 头部标题 -->
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed>
<template #right>
<van-icon name="contact" size="28" />
</template>
</van-nav-bar> -->
<commonheader />
<commonheader :title="title" />
<!-- 我的订单 -->
<div class="main_content">
<div class="main_content_order" @click="handleOrder">
<div class="main_content_order_text">我的订单</div>
<van-icon name="arrow" size="14" />
</div>
<div class="main_content_footer">退出登录</div>
<div class="main_content_footer" @click="handleLogout">退出登录</div>
</div>
</div>
</template>
......@@ -22,11 +17,19 @@
import Commonheader from '../components/Commonheader.vue'
export default {
components: { Commonheader },
data() {
return {
title: '个人中心'
}
},
methods: {
handleOrder() {
this.$router.push({
path: '/myOrder'
})
},
handleLogout() {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.origin)}`
}
}
}
......@@ -51,7 +54,7 @@ export default {
align-items: center;
padding: 0 0.25rem 0 0.3rem;
box-sizing: border-box;
margin-top: .21rem;
margin-top: 0.21rem;
.main_content_order_text {
font-size: 0.28rem;
font-weight: 400;
......@@ -69,7 +72,8 @@ export default {
color: #333333;
line-height: 0.88rem;
text-align: center;
margin-top: 6.11rem;
position: fixed;
bottom: 4.37rem;
}
}
}
......
<template>
<div class="main">
<!-- 头部标题 -->
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed>
<template #right>
<van-icon name="contact" size="28" />
</template>
</van-nav-bar> -->
<commonheader />
<img-show v-show="isShowStep" />
<sign-form v-show="isShowStep" />
<commonheader @back="handlePrev" :callBack="true" :title="title" />
<!-- 展示 -->
<img-show :stepList="stepList" :data="setpItem" @prev="handlePrev" @next="handleNext" v-if="setpItem.type === 1" />
<!-- 表单 -->
<sign-form
:data="setpItem"
:stepList="stepList"
:stepIndex="stepIndex"
@prev="handlePrev"
@next="handleNext"
v-if="setpItem.type === 2"
:isShowSkip="isShowSkip"
/>
</div>
</template>
......@@ -17,14 +21,44 @@ import SignForm from '../components/SignForm.vue'
import ImgShow from '../components/ImgShow.vue'
import Commonheader from '../components/Commonheader.vue'
export default {
components: {
SignForm,
ImgShow,
Commonheader
},
components: { SignForm, ImgShow, Commonheader },
data() {
return {
isShowStep: true
title: '报名主页面',
stepIndex: 0,
isShowSkip: ''
}
},
computed: {
stepItemid() {
return JSON.parse(window.localStorage.getItem('detailList')).other_fill_in.id
},
stepList() {
return JSON.parse(window.localStorage.getItem('stepList'))
},
setpItem() {
return this.stepList[this.stepIndex]
}
},
mounted() {
// this.stepIndex = window.localStorage.getItem('stepIndex')
if (this.$route.query.isShowSkip) {
this.isShowSkip = this.$route.query.isShowSkip
} else {
this.isShowSkip = ''
}
},
methods: {
handlePrev() {
// this.stepIndex--
if (this.stepIndex <= 0) {
this.$router.push('/')
} else {
this.stepIndex--
}
},
handleNext() {
this.stepIndex++
}
}
}
......
import Vue from 'vue'
import Vuex from 'vuex'
import { getUser, logout } from '@/api/base'
import { getUser, logout, getAllSetting } from '@/api/base'
Vue.use(Vuex)
export default new Vuex.Store({
const store = new Vuex.Store({
state: {
user: {}
user: {},
allSettings: {},
stepIndex: 0,
detailList: {},
stepResult: [],
stepForm: [],
stepOrderInfo: {}
},
mutations: {
setUser(state, user) {
state.user = user
},
setAllSettings(state, allSettings) {
state.allSettings = allSettings
},
saveStepIndex(state, stepIndex) {
state.stepIndex = stepIndex
},
setDetailList(state, detailList) {
state.detailList = detailList
},
setStepResult(state, stepResult) {
state.stepResult = stepResult
},
setFormList(state, stepForm) {
state.stepForm = stepForm
},
setStepOrderInfo(state, stepOrderInfo) {
state.stepOrderInfo = stepOrderInfo
}
},
actions: {
......@@ -43,6 +67,14 @@ export default new Vuex.Store({
return false
})
return isLogin
},
// 获取所有项目列表
getAllSetting({ commit }) {
getAllSetting().then(res => {
commit('setAllSettings', res.data)
})
}
}
})
store.dispatch('getAllSetting')
export default store
import axios from 'axios'
import queryString from 'query-string'
// import queryString from 'query-string'
import { Message } from 'element-ui'
import router from '../router'
import store from '../store'
import qs from 'qs'
const httpRequest = axios.create({
timeout: 60000,
......@@ -11,8 +14,23 @@ const httpRequest = axios.create({
// 请求拦截
httpRequest.interceptors.request.use(
function (config) {
// 设置项目
config.headers.tenant = store.state.activeProject?.tag
config.params = Object.assign({ project_prefix: store.state.activeProject?.tag }, config.params)
config.data = Object.assign({ project_prefix: store.state.activeProject?.tag }, config.data)
// 默认参数
const defaultHeaders = {
timestamp: parseInt(Date.now() / 1000),
nonce: Math.random().toString(36).slice(-8),
'secret-id': 'ezijing_20200410',
'secret-key': 'THIxz9hfbMDD5pil',
signature: 'UG7wBenexQhiuD2wpCwuxkU0jqcj006d'
}
config.headers = Object.assign(config.headers, defaultHeaders)
if (config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
config.data = queryString.stringify(config.data)
config.data = qs.stringify(config.data)
}
if (config.headers['Content-Type'] === 'multipart/form-data') {
const formData = new window.FormData()
......@@ -33,6 +51,20 @@ httpRequest.interceptors.response.use(
function (response) {
const { data } = response
if (data.code) {
// 未登录
if (data.code === 4001) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
}
// 没有权限
if (data.code === 4008 || data.code === 5018) {
router.push('/401')
}
// 题库分类修改
if (data.code === 403) {
Message({ message: '没有操作权限', type: 'error' })
return data
}
Message({ message: data.message, type: 'error' })
return Promise.reject(data)
}
return data
......@@ -46,11 +78,10 @@ httpRequest.interceptors.response.use(
} else {
Message.error(message || error.response.data)
}
return Promise.reject(error.response)
} else {
console.log(error)
}
return Promise.reject(error)
return Promise.reject(error.response || error)
}
)
......
import store from '@/store'
export default async function (to, from, next) {
if (to.meta.requiredLogin) {
// if (to.meta.requiredLogin) {
// } else {
// next()
// }
const isLogin = store.state.user.id || (await store.dispatch('checkLogin'))
if (!isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
}
} else {
next()
}
......
const allFormList = [
{ type: 'input', name: '姓名', placeholder: '请输入姓名', required: true, key: 'name', value: '', enable_edit: true },
{
type: 'input',
name: '电话',
placeholder: '请输入电话',
required: true,
key: 'mobile',
value: '',
enable_edit: true
},
{
type: 'radio',
name: '性别',
key: 'gender',
required: true,
optionlist: [
{ id: '0', option: '未知' },
{ id: '1', option: '男' },
{ id: '2', option: '女' }
]
},
{
type: 'input',
name: '邮箱',
placeholder: '请输入邮箱',
required: true,
key: 'email',
value: '',
enable_edit: true
},
{
type: 'input',
name: '公司',
placeholder: '请输入公司',
required: true,
key: 'company',
value: '',
enable_edit: true
},
{
type: 'input',
name: '职位',
placeholder: '请输入职位',
required: true,
key: 'position',
value: '',
enable_edit: true
},
{
type: 'input',
name: '身份证号码',
placeholder: '请输入身份证号码',
required: true,
key: 'id_number',
value: '',
enable_edit: true
},
{
type: 'input',
name: '编号',
placeholder: '请输入编号',
required: true,
key: 'number',
value: '',
enable_edit: true
},
{
type: 'input',
name: '国籍',
placeholder: '请输入国籍',
required: true,
key: 'country',
value: '',
enable_edit: true
},
{
type: 'input',
name: '省份',
placeholder: '请输入省份',
required: true,
key: 'provinces',
value: '',
enable_edit: true
},
{ type: 'input', name: '城市', placeholder: '请输入城市', required: true, key: 'city', value: '', enable_edit: true },
{
type: 'input',
name: '地址',
placeholder: '请输入地址',
required: true,
key: 'address',
value: '',
enable_edit: true
},
{
type: 'input',
name: '固话',
placeholder: '请输入固话',
required: true,
key: 'fixed_telephone',
value: '',
enable_edit: true
},
{
type: 'input',
name: '行业',
placeholder: '请输入行业',
required: true,
key: 'industry',
value: '',
enable_edit: true
},
{ type: 'input', name: 'QQ', placeholder: '请输入QQ', required: true, key: 'qq', value: '', enable_edit: true },
{
type: 'input',
name: '微信',
placeholder: '请输入微信',
required: true,
key: 'wechat',
value: '',
enable_edit: true
},
{ type: 'input', name: '钉钉', placeholder: '请输入钉钉', required: true, key: 'ding', value: '', enable_edit: true },
{
type: 'input',
name: '微博',
placeholder: '请输入微博',
required: true,
key: 'weibo',
value: '',
enable_edit: true
},
{
type: 'select',
name: '早餐',
key: 'breakfast',
placeholder: '请选择早餐',
rue: '',
required: true,
optionList: ['有', '无'],
showPicker: false
},
{
type: 'select',
name: '房型',
key: 'room_type',
placeholder: '请选择房型',
required: true,
value: '',
enable_edit: true,
optionList: ['温馨大床房', '豪华标准间', '豪华套房'],
showPicker: false
},
{
type: 'datetime',
name: '入住时间',
key: 'check_in_time',
placeholder: '请选择入住时间',
required: true,
value: '',
enable_edit: true,
optionList: [],
showPicker: false
},
{
type: 'datetime',
name: '离店时间',
key: 'check_out_time',
placeholder: '请选择离店时间',
required: true,
value: '',
enable_edit: true,
optionList: [],
showPicker: false
}
]
export default allFormList
......@@ -14,7 +14,12 @@ export default defineConfig({
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
},
proxy: {
'/api': 'https://project-api.ezijing.com'
'/api/highway': {
target: 'http://localhost-activity-frontend.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/highway/, '')
},
'/api': 'https://app.ezijing.com'
}
},
resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论