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

feat:代码更新

上级 8a65949a
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index 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_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_LOGIN_URL=https://login2.ezijing.com/auth/login/index
VITE_SHARE_URL=https://accounts.ezijing.com
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"qrcode.vue": "^1.7.0", "qrcode.vue": "^1.7.0",
"qs": "^6.10.3",
"query-string": "^7.0.1", "query-string": "^7.0.1",
"vant": "^2.12.44", "vant": "^2.12.44",
"vue": "^2.6.14", "vue": "^2.6.14",
...@@ -2180,7 +2181,6 @@ ...@@ -2180,7 +2181,6 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
"dependencies": { "dependencies": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2" "get-intrinsic": "^1.0.2"
...@@ -3440,8 +3440,7 @@ ...@@ -3440,8 +3440,7 @@
"node_modules/function-bind": { "node_modules/function-bind": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"dev": true
}, },
"node_modules/functional-red-black-tree": { "node_modules/functional-red-black-tree": {
"version": "1.0.1", "version": "1.0.1",
...@@ -3462,7 +3461,6 @@ ...@@ -3462,7 +3461,6 @@
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"dev": true,
"dependencies": { "dependencies": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has": "^1.0.3", "has": "^1.0.3",
...@@ -3583,7 +3581,6 @@ ...@@ -3583,7 +3581,6 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"dependencies": { "dependencies": {
"function-bind": "^1.1.1" "function-bind": "^1.1.1"
}, },
...@@ -3634,7 +3631,6 @@ ...@@ -3634,7 +3631,6 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.4" "node": ">= 0.4"
}, },
...@@ -4498,7 +4494,6 @@ ...@@ -4498,7 +4494,6 @@
"version": "1.11.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
"dev": true,
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
...@@ -4997,10 +4992,9 @@ ...@@ -4997,10 +4992,9 @@
} }
}, },
"node_modules/qs": { "node_modules/qs": {
"version": "6.10.1", "version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"dev": true,
"dependencies": { "dependencies": {
"side-channel": "^1.0.4" "side-channel": "^1.0.4"
}, },
...@@ -5338,7 +5332,6 @@ ...@@ -5338,7 +5332,6 @@
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dev": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.0", "call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2", "get-intrinsic": "^1.0.2",
...@@ -8067,7 +8060,6 @@ ...@@ -8067,7 +8060,6 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2" "get-intrinsic": "^1.0.2"
...@@ -9026,8 +9018,7 @@ ...@@ -9026,8 +9018,7 @@
"function-bind": { "function-bind": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"dev": true
}, },
"functional-red-black-tree": { "functional-red-black-tree": {
"version": "1.0.1", "version": "1.0.1",
...@@ -9045,7 +9036,6 @@ ...@@ -9045,7 +9036,6 @@
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has": "^1.0.3", "has": "^1.0.3",
...@@ -9139,7 +9129,6 @@ ...@@ -9139,7 +9129,6 @@
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": { "requires": {
"function-bind": "^1.1.1" "function-bind": "^1.1.1"
} }
...@@ -9176,8 +9165,7 @@ ...@@ -9176,8 +9165,7 @@
"has-symbols": { "has-symbols": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
"dev": true
}, },
"has-tostringtag": { "has-tostringtag": {
"version": "1.0.0", "version": "1.0.0",
...@@ -9849,8 +9837,7 @@ ...@@ -9849,8 +9837,7 @@
"object-inspect": { "object-inspect": {
"version": "1.11.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
"dev": true
}, },
"object-keys": { "object-keys": {
"version": "1.1.1", "version": "1.1.1",
...@@ -10223,10 +10210,9 @@ ...@@ -10223,10 +10210,9 @@
"requires": {} "requires": {}
}, },
"qs": { "qs": {
"version": "6.10.1", "version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"dev": true,
"requires": { "requires": {
"side-channel": "^1.0.4" "side-channel": "^1.0.4"
} }
...@@ -10487,7 +10473,6 @@ ...@@ -10487,7 +10473,6 @@
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dev": true,
"requires": { "requires": {
"call-bind": "^1.0.0", "call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2", "get-intrinsic": "^1.0.2",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"qrcode.vue": "^1.7.0", "qrcode.vue": "^1.7.0",
"qs": "^6.10.3",
"query-string": "^7.0.1", "query-string": "^7.0.1",
"vant": "^2.12.44", "vant": "^2.12.44",
"vue": "^2.6.14", "vue": "^2.6.14",
......
...@@ -27,3 +27,6 @@ export function uploadFile(data) { ...@@ -27,3 +27,6 @@ export function uploadFile(data) {
headers: { 'Content-Type': 'multipart/form-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' ...@@ -4,3 +4,27 @@ import httpRequest from '@/utils/axios'
export function getUser() { export function getUser() {
return httpRequest.get('/api/passport/account/get-user-info') 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> <template>
<div> <div class="main_header">
<van-nav-bar title="标题" left-text="返回" left-arrow fixed @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 name="contact" size="28" @click="onClickRight" />
</template> </template>
...@@ -10,10 +10,20 @@ ...@@ -10,10 +10,20 @@
<script> <script>
export default { export default {
props: {
title: {
type: String,
default: ''
},
callBack: {
type: Boolean,
default: false
}
},
methods: { methods: {
// 首页返回按钮 // 首页返回按钮
onClickLeft() { onClickLeft() {
history.go(-1) this.callBack ? this.$emit('back') : history.back()
}, },
// 右侧按钮 个人中心 // 右侧按钮 个人中心
onClickRight() { onClickRight() {
...@@ -33,4 +43,9 @@ export default { ...@@ -33,4 +43,9 @@ export default {
::v-deep .van-icon-contact { ::v-deep .van-icon-contact {
color: #000; color: #000;
} }
.main_header {
position: fixed;
top: 0;
z-index: 2000;
}
</style> </style>
...@@ -2,37 +2,51 @@ ...@@ -2,37 +2,51 @@
<div class="main"> <div class="main">
<!-- 展示页面 --> <!-- 展示页面 -->
<div class="show_content"> <div class="show_content">
<!-- <div class="show_content_img"> --> <img class="show_content_img" :src="data.desc" />
<img <div class="show_content_btn" @click="handleSubmit">{{ data.title }}</div>
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>
</div> </div>
</div> </div>
</template> </template>
<script> <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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .main {
background: #f7f7f7;
.show_content { .show_content {
padding: 0.21rem 0.3rem 3.13rem 0.3rem; padding: 0.21rem 0.3rem 3.13rem 0.3rem;
.show_content_img { .show_content_img {
margin-top: 0.84rem; margin-top: 0.84rem;
width: 6.9rem; width: 6.9rem;
height: 6.81rem; height: 10.1rem;
// background: rgba(255, 255, 255, 0.39);
border: 1px solid #707070; border: 1px solid #707070;
} }
.show_content_btn { .show_content_btn {
width: 6.42rem; width: 6.42rem;
height: 0.88rem; height: 0.88rem;
margin: 1.24rem auto;
background: #b80140; background: #b80140;
border-radius: 0.44rem; border-radius: 0.44rem;
font-weight: 500; font-weight: 500;
...@@ -40,6 +54,10 @@ export default {} ...@@ -40,6 +54,10 @@ export default {}
font-size: 0.3rem; font-size: 0.3rem;
text-align: center; text-align: center;
line-height: 0.88rem; line-height: 0.88rem;
position: fixed;
bottom: 0.4rem;
left: 50%;
transform: translateX(-50%);
} }
} }
} }
......
<template> <template>
<div class="main"> <div class="main">
<div class="main_content"> <div class="main_content">
<div class="main_content_banner"></div> <img class="main_content_banner" :src="data.desc" alt="" />
<div class="main_content_form"> <div class="main_content_form">
<van-form @submit="onSubmit"> <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 class="formItemList_item" v-for="(item, index) in listIt" :key="index">
<!-- 输入框 --> <!-- 输入框 -->
<van-field <div v-if="item.type === 'input'">
ref="input" <van-field
v-model="item.value" ref="input"
:name="item.name" v-model="item.value"
:label="item.label" :name="item.key"
:placeholder="item.placeholder" :label="item.name"
:rules="[{ required: item.isRequired, message: item.placeholder }]" :placeholder="item.placeholder"
v-if="item.type === 'input'" :rules="[{ required: item.required, message: item.placeholder }]"
clearable clearable
/> border
/>
</div>
<!-- 单选框 --> <!-- 单选框 -->
<van-field :name="item.name" :label="item.label" v-if="item.type === 'radio'"> <div v-if="item.type === 'radio'">
<template #input> <van-field :name="item.key" :label="item.name" border>
<van-radio-group v-model="item.value" direction="horizontal"> <template #input>
<div v-for="(it, index) in item.radioList" :key="index"> <van-radio-group v-model="item.value" direction="horizontal">
<van-radio :name="it.id">{{ it.option }}</van-radio> <div v-for="(it, index) in item.optionList" :key="index">
</div> <van-radio :name="it.id">{{ it.option }}</van-radio>
</van-radio-group> </div>
</template> </van-radio-group>
</van-field> </template>
</van-field>
</div>
<!-- 选择器 --> <!-- 选择器 -->
<van-field <div v-if="item.type === 'select'">
clickable <van-field
:name="item.name" border
:value="value" clickable
:label="item.label" :name="item.key"
:placeholder="item.placeholder" v-model="item.value"
@click="showPicker = true" :label="item.name"
v-if="item.type === 'select'" :placeholder="item.placeholder"
/> @click="showSelectPicker(formIndex, index)"
<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 v-model="item.showPicker" position="bottom">
</van-popup> <van-picker
show-toolbar
:columns="item.optionList"
@confirm="onConfirm"
@cancel="showPicker = false"
/>
</van-popup>
</div>
<!-- 时间 -->
<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>
<div class="btn_operate"> <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"
/>
<img <img
src="https://webapp-pub.ezijing.com/highway/h5/form_add.png" src="https://webapp-pub.ezijing.com/highway/h5/form_add.png"
alt=""
class="btn_add" class="btn_add"
@click="handleAdd" @click="handleAdd"
v-if="index === formList.length - 1" v-if="formIndex === formList.length - 1"
/> />
</div> </div>
</div> </div>
<div class="main_content_btns">
<van-button round block native-type="submit" class="main_content_btn">提交</van-button>
</div>
</van-form> </van-form>
</div> </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>
</div> </div>
</template> </template>
<script> <script>
import { saveStepInfo } from '../api'
import allFormList from '@/utils/formList'
export default { export default {
props: {
stepList: { type: Array },
data: { type: Object },
// eslint-disable-next-line vue/require-prop-type-constructor
stepIndex: 0,
isShowSkip: { type: String }
},
data() { data() {
return { return {
value: '', checkedPay: false,
index: 0,
cIndex: 0,
showPicker: false, showPicker: false,
showPickerTime: false,
formList: [], formList: [],
formItemList: [ form: {},
{ stepOrderInfo: {},
type: 'input', join_rand: ''
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: ['单间', '标间']
}
]
} }
}, },
mounted() { mounted() {
this.handleAdd() 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: { methods: {
// 提交
onSubmit() { onSubmit() {
const result = [] 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 => { this.formList.forEach(item => {
const resultObj = {} const resultObj = {}
item.forEach(obj => { item.forEach(obj => {
resultObj[obj.name] = obj.value resultObj[obj.key] = obj.value
}) })
result.push(resultObj) result.push(resultObj)
}) })
// console.log(result)
this.$router.push({ if (JSON.parse(window.localStorage.getItem('detailList'))?.other_fill_in?.list.length) {
path: '/OrderConfirm', this.join_rand = JSON.parse(
query: { window.localStorage.getItem('detailList')
list: result ).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: {
stepOrderInfo: this.stepOrderInfo
}
})
}
} }
}) })
}, },
...@@ -141,54 +204,54 @@ export default { ...@@ -141,54 +204,54 @@ export default {
}, },
// 表单项增加 // 表单项增加
handleAdd() { handleAdd() {
const arr = [ const userFields = JSON.parse(this.data.user_fields).concat()
{ const allUserFields = userFields.reduce((a, b) => {
type: 'input', const data = allFormList.find(item => item.key === b.key)
label: '姓名', if (data) {
placeholder: '请输入姓名', a.push(Object.assign({}, data))
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: ['单间', '标间'],
minDate: new Date(2020, 0, 1),
maxDate: new Date(2025, 10, 1),
currentDate: new Date()
} }
] return a
this.formList.push(arr) }, [])
// console.log(this.formList, '123') this.formList.push(allUserFields)
// console.log('000', this.formList)
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)
}
})
}
}, },
onConfirmTime(time) {
this.formList[this.index][this.cIndex].value = this.bgDate(time)
this.formList[this.index][this.cIndex].showPicker = false
},
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
},
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) { onConfirm(value) {
this.value = value this.formList[this.index][this.cIndex].value = value
this.showPicker = false this.formList[this.index][this.cIndex].showPicker = false
} }
} }
} }
...@@ -197,25 +260,31 @@ export default { ...@@ -197,25 +260,31 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .main {
background-color: #f7f7f7; background-color: #f7f7f7;
height: 100vh;
.main_content { .main_content {
padding: 0.21rem 0.3rem 3.13rem 0.3rem; padding: 0.21rem 0.3rem 4.13rem 0.3rem;
.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;
background: rgba(255, 255, 255, 0.39);
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;
opacity: 1; opacity: 1;
border-radius: 0.2rem; border-radius: 20px;
margin-top: 0.32rem; margin-top: 0.32rem;
} }
.main_content_form_list { .main_content_form_list {
margin-top: 0.43rem; 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 { .btn_operate {
float: right; float: right;
...@@ -228,13 +297,48 @@ export default { ...@@ -228,13 +297,48 @@ export default {
margin-right: 0.31rem; margin-right: 0.31rem;
} }
} }
.main_content_btns { .main_content_footer {
margin-top: 1.02rem; 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 { .main_content_btn {
width: 6.9rem;
background: #b80140;
color: #ffffff;
margin-left: 0.28rem;
}
.main_content_btn1 {
width: 6.9rem;
background: #b80140; background: #b80140;
color: #ffffff; 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> </style>
<template> <template>
<div class="main"> <div class="main">
<!-- 头部标题 --> <!-- 头部标题 -->
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed> <commonheader :title="title" />
<template #right>
<van-icon name="contact" size="28" @click="onClickRight" />
</template>
</van-nav-bar> -->
<commonheader />
<div class="main_content"> <div class="main_content">
<!-- banner卡片 --> <!-- banner卡片 -->
<!-- <div class="main_content_banner"></div> -->
<img <img
class="main_content_banner" 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" 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 @@ ...@@ -41,13 +35,17 @@
<div class="main_content_activity"> <div class="main_content_activity">
<div class="main_content_activity_tit">会议</div> <div class="main_content_activity_tit">会议</div>
<!-- 活动列表 --> <!-- 活动列表 -->
<div class="main_content_activity_list" v-for="(item, index) in activityList" :key="index" @click="handleSign"> <div
<div class="activity_list_left"> class="main_content_activity_list"
<div class="activity_list_left_tit">{{ item.title }}</div> v-for="(item, index) in activityList"
<div class="activity_list_left_con">{{ item.desc }}</div> :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>
<div class="activity_list_right"> <div class="activity_list_bottom">
<div class="activity_list_right_date">{{ item.date }}</div>
<van-icon name="arrow" size="14" /> <van-icon name="arrow" size="14" />
</div> </div>
</div> </div>
...@@ -57,40 +55,18 @@ ...@@ -57,40 +55,18 @@
</template> </template>
<script> <script>
import { Dialog } from 'vant' import { Toast, Dialog } from 'vant'
import { getActivityList, getActivityDetail } from '../api'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
export default { export default {
components: { Commonheader }, components: { Commonheader },
data() { data() {
return { return {
isSign: false, title: '首页',
activityList: [ ismySign: true,
{ isOtherSign: true,
title: '和地方的房价高合金和服务范围', activityList: [], // 活动列表
desc: '的南非举办峰会上发表时间和部分称为举步维艰还不如风景还是不错看剧本看见办法', detailList: {} // 活动详情
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'
}
]
} }
}, },
methods: { methods: {
...@@ -100,28 +76,116 @@ export default { ...@@ -100,28 +76,116 @@ export default {
onClickRight() { onClickRight() {
this.$router.push('/PersonalCenter') this.$router.push('/PersonalCenter')
}, },
handleSign() { // 获取活动列表
if (this.isSign === true) { getActivityList() {
Dialog.confirm({ getActivityList().then(res => {
title: '标题', this.activityList = res.data.list
confirmButtonText: '继续报名', })
cancelButtonText: '开始学习', },
closeOnClickOverlay: true // 报名
}) handleSignCheck(item) {
.then(() => { // 未登录
// on confirm 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))
}
}
}) })
.catch(() => { } else if (this.detailList.self_fill_in.need_fill_in_status) {
// on cancel 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))
}
}
}) })
} else { }
this.$router.push({ this.handleSign(item)
path: '/SignMainPage' })
}) },
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: '提示',
message: '还有报名流程未交费',
confirmButtonText: '继续报名',
cancelButtonText: '开始学习',
closeOnClickOverlay: true
})
.then(() => {
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> </script>
...@@ -130,15 +194,12 @@ export default { ...@@ -130,15 +194,12 @@ export default {
background-color: #f7f7f7; background-color: #f7f7f7;
.main_content { .main_content {
margin-top: 0.46rem; margin-top: 0.46rem;
height: 100%; padding: 0 0.3rem 0.3rem 0.3rem;
padding: 0.51rem 0.3rem 0.3rem 0.3rem;
.main_content_banner { .main_content_banner {
width: 6.9rem; margin-top: 1rem;
width: 100%;
height: 2.97rem; height: 2.97rem;
// background-color: rgb(192, 162, 162);
border-radius: 0.1rem; 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 { .main_content_dt {
margin: 0.3rem 0 0.3rem 0; margin: 0.3rem 0 0.3rem 0;
...@@ -191,46 +252,31 @@ export default { ...@@ -191,46 +252,31 @@ export default {
.main_content_activity_list { .main_content_activity_list {
box-sizing: border-box; box-sizing: border-box;
padding: 0.2rem 0.25rem 0.2rem 0.3rem; padding: 0.2rem 0.25rem 0.2rem 0.3rem;
// width: 6.9rem; width: 100%;
height: 1.12rem; height: 1.12rem;
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
align-items: center;
background-color: #fff; background-color: #fff;
border-radius: 0.2rem; border-radius: 0.2rem;
margin-top: 0.24rem; margin-top: 0.24rem;
.activity_list_left { .activity_list_top {
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
.activity_list_left_tit { .activity_list_top_tit {
font-size: 0.28rem; font-size: 0.28rem;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
} }
.activity_list_left_con { .activity_list_top_date {
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 {
font-size: 0.22rem; font-size: 0.22rem;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
} }
.activity_list_right_icon { }
margin-top: 0.2rem; .activity_list_bottom {
} display: flex;
justify-content: flex-end;
align-items: center;
} }
} }
} }
......
<template> <template>
<div class="main"> <div class="main">
<!-- 头部标题 --> <commonheader :title="title" />
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed>
<template #right>
<van-icon name="contact" size="28" />
</template>
</van-nav-bar> -->
<commonheader />
<div class="main_content"> <div class="main_content">
<!-- 头部tab --> <!-- 头部tab -->
<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 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 round icon="https://webapp-pub.oss-cn-beijing.aliyuncs.com/highway/h5/ticket.png">
开发票 开发票
</van-button> </van-button>
</div> </div>
<!-- 订单列表 --> <!-- 订单列表 -->
<div class="orderList" v-for="(item, index) in getDataByType(it.type)" :key="index"> <div v-if="getDataByType(it.type).length" class="main_content_orderList">
<div class="orderList_status">{{ payStatus[item.status] }}</div> <div class="orderList" v-for="(item, index) in getDataByType(it.type)" :key="index">
<div class="orderList_con"> <div class="orderList_status">{{ payStatus[item.status] }}</div>
<div class="orderList_con_left"> <div class="orderList_con">
<div class="orderList_con_left_tit">{{ item.title }}</div> <div class="orderList_con_left">
<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.amount }}</div>
</div>
<div class="orderList_pay">
<div class="orderList_pay_tit">需付款:</div>
<div class="orderList_pay_price">{{ item.amount }}</div>
</div>
<div class="orderList_btn">
<van-button
round
size="small"
style="margin-left: 0.42rem"
v-if="item.status === 0 || item.status === 1"
@click="handlePay(item)"
>去支付</van-button
>
</div> </div>
<div class="orderList_con_price">¥{{ item.price }}</div>
</div>
<div class="orderList_pay">
<div class="orderList_pay_tit">需付款:</div>
<div class="orderList_pay_price">{{ item.needPay }}</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')"
>去支付</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> </div>
<van-empty v-else description="暂无订单" class="main_content_empty" />
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
...@@ -57,72 +45,58 @@ ...@@ -57,72 +45,58 @@
</template> </template>
<script> <script>
import { getOrderList } from '../api'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
export default { export default {
components: { Commonheader }, components: { Commonheader },
data() { data() {
return { return {
title: '我的订单',
active: 0, active: 0,
payStatus: { payStatus: {
hasNopay: '未支付', 0: '未支付',
partPay: '部分缴费', 1: '部分缴费',
isFinished: '已完成' 2: '已完成'
// isTicket: '已开票'
}, },
orderTab: [ orderTab: [
{ title: '全部', type: 'all' }, { title: '全部', type: 'all' },
{ title: '未支付', type: 'hasNopay' }, { title: '未支付', type: 'hasNopay' },
{ title: '部分缴费', type: 'partPay' }, { title: '部分缴费', type: 'partPay' },
{ title: '已完成', type: 'isFinished' } { title: '已完成', type: 'isFinished' }
// { title: '已开票', type: 'isTicket' }
], ],
orderList: [ 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'
}
]
} }
}, },
computed: {},
mounted() {
this.getOrderList()
},
methods: { methods: {
getOrderList() {
getOrderList().then(res => {
this.orderList = res.data
})
},
getDataByType(type) { getDataByType(type) {
if (type === 'all') { if (type === 'all') {
return this.orderList return this.orderList
} else if (type === 'hasNopay') { } else if (type === 'hasNopay') {
return this.orderList.filter(item => item.status === 'hasNopay') return this.orderList.filter(item => item.status === 0)
} else if (type === 'partPay') { } else if (type === 'partPay') {
return this.orderList.filter(item => item.status === 'partPay') return this.orderList.filter(item => item.status === 1)
} else if (type === 'isFinished') { } 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,89 +104,100 @@ export default { ...@@ -130,89 +104,100 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .main {
height: 100vh; min-height: 100vh;
.main_content { background-color: #f7f7f7;
// background: #fff;
background-color: #f7f7f7; .main_content {
height: 100%;
margin-top: 0.9rem; margin-top: 0.9rem;
.main_content_ticket { .main_content_ticket {
padding-right: 0.3rem; padding-right: 0.3rem;
float: right; float: right;
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
margin-top: -0.2rem; margin-top: 0.8rem;
} }
.orderList { .main_content_orderList {
margin: 0.3rem; .orderList {
padding: 0.3rem 0.2rem 0.3rem 0.34rem; margin: 0.3rem;
width: 6.9rem; padding: 0.3rem 0.2rem 0.3rem 0.34rem;
height: 3.62rem; width: 6.9rem;
background: #fff; height: 3.62rem;
opacity: 1; background: #fff;
border-radius: 0.18rem; opacity: 1;
display: flex; border-radius: 0.18rem;
align-items: flex-end;
flex-direction: column;
box-sizing: border-box;
.orderList_status {
font-size: 0.26rem;
font-weight: 400;
line-height: 0.28rem;
color: #c01540;
}
.orderList_con {
width: 100%;
display: flex; display: flex;
justify-content: space-between; align-items: flex-end;
align-items: flex-start; flex-direction: column;
margin-top: 0.31rem; box-sizing: border-box;
.orderList_status {
font-size: 0.26rem;
font-weight: 400;
line-height: 0.28rem;
color: #c01540;
}
.orderList_con {
width: 100%;
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-top: 0.31rem;
.orderList_con_left { .orderList_con_left {
font-size: 0.28rem;
font-weight: 500;
color: #333333;
.orderList_con_left_tit {
width: 2.52rem;
font-size: 0.28rem; font-size: 0.28rem;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
overflow: hidden; .orderList_con_left_tit {
text-overflow: ellipsis; width: 2.52rem;
white-space: nowrap; font-size: 0.28rem;
font-weight: 500;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.orderList_con_left_num {
font-size: 0.24rem;
font-weight: 400;
color: #9b9b9b;
opacity: 1;
}
} }
.orderList_con_left_num { .orderList_con_price {
font-size: 0.24rem; font-size: 0.2rem;
font-weight: 400; font-weight: 400;
color: #9b9b9b; color: #333333;
opacity: 1;
} }
} }
.orderList_con_price { .orderList_pay {
font-size: 0.2rem; display: flex;
font-weight: 400; align-items: center;
color: #333333; margin-top: 0.42rem;
} .orderList_pay_tit {
} font-size: 0.28rem;
.orderList_pay { font-weight: 500;
display: flex; color: #333333;
align-items: center; }
margin-top: 0.42rem; .orderList_pay_price {
.orderList_pay_tit { font-size: 0.2rem;
font-size: 0.28rem; font-weight: bold;
font-weight: 500; color: #333333;
color: #333333; }
} }
.orderList_pay_price { .orderList_btn {
font-size: 0.2rem; display: flex;
font-weight: bold; margin-top: 0.34rem;
color: #333333;
} }
} }
.orderList_btn { }
display: flex; .main_content_empty {
margin-top: 0.34rem; margin: 2rem 1rem;
}
} }
} }
} }
::v-deep .van-sticky {
width: 100%;
position: fixed;
z-index: 1000;
top: 0.9rem;
}
</style> </style>
<template> <template>
<div class="main"> <div class="main">
<!-- 头部标题 --> <!-- 头部标题 -->
<commonheader /> <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">
<van-checkbox-group v-model="selctOrderData" ref="checkboxGroup"> <!-- {{ stepOrderInfo }} -->
<div class="main_content_list_card" v-for="(item, index) in orderList" :key="index"> <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"> <div class="card_header">
<van-checkbox :name="item"></van-checkbox> <van-checkbox :name="item" :disabled="item.pay_record.pay_status === '1'"></van-checkbox>
<span class="card_header_title">{{ item.title }}</span> <span class="card_header_title">{{ stepName }}</span>
</div> </div>
<div class="card_con"> <div class="card_con">
<p>{{ item.desc }}</p> <p>{{ item.name }} {{ item.mobile }}</p>
</div> </div>
<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">{{ item.price }}<span class="price_num">.00</span></span> <span class="price_num">{{ stepOrderInfo.pay_price }}<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">{{ 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> </div>
</div> </div>
</van-checkbox-group> </van-checkbox-group>
</div> </div>
</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-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> </div>
</template> </template>
<script> <script>
import { getActivityDetail } from '../api'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
export default { export default {
components: { Commonheader }, components: { Commonheader },
data() { data() {
return { return {
title: '订单确认',
isAll: false, isAll: false,
numVsible: true, numVsible: true,
orderList: [ payDetail: {},
{
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
}
],
selctOrderData: [] // 选中的数据 selctOrderData: [] // 选中的数据
} }
}, },
computed: { computed: {
totalPrice() { 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: { methods: {
onClickLeft() { // getActivityDetail() {
history.go(-1) // 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() { checkAll() {
this.$refs.checkboxGroup.toggleAll(this.isAll) this.$refs.checkboxGroup.toggleAll(this.isAll)
}, },
onSubmit() { onSubmit() {
console.log(this.selctOrderData) console.log(this.selctOrderData)
this.$router.push({ if (this.selctOrderData.lenth && this.totalPrice === 0) {
path: '/PayDetail' this.$router.push('/')
}) } else {
this.$router.push({
path: '/PayDetail',
query: {
pay_record_ids: this.selctOrderData.map(item => item.pay_record.id).toString(),
join_rand: this.$route.query.orderList.join_rand
}
})
}
}, },
onClickRight() {} onClickRight() {}
} }
...@@ -148,11 +186,12 @@ export default { ...@@ -148,11 +186,12 @@ export default {
align-items: center; align-items: center;
justify-items: center; justify-items: center;
.price { .price {
font-size: 0.14rem; font-size: 0.2rem;
color: #b80140; color: #b80140;
font-weight: 300;
} }
.price_num { .price_num {
font-size: 0.2rem; font-size: 0.28rem;
font-weight: bold; font-weight: bold;
color: #b80140; color: #b80140;
} }
...@@ -165,5 +204,72 @@ export default { ...@@ -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> </style>
<template> <template>
<div class="main"> <div class="main">
<commonheader /> <commonheader :title="title" />
<div class="main_content"> <div class="main_content">
<div class="main_content_desc">1.打开支付宝扫码二维码支付,或长按保存二维码打开支付宝支付。</div> <div class="main_content_desc">1.打开支付宝扫码二维码支付,或长按保存二维码打开支付宝支付。</div>
<div class="main_content_qdCode"> <div class="main_content_qdCode">
<qrcode-vue :value="value" size="180" ref="qrcode" /> <qrcode-vue :value="payDetail.url" size="180" ref="qrcode" />
</div> </div>
<div class="main_content_link"> <div class="main_content_link">
2. 2.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
> >
复制链接在浏览器打开去支付 复制链接在浏览器打开去支付
</div> </div>
<div id="value">{{ value }}</div> <div id="value">{{ payDetail.url }}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,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 commonheader from '../components/Commonheader.vue' import commonheader from '../components/Commonheader.vue'
export default { export default {
...@@ -40,9 +41,17 @@ export default { ...@@ -40,9 +41,17 @@ export default {
}, },
data() { data() {
return { return {
title: '订单支付',
qrcodeUrl: '', 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: { methods: {
...@@ -65,11 +74,49 @@ export default { ...@@ -65,11 +74,49 @@ export default {
Toast.fail('复制失败,请重新复制!') Toast.fail('复制失败,请重新复制!')
this.clipboard.destroy() 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() { mounted() {
this.getPayDetail()
this.getQrcodeUrl() this.getQrcodeUrl()
this.initClipboard() this.initClipboard()
if (this.payDetail.order_id) {
setTimeout(this.getPayStatus(), 1000)
}
} }
} }
</script> </script>
......
<template> <template>
<div class="main"> <div class="main">
<!-- 头部标题 --> <!-- 头部标题 -->
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed> <commonheader :title="title" />
<template #right>
<van-icon name="contact" size="28" />
</template>
</van-nav-bar> -->
<commonheader />
<!-- 我的订单 --> <!-- 我的订单 -->
<div class="main_content"> <div class="main_content">
<div class="main_content_order" @click="handleOrder"> <div class="main_content_order" @click="handleOrder">
<div class="main_content_order_text">我的订单</div> <div class="main_content_order_text">我的订单</div>
<van-icon name="arrow" size="14" /> <van-icon name="arrow" size="14" />
</div> </div>
<div class="main_content_footer">退出登录</div> <div class="main_content_footer" @click="handleLogout">退出登录</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -22,11 +17,19 @@ ...@@ -22,11 +17,19 @@
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
export default { export default {
components: { Commonheader }, components: { Commonheader },
data() {
return {
title: '个人中心'
}
},
methods: { methods: {
handleOrder() { handleOrder() {
this.$router.push({ this.$router.push({
path: '/myOrder' path: '/myOrder'
}) })
},
handleLogout() {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.origin)}`
} }
} }
} }
...@@ -51,7 +54,7 @@ export default { ...@@ -51,7 +54,7 @@ export default {
align-items: center; align-items: center;
padding: 0 0.25rem 0 0.3rem; padding: 0 0.25rem 0 0.3rem;
box-sizing: border-box; box-sizing: border-box;
margin-top: .21rem; margin-top: 0.21rem;
.main_content_order_text { .main_content_order_text {
font-size: 0.28rem; font-size: 0.28rem;
font-weight: 400; font-weight: 400;
...@@ -69,7 +72,8 @@ export default { ...@@ -69,7 +72,8 @@ export default {
color: #333333; color: #333333;
line-height: 0.88rem; line-height: 0.88rem;
text-align: center; text-align: center;
margin-top: 6.11rem; position: fixed;
bottom: 4.37rem;
} }
} }
} }
......
<template> <template>
<div class="main"> <div class="main">
<!-- 头部标题 --> <commonheader @back="handlePrev" :callBack="true" :title="title" />
<!-- <van-nav-bar title="标题" left-text="返回" left-arrow fixed> <!-- 展示 -->
<template #right> <img-show :stepList="stepList" :data="setpItem" @prev="handlePrev" @next="handleNext" v-if="setpItem.type === 1" />
<van-icon name="contact" size="28" /> <!-- 表单 -->
</template> <sign-form
</van-nav-bar> --> :data="setpItem"
<commonheader /> :stepList="stepList"
<img-show v-show="isShowStep" /> :stepIndex="stepIndex"
<sign-form v-show="isShowStep" /> @prev="handlePrev"
@next="handleNext"
v-if="setpItem.type === 2"
:isShowSkip="isShowSkip"
/>
</div> </div>
</template> </template>
...@@ -17,14 +21,44 @@ import SignForm from '../components/SignForm.vue' ...@@ -17,14 +21,44 @@ 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'
export default { export default {
components: { components: { SignForm, ImgShow, Commonheader },
SignForm,
ImgShow,
Commonheader
},
data() { data() {
return { 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 Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import { getUser, logout } from '@/api/base' import { getUser, logout, getAllSetting } from '@/api/base'
Vue.use(Vuex) Vue.use(Vuex)
export default new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
user: {} user: {},
allSettings: {},
stepIndex: 0,
detailList: {},
stepResult: [],
stepForm: [],
stepOrderInfo: {}
}, },
mutations: { mutations: {
setUser(state, user) { setUser(state, user) {
state.user = 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: { actions: {
...@@ -43,6 +67,14 @@ export default new Vuex.Store({ ...@@ -43,6 +67,14 @@ export default new Vuex.Store({
return false return false
}) })
return isLogin return isLogin
},
// 获取所有项目列表
getAllSetting({ commit }) {
getAllSetting().then(res => {
commit('setAllSettings', res.data)
})
} }
} }
}) })
store.dispatch('getAllSetting')
export default store
import axios from 'axios' import axios from 'axios'
import queryString from 'query-string' // import queryString from 'query-string'
import { Message } from 'element-ui' import { Message } from 'element-ui'
import router from '../router'
import store from '../store'
import qs from 'qs'
const httpRequest = axios.create({ const httpRequest = axios.create({
timeout: 60000, timeout: 60000,
...@@ -11,8 +14,23 @@ const httpRequest = axios.create({ ...@@ -11,8 +14,23 @@ const httpRequest = axios.create({
// 请求拦截 // 请求拦截
httpRequest.interceptors.request.use( httpRequest.interceptors.request.use(
function (config) { 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') { 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') { if (config.headers['Content-Type'] === 'multipart/form-data') {
const formData = new window.FormData() const formData = new window.FormData()
...@@ -33,6 +51,20 @@ httpRequest.interceptors.response.use( ...@@ -33,6 +51,20 @@ httpRequest.interceptors.response.use(
function (response) { function (response) {
const { data } = response const { data } = response
if (data.code) { 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 Promise.reject(data)
} }
return data return data
...@@ -46,11 +78,10 @@ httpRequest.interceptors.response.use( ...@@ -46,11 +78,10 @@ httpRequest.interceptors.response.use(
} else { } else {
Message.error(message || error.response.data) Message.error(message || error.response.data)
} }
return Promise.reject(error.response)
} else { } else {
console.log(error) console.log(error)
} }
return Promise.reject(error) return Promise.reject(error.response || error)
} }
) )
......
import store from '@/store' import store from '@/store'
export default async function (to, from, next) { export default async function (to, from, next) {
if (to.meta.requiredLogin) { // if (to.meta.requiredLogin) {
const isLogin = store.state.user.id || (await store.dispatch('checkLogin')) // } else {
if (!isLogin) { // next()
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` // }
} 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 { } else {
next() 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({ ...@@ -14,7 +14,12 @@ export default defineConfig({
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem')) cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
}, },
proxy: { 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: { resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论