提交 355309ac authored 作者: matian's avatar matian

updates

上级 bf0833ac
...@@ -31,8 +31,15 @@ export default { ...@@ -31,8 +31,15 @@ export default {
this.callBack ? this.$emit('back') : history.back() this.callBack ? this.$emit('back') : history.back()
}, },
// 右侧按钮 个人中心 // 右侧按钮 个人中心
onClickRight() {
this.$router.push('/PersonalCenter') async onClickRight() {
// 未登录
const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
if (!isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else {
this.$router.push('/PersonalCenter')
}
} }
} }
} }
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
getActivityList() { getActivityList() {
const params = { const params = {
page: this.currentPage, page: this.currentPage,
' per-page': 50 'per-page': '50'
} }
getActivityList(params).then(res => { getActivityList(params).then(res => {
this.activityList = res.data.list this.activityList = res.data.list
...@@ -106,13 +106,13 @@ export default { ...@@ -106,13 +106,13 @@ export default {
}) })
}, },
// 报名 // 报名
handleSignCheck(item) { async handleSignCheck(item) {
// 未登录 // 未登录
if (!this.$store.state.user) { const isLogin = this.$store.state.user.id || (await this.$store.dispatch('checkLogin'))
if (!isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else { } else {
this.getActivityDetail(item) this.getActivityDetail(item)
//
} }
}, },
// 获取活动详情 // 获取活动详情
...@@ -176,9 +176,9 @@ export default { ...@@ -176,9 +176,9 @@ export default {
} }
} }
} else if (time > endTime) { } else if (time > endTime) {
Toast('该活动已结束,无法报名') Toast(`该活动已于${item.end_time}结束报名`)
} else if (time < startTime) { } else if (time < startTime) {
Toast('该活动尚未开始,暂无法报名') Toast(`该活动已于${item.start_time}开始报名`)
} }
} }
}, },
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
<div class="orderList_con_left_tit">{{ item.activity.name }}</div> <div class="orderList_con_left_tit">{{ item.activity.name }}</div>
<div class="orderList_con_left_num">人数:{{ item.count }}</div> <div class="orderList_con_left_num">人数:{{ item.count }}</div>
</div> </div>
<div class="orderList_con_price">¥{{ item.amount.toFixed(2) }}</div> <div class="orderList_con_price" v-html="getTotalPrice(item)"></div>
</div> </div>
<div class="orderList_pay"> <div class="orderList_pay">
<div class="orderList_pay_tit">需付款:</div> <div class="orderList_pay_tit">需付款:</div>
<div class="orderList_pay_price">{{ item.amount.toFixed(2) }}</div> <div class="orderList_pay_price" v-html="getTotalPrice(item)"></div>
</div> </div>
<div class="orderList_btn"> <div class="orderList_btn">
<van-button <van-button
...@@ -76,6 +76,11 @@ export default { ...@@ -76,6 +76,11 @@ export default {
}, },
methods: { methods: {
getTotalPrice(item) {
const splitPrice = item.amount.toFixed(2).split('.')
// //2.重新赋值
return `¥ <span style="font-size:0.34rem;"> ${splitPrice[0]}</span>.<span style="font-size:0.2rem;">${splitPrice[1]}</span>`
},
getOrderList() { getOrderList() {
getOrderList().then(res => { getOrderList().then(res => {
this.orderList = res.data this.orderList = res.data
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
import { getPayInfo } from '../api' import { getPayInfo } from '../api'
import PayDetail from './PayDetail.vue' import PayDetail from './PayDetail.vue'
import Commonheader from '../components/Commonheader.vue' import Commonheader from '../components/Commonheader.vue'
import { Toast } from 'vant'
export default { export default {
components: { Commonheader, PayDetail }, components: { Commonheader, PayDetail },
props: { props: {
...@@ -155,9 +156,13 @@ export default { ...@@ -155,9 +156,13 @@ export default {
} }
console.log(this.data, 'selecer') console.log(this.data, 'selecer')
getPayInfo(params).then(res => { getPayInfo(params).then(res => {
this.payDetail = Object.assign({ qrData: res.data }, this.data) if (res.code === 0) {
this.payDetail.order_id = res.data.order_id this.payDetail = Object.assign({ qrData: res.data }, this.data)
this.isQrPageShow = true this.payDetail.order_id = res.data.order_id
this.isQrPageShow = true
}
// 订单为0元时,判断该步骤后面是否有步骤,若有就去下一步骤,否则返回首页
res.code === 100 && this.stepList.length === this.data.num ? this.$router.push('/') : this.$emit('next')
}) })
} }
} }
......
...@@ -15,11 +15,7 @@ ...@@ -15,11 +15,7 @@
ref="copy" ref="copy"
@click="initClipboard" @click="initClipboard"
type="text" type="text"
><img ><img class="link_img" src="https://webapp-pub.ezijing.com/highway/h5/ilink.png" />支付链接</el-button
class="link_img"
src="https://webapp-pub.oss-c1024
n-beijing.aliyuncs.com/highway/h5/ilink.png"
/>支付链接</el-button
> >
复制链接在浏览器打开去支付 复制链接在浏览器打开去支付
</div> </div>
...@@ -160,6 +156,8 @@ export default { ...@@ -160,6 +156,8 @@ export default {
flex-direction: column; flex-direction: column;
margin: 1.2rem 0.3rem 0.64rem 0.3rem; margin: 1.2rem 0.3rem 0.64rem 0.3rem;
border-radius: 0.2rem;
.main_content_desc { .main_content_desc {
font-size: 0.3rem; font-size: 0.3rem;
font-weight: 400; font-weight: 400;
......
...@@ -3,7 +3,13 @@ ...@@ -3,7 +3,13 @@
<!-- <commonheader @back="handlePrev" :callBack="true" /> --> <!-- <commonheader @back="handlePrev" :callBack="true" /> -->
<!-- 展示 --> <!-- 展示 -->
<template v-if="Object.keys(stepList).length"> <template v-if="Object.keys(stepList).length">
<img-show :stepList="stepList" :data="setpItem" @prev="handlePrev" @next="handleNext" v-if="setpItem.type === 1" /> <img-show
:stepList="stepList"
:data="setpItem"
@prev="handlePrev"
@next="handleNext"
v-if="setpItem.type === 1"
/>
<!-- 表单 --> <!-- 表单 -->
<sign-form <sign-form
:data="setpItem" :data="setpItem"
...@@ -25,12 +31,12 @@ ...@@ -25,12 +31,12 @@
</template> </template>
<script> <script>
import { Dialog } from 'vant'
import allFormList from '@/utils/formList' import allFormList from '@/utils/formList'
import SignForm from '../components/SignForm.vue' import SignForm from '../components/SignForm.vue'
import ImgShow from '../components/ImgShow.vue' import ImgShow from '../components/ImgShow.vue'
import OrderConfirm from './OrderConfirm.vue' import OrderConfirm from './OrderConfirm.vue'
// import Commonheader from '../components/Commonheader.vue'
import { getActivityDetail } from '../api' import { getActivityDetail } from '../api'
export default { export default {
...@@ -61,6 +67,25 @@ export default { ...@@ -61,6 +67,25 @@ export default {
getActivityDetail() { getActivityDetail() {
getActivityDetail({ id: this.$route.query.id }).then(res => { getActivityDetail({ id: this.$route.query.id }).then(res => {
const data = res.data const data = res.data
// 复制链接进入活动时,判断活动报名时间弹窗
const time = new Date().getTime()
const startTime = new Date(data.activity.start_time).getTime()
const endTime = new Date(data.activity.end_time).getTime()
if (startTime > time || endTime < time) {
Dialog.alert({
title: '提示',
message: `该活动已于${data.activity.start_time}开始报名`
}).then(() => {
this.$router.push('/')
})
} else if (endTime < time) {
Dialog.alert({
title: '提示',
message: `该活动已于${data.activity.end_time}结束报名`
}).then(() => {
this.$router.push('/')
})
}
let sliceData = [] let sliceData = []
if (data.other_fill_in.need_fill_in_status) { if (data.other_fill_in.need_fill_in_status) {
initInfo('other_fill_in') initInfo('other_fill_in')
......
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import { getUser, logout, getAllSetting } from '@/api/base' import { getUser, logout } from '@/api/base'
Vue.use(Vuex) Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
user: {}, user: {},
allSettings: {},
stepIndex: 0, stepIndex: 0,
stepResult: [] stepResult: []
}, },
...@@ -15,9 +14,6 @@ const store = new Vuex.Store({ ...@@ -15,9 +14,6 @@ const store = new Vuex.Store({
setUser(state, user) { setUser(state, user) {
state.user = user state.user = user
}, },
setAllSettings(state, allSettings) {
state.allSettings = allSettings
},
saveStepIndex(state, stepIndex) { saveStepIndex(state, stepIndex) {
state.stepIndex = stepIndex state.stepIndex = stepIndex
}, },
...@@ -56,14 +52,7 @@ const store = new Vuex.Store({ ...@@ -56,14 +52,7 @@ const store = 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 export default store
...@@ -50,7 +50,7 @@ httpRequest.interceptors.request.use( ...@@ -50,7 +50,7 @@ httpRequest.interceptors.request.use(
httpRequest.interceptors.response.use( httpRequest.interceptors.response.use(
function (response) { function (response) {
const { data } = response const { data } = response
if (data.code) { if (data.code && data.code !== 100) {
// 未登录 // 未登录
if (data.code === 4001) { if (data.code === 4001) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
...@@ -64,7 +64,7 @@ httpRequest.interceptors.response.use( ...@@ -64,7 +64,7 @@ httpRequest.interceptors.response.use(
Message({ message: '没有操作权限', type: 'error' }) Message({ message: '没有操作权限', type: 'error' })
return data return data
} }
Message({ message: data.message, type: 'error' }) Message({ message: data.msg, type: 'error' })
return Promise.reject(data) return Promise.reject(data)
} }
return data return data
......
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) {
// } else { // } else {
// next() // next()
// } // }
const isLogin = store.state.user.id || (await store.dispatch('checkLogin')) // const isLogin = store.state.user.id || (await store.dispatch('checkLogin'))
if (!isLogin) { // if (!isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}` // window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else { // } else {
next() next()
} // }
} }
...@@ -15,10 +15,9 @@ export default defineConfig({ ...@@ -15,10 +15,9 @@ export default defineConfig({
}, },
proxy: { proxy: {
'/api/register': { '/api/register': {
// target: 'http://localhost-activity-frontend.ezijing.com',
target: 'http://localhost-activity-frontend.ezijing.com', target: 'http://localhost-activity-frontend.ezijing.com',
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/api\/highway/, '') rewrite: path => path.replace(/^\/api\/register/, '')
}, },
'/api': 'https://app.ezijing.com' '/api': 'https://app.ezijing.com'
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论