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

updates

上级 bf0833ac
......@@ -31,10 +31,17 @@ export default {
this.callBack ? this.$emit('back') : history.back()
},
// 右侧按钮 个人中心
onClickRight() {
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')
}
}
}
}
</script>
......
......@@ -98,7 +98,7 @@ export default {
getActivityList() {
const params = {
page: this.currentPage,
' per-page': 50
'per-page': '50'
}
getActivityList(params).then(res => {
this.activityList = res.data.list
......@@ -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)}`
} else {
this.getActivityDetail(item)
//
}
},
// 获取活动详情
......@@ -176,9 +176,9 @@ export default {
}
}
} else if (time > endTime) {
Toast('该活动已结束,无法报名')
Toast(`该活动已于${item.end_time}结束报名`)
} else if (time < startTime) {
Toast('该活动尚未开始,暂无法报名')
Toast(`该活动已于${item.start_time}开始报名`)
}
}
},
......
......@@ -21,11 +21,11 @@
<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.toFixed(2) }}</div>
<div class="orderList_con_price" v-html="getTotalPrice(item)"></div>
</div>
<div class="orderList_pay">
<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 class="orderList_btn">
<van-button
......@@ -76,6 +76,11 @@ export default {
},
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().then(res => {
this.orderList = res.data
......
......@@ -57,6 +57,7 @@
import { getPayInfo } from '../api'
import PayDetail from './PayDetail.vue'
import Commonheader from '../components/Commonheader.vue'
import { Toast } from 'vant'
export default {
components: { Commonheader, PayDetail },
props: {
......@@ -155,9 +156,13 @@ export default {
}
console.log(this.data, 'selecer')
getPayInfo(params).then(res => {
if (res.code === 0) {
this.payDetail = Object.assign({ qrData: res.data }, this.data)
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 @@
ref="copy"
@click="initClipboard"
type="text"
><img
class="link_img"
src="https://webapp-pub.oss-c1024
n-beijing.aliyuncs.com/highway/h5/ilink.png"
/>支付链接</el-button
><img class="link_img" src="https://webapp-pub.ezijing.com/highway/h5/ilink.png" />支付链接</el-button
>
复制链接在浏览器打开去支付
</div>
......@@ -160,6 +156,8 @@ export default {
flex-direction: column;
margin: 1.2rem 0.3rem 0.64rem 0.3rem;
border-radius: 0.2rem;
.main_content_desc {
font-size: 0.3rem;
font-weight: 400;
......
......@@ -3,7 +3,13 @@
<!-- <commonheader @back="handlePrev" :callBack="true" /> -->
<!-- 展示 -->
<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
:data="setpItem"
......@@ -25,12 +31,12 @@
</template>
<script>
import { Dialog } from 'vant'
import allFormList from '@/utils/formList'
import SignForm from '../components/SignForm.vue'
import ImgShow from '../components/ImgShow.vue'
import OrderConfirm from './OrderConfirm.vue'
// import Commonheader from '../components/Commonheader.vue'
import { getActivityDetail } from '../api'
export default {
......@@ -61,6 +67,25 @@ export default {
getActivityDetail() {
getActivityDetail({ id: this.$route.query.id }).then(res => {
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 = []
if (data.other_fill_in.need_fill_in_status) {
initInfo('other_fill_in')
......
import Vue from 'vue'
import Vuex from 'vuex'
import { getUser, logout, getAllSetting } from '@/api/base'
import { getUser, logout } from '@/api/base'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
user: {},
allSettings: {},
stepIndex: 0,
stepResult: []
},
......@@ -15,9 +14,6 @@ const store = new Vuex.Store({
setUser(state, user) {
state.user = user
},
setAllSettings(state, allSettings) {
state.allSettings = allSettings
},
saveStepIndex(state, stepIndex) {
state.stepIndex = stepIndex
},
......@@ -56,14 +52,7 @@ const store = new Vuex.Store({
return false
})
return isLogin
},
// 获取所有项目列表
getAllSetting({ commit }) {
getAllSetting().then(res => {
commit('setAllSettings', res.data)
})
}
}
})
store.dispatch('getAllSetting')
export default store
......@@ -50,7 +50,7 @@ httpRequest.interceptors.request.use(
httpRequest.interceptors.response.use(
function (response) {
const { data } = response
if (data.code) {
if (data.code && data.code !== 100) {
// 未登录
if (data.code === 4001) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
......@@ -64,7 +64,7 @@ httpRequest.interceptors.response.use(
Message({ message: '没有操作权限', type: 'error' })
return data
}
Message({ message: data.message, type: 'error' })
Message({ message: data.msg, type: 'error' })
return Promise.reject(data)
}
return data
......
import store from '@/store'
// import store from '@/store'
export default async function (to, from, next) {
// 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 {
// 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()
}
// }
}
......@@ -15,10 +15,9 @@ export default defineConfig({
},
proxy: {
'/api/register': {
// target: 'http://localhost-activity-frontend.ezijing.com',
target: 'http://localhost-activity-frontend.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/highway/, '')
rewrite: path => path.replace(/^\/api\/register/, '')
},
'/api': 'https://app.ezijing.com'
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论