提交 a697919b authored 作者: lihuihui's avatar lihuihui

Merge branch 'master' of https://gitlab-pro.ezijing.com/ezijing-web/highway-h5

# Conflicts: # src/modules/home/views/OrderConfirm.vue # src/utils/axios.js
......@@ -9,5 +9,10 @@
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script>
// VConsole will be exported to `window.VConsole` by default.
var vConsole = new window.VConsole()
</script>
</body>
</html>
......@@ -47,6 +47,8 @@ export default {
<style lang="scss" scoped>
::v-deep .van-icon-arrow-left {
cursor: pointer;
color: #000;
}
::v-deep .van-nav-bar__text {
......
......@@ -74,6 +74,7 @@ export default {
bottom: 0.4rem;
left: 50%;
transform: translateX(-50%);
cursor: pointer;
}
}
}
......
......@@ -56,6 +56,7 @@
:label="item.name"
:placeholder="item.placeholder"
@click="showSelectPicker(formIndex, index)"
class="showSelectPicker"
/>
<!-- 选择弹框 -->
<van-popup v-model="item.showPicker" position="bottom">
......@@ -79,10 +80,16 @@
:label="item.name"
:placeholder="item.placeholder"
@click="showTime(formIndex, index)"
class="showTime"
/>
<!-- 时间弹框 -->
<van-popup v-model="item.showPicker" position="bottom">
<van-datetime-picker type="datetime" @confirm="onConfirmTime" @cancel="item.showPicker = false" />
<van-datetime-picker
:min-date="minDate"
type="datetime"
@confirm="onConfirmTime"
@cancel="item.showPicker = false"
/>
</van-popup>
<div class="line"></div>
</div>
......@@ -110,38 +117,28 @@
>{{ data.title }}</van-button
>
</div>
<!-- <template v-if="data.can_skip_pay === 1">
<van-checkbox icon-size="13px" v-model="checkedPay" shape="square" class="main_content_skipPay">
{{ data.skip_pay_title }}</van-checkbox
>
</template>
<div >
<van-button round block native-type="submit" @click="onSubmit">{{ data.title }}</van-button>
</div> -->
</div>
</div>
</template>
<script>
import { Toast } from 'vant'
import Commonheader from '../components/Commonheader.vue'
import { saveStepInfo } from '../api'
export default {
components: { Commonheader },
props: {
stepList: { type: Array },
data: { type: Object },
myInfoList: {
type: Array
}
data: { type: Object }
},
computed: {},
data() {
return {
title: '报名',
checkedPay: false, // 勾选是否跳过按钮
index: 0,
cIndex: 0
cIndex: 0,
minDate: new Date()
}
},
mounted() {},
......@@ -152,7 +149,6 @@ export default {
// 提交
onSubmit() {
console.log(this.data, '123')
const params = {
activity_id: this.data.activityInfo.id,
activity_detail_id: this.data.id,
......@@ -169,28 +165,58 @@ export default {
a.push(infos)
return a
}, [])
saveStepInfo(params).then(res => {
if (res.code === 0) {
this.data.join_rand = res.data.join_rand
if (this.checkedPay) {
this.stepList.splice(this.data.num, 1)
if (this.stepList[this.stepList.length - 1].num === this.data.num) {
// 完成步骤跳转
this.$router.push({ path: '/' })
// 表单提交company_id
params.users_info.forEach(item => {
if (item.company) {
this.$store.state.allSettings.company_map.forEach(it => {
if (item.company === it.company_name) {
item.company_id = it.id
} else {
this.$emit('next', res.data)
}
} else {
if (this.stepList[this.stepList.length - 1].num === this.data.num) {
// 完成步骤跳转
this.$router.push({ path: '/' })
} else {
this.$emit('next', res.data)
item.company_id = ''
}
})
}
})
let flag = false
params.users_info.forEach(item => {
if (item.check_in_time && item.check_out_time) {
if (item.check_in_time >= item.check_out_time) {
Toast('入住时间要早于离店时间')
flag = true
return false
}
this.checkedPay = false
}
})
if (flag) {
return false
} else {
saveStepInfo(params).then(res => {
if (res.code === 0) {
this.data.join_rand = res.data.join_rand
if (this.checkedPay) {
this.stepList.splice(this.data.num, 1)
if (this.stepList[this.stepList.length - 1].num === this.data.num) {
console.log('000')
// 完成步骤跳转
this.$router.push({ path: '/' })
} else {
console.log('111')
this.$emit('next', res.data)
}
} else {
if (this.stepList[this.stepList.length - 1].num === this.data.num) {
// 完成步骤跳转
this.$router.push({ path: '/' })
} else {
this.$emit('next', res.data)
}
}
this.checkedPay = false
}
})
}
},
// 表单项减少
handleMinus(index) {
......@@ -260,11 +286,20 @@ export default {
background: #fff;
padding-bottom: 0.68rem;
padding-top: 0.4rem;
.formItemList_item {
.showTime {
cursor: pointer;
}
.showSelectPicker {
cursor: pointer;
}
}
.btn_minus {
float: right;
width: 0.5072rem;
height: 0.5072rem;
margin: 0.3rem 0.3rem 0 0;
cursor: pointer;
}
}
.btn_operate {
......@@ -274,6 +309,7 @@ export default {
height: 0.5072rem;
}
.btn_add {
cursor: pointer;
margin-left: 0.3rem;
margin-right: 0.31rem;
}
......@@ -299,6 +335,7 @@ export default {
}
.main_footer_bottom {
margin-top: -0.18rem;
cursor: pointer;
.main_content_btn {
width: 6.9rem;
......
......@@ -41,12 +41,14 @@
: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.split(' ')[0] }}</div>
</div>
<div class="activity_list_bottom">
<van-icon name="arrow" size="14" />
<div>
<div class="activity_list_top">
<div class="activity_list_top_tit">{{ item.name }}</div>
<div class="activity_list_top_date">{{ item.activity_time.split(' ')[0] }}</div>
</div>
<div class="activity_list_bottom">
<van-icon name="arrow" size="14" />
</div>
</div>
</div>
</div>
......@@ -120,14 +122,13 @@ export default {
const params = { id: item.id }
getActivityDetail(params).then(res => {
this.detailList = res.data
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()
const startTime = new Date(item.start_time.replace(/-/g, '/')).getTime()
const endTime = new Date(item.end_time.replace(/-/g, '/')).getTime()
if (time >= startTime && time < endTime) {
if (this.detailList.other_fill_in.need_fill_in_status) {
// 有需要填写的步骤
......@@ -135,7 +136,7 @@ export default {
title: '提示',
message: '还有报名流程未交费',
confirmButtonText: '继续报名',
cancelButtonText: '开始学习',
cancelButtonText: this.detailList.self_fill_in.need_fill_in_status === false ? '开始学习' : '',
closeOnClickOverlay: true
})
.then(() => {
......@@ -149,6 +150,8 @@ export default {
.catch(() => {})
// 没有需要填写的步骤
} else if (!this.detailList.other_fill_in.need_fill_in_status) {
console.log('333')
if (this.detailList.self_fill_in.need_fill_in_status) {
this.$router.push({
path: '/SignMainPage',
......@@ -176,7 +179,7 @@ export default {
}
}
} else if (time >= endTime) {
console.log('111')
console.log('444')
Toast(`该活动已于${item.end_time}结束报名`)
} else if (time < startTime) {
Toast(`该活动已于${item.start_time}开始报名`)
......@@ -260,6 +263,9 @@ export default {
background-color: #fff;
border-radius: 0.2rem;
margin-top: 0.24rem;
div {
cursor: pointer;
}
.activity_list_top {
display: flex;
justify-content: space-between;
......
......@@ -100,10 +100,12 @@ export default {
handlePay(item) {
const payRecord = item.list[0].pay_record
const stepDetails = item.activity.details.find(d => d.id === payRecord.activity_detail_id)
stepDetails.list = item.list.map((list, index) => {
list.mobile === JSON.parse(window.localStorage.userInfo).mobile ? list.index = 0 : list.index = index + 1
return list
}).sort((a, b) => a.index - b.index)
stepDetails.list = item.list
.map((list, index) => {
list.mobile === JSON.parse(window.localStorage.userInfo).mobile ? (list.index = 0) : (list.index = index + 1)
return list
})
.sort((a, b) => a.index - b.index)
delete item.activity.details
stepDetails.activityInfo = item.activity
stepDetails.join_rand = item.join_rand
......@@ -199,6 +201,7 @@ export default {
.orderList_btn {
display: flex;
margin-top: 0.34rem;
cursor: pointer;
}
}
}
......@@ -216,6 +219,7 @@ export default {
::v-deep .pay_btn {
border-radius: 0.31rem;
border: 1px solid #c01540;
cursor: pointer;
color: #c01540;
font-size: 0.28rem;
......
......@@ -9,7 +9,6 @@
<div class="main_content_list_card" v-for="(item, index) in stepOrderInfo" :key="index">
<div class="card_header">
<van-checkbox :name="item" :disabled="item.pay_record.pay_status === '1'"></van-checkbox>
<!-- <span class="card_header_title">{{ JSON.parse($route.query.detailListName) }}</span> -->
<div class="card_con">
<p>{{ item.name }} {{ item.mobile }}</p>
</div>
......@@ -31,7 +30,7 @@
</div>
</div>
<div class="main_footer">
<van-checkbox v-model="isAll" @click="checkAll" :disabled="!!getPayLength.length">全选</van-checkbox>
<van-checkbox v-model="isAll" @click="checkAll" class="checkAll">全选</van-checkbox>
<div class="main_footer_total">
<div class="main_footer_total_top"></div>
<div class="main_footer_total_top">
......@@ -103,7 +102,7 @@ export default {
}
},
mounted() {
this.stepOrderInfo = this.data.payData.list
this.stepOrderInfo = this.data.payData.list.filter(item => item.pay_record.pay_status !== '1')
},
methods: {
getTotalTotalCompanyPrice() {
......@@ -128,7 +127,7 @@ export default {
return `<span style="font-size:0.34rem;">${splitPrice[0]}</span>.<span style="font-size:0.2rem;">${splitPrice[1]}</span>`
},
checkItem() {
if (this.selctOrderData.length === this.stepOrderInfo.filter(item => item.pay_record.pay_status !== '1').length) {
if (this.selctOrderData.length === this.stepOrderInfo.length) {
this.isAll = true
} else {
this.isAll = false
......@@ -141,9 +140,12 @@ export default {
this.$refs.checkboxGroup.toggleAll(this.isAll)
},
onSubmit() {
console.log('000')
this.getPayDetail()
},
getPayDetail() {
console.log(this.stepOrderInfo.length, '111')
if (this.stepOrderInfo.length) {
this.stepOrderInfo.forEach((item, index) => {
if (item.pay_record.pay_status === '1') {
......@@ -159,11 +161,19 @@ export default {
join_rand: this.data.payData.join_rand
}
getPayInfo(params).then(res => {
console.log(this.data, 'this.data')
if (res.code === 0) {
this.payDetail = Object.assign({ qrData: res.data }, this.data)
this.payDetail.order_id = res.data.order_id
this.isQrPageShow = true
}
if (res.code === 100) {
if (this.stepList.length === this.data.num) {
this.$router.push('/')
} else {
this.$emit('next')
}
}
// 订单为0元时,判断该步骤后面是否有步骤,若有就去下一步骤,否则返回首页
if (res.code === 999) {
this.stepList.length === this.data.num ? this.$router.push('/') : this.$emit('next')
......@@ -250,6 +260,9 @@ export default {
display: flex;
justify-content: space-around;
align-items: center;
.checkAll {
cursor: pointer;
}
.main_footer_total {
// background: #000;
......@@ -298,6 +311,7 @@ export default {
}
}
.prev_btn {
cursor: pointer;
background: #f5f5f5;
font-size: 0.3rem;
font-weight: 500;
......@@ -308,6 +322,7 @@ export default {
font-size: 0.3rem;
font-weight: 500;
color: #ffffff;
cursor: pointer;
}
}
}
......
......@@ -107,13 +107,15 @@ export default {
getPayStatus(params).then(res => {
if (res.code === 0) {
this.status = res.data.status
console.log(this.status, 'this.status')
if (res.data.status === 1) {
clearInterval(this.time)
if (this.data.jump_url) {
window.location.href = this.data.jump_url
return false
} else {
this.getActivityDetail()
}
this.getActivityDetail()
}
}
})
......@@ -137,7 +139,12 @@ export default {
clearInterval(this.time)
},
mounted() {
this.getActivityDetail()
console.log(this.stepList.length, this.stepList, '111')
console.log(this.data.num, this.data, '222')
if (this.status === 1) {
this.getActivityDetail()
}
clearInterval(this.time)
this.time = setInterval(() => {
this.getPayStatus()
......@@ -191,12 +198,14 @@ export default {
display: flex;
justify-content: center;
.main_btn_home {
cursor: pointer;
background: #b80140;
color: #fff;
font-size: 0.3rem;
font-weight: 400;
}
.main_btn_order {
cursor: pointer;
margin-left: 0.2rem;
background: #f5f5f5;
font-size: 0.3rem;
......
......@@ -43,6 +43,7 @@ export default {
background-color: #f7f7f7;
.main_content_order {
cursor: pointer;
width: 6.9rem;
height: 0.7rem;
background: #fff;
......@@ -73,6 +74,7 @@ export default {
text-align: center;
position: fixed;
bottom: 4.37rem;
cursor: pointer;
}
}
}
......
......@@ -74,8 +74,8 @@ export default {
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()
const startTime = new Date(data.activity.start_time.replace(/-/g, '/')).getTime()
const endTime = new Date(data.activity.end_time.replace(/-/g, '/')).getTime()
if (startTime > time || endTime < time) {
Dialog.alert({
title: '提示',
......
import Vue from 'vue'
import Vuex from 'vuex'
import { getUser, logout } from '@/api/base'
import { getUser, logout, getAllSetting } from '@/api/base'
Vue.use(Vuex)
......@@ -8,7 +8,8 @@ const store = new Vuex.Store({
state: {
user: {},
stepIndex: 0,
stepResult: []
stepResult: [],
allSettings: {}
},
mutations: {
setUser(state, user) {
......@@ -20,6 +21,9 @@ const store = new Vuex.Store({
setStepResult(state, stepResult) {
state.stepResult = stepResult
},
setAllSettings(state, allSettings) {
state.allSettings = allSettings
}
},
actions: {
......@@ -53,7 +57,14 @@ const store = new Vuex.Store({
return false
})
return isLogin
},
// 获取所有项目列表
getAllSetting({ commit }) {
getAllSetting().then(res => {
commit('setAllSettings', res.data)
})
}
}
})
store.dispatch('getAllSetting')
export default store
......@@ -64,7 +64,7 @@ httpRequest.interceptors.response.use(
Message({ message: '没有操作权限', type: 'error' })
return data
}
Message({ message: data.msg, type: 'error' })
Message({ message: data.message, type: 'error' })
return Promise.reject(data)
}
return data
......
......@@ -16,6 +16,7 @@ export default defineConfig({
proxy: {
'/api/register': {
target: 'http://localhost-activity-frontend.ezijing.com',
// target: 'https://activity-frontend-api.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/register/, '')
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论