2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
|
|
|
<el-card :style="{ height: height +'px' }">
|
|
|
|
<div style="text-align: center; padding-top: 30px">
|
2019-08-21 15:15:08 +08:00
|
|
|
<b>{{ $t('global.checkstand') }}</b>
|
2019-07-26 13:32:43 +08:00
|
|
|
</div>
|
|
|
|
<div :style=" { height: height - 60 +'px' }">
|
2019-08-14 10:36:55 +08:00
|
|
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
|
|
<el-steps
|
|
|
|
:active="active"
|
|
|
|
finish-status="success"
|
|
|
|
style="margin-top: 20px; margin-left: auto; margin-right: auto; width: 80%"
|
|
|
|
center
|
|
|
|
>
|
2019-08-21 15:15:08 +08:00
|
|
|
<el-step :title="$t('global.submitOrders')" />
|
|
|
|
<el-step :title="$t('global.completePayment')" />
|
2019-07-26 13:32:43 +08:00
|
|
|
</el-steps>
|
|
|
|
<div style="margin-top: 20px; margin-left: auto; margin-right: auto; width: 80%;">
|
2019-08-14 10:36:55 +08:00
|
|
|
<commit-draft
|
|
|
|
v-show="active===0"
|
|
|
|
ref="commit"
|
|
|
|
:order-data="orderData"
|
|
|
|
:system-name="systemName"
|
|
|
|
@commit="commit"
|
|
|
|
/>
|
|
|
|
<confirm-draft
|
|
|
|
v-show="active===1"
|
|
|
|
ref="confirm"
|
|
|
|
:order-data="orderData"
|
|
|
|
:system-name="systemName"
|
|
|
|
:order="order"
|
|
|
|
@confirm="confirm"
|
|
|
|
/>
|
|
|
|
<finish-draft v-show="active===2" ref="finish" :finish-status="finishStatus" @finish="finish" />
|
2019-07-26 13:32:43 +08:00
|
|
|
</div>
|
|
|
|
</el-scrollbar>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-08-14 10:36:55 +08:00
|
|
|
import { getCommodityDetailByParams } from '@/api/management/goods';
|
|
|
|
import { PermissionType } from '@/scripts/ConstDic';
|
|
|
|
import { UrlConfig } from '@/router/index';
|
|
|
|
import CommitDraft from './commit';
|
|
|
|
import ConfirmDraft from './confirm';
|
|
|
|
import FinishDraft from './finish';
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-08-14 10:36:55 +08:00
|
|
|
export default {
|
|
|
|
name: 'LessonDetail',
|
|
|
|
components: {
|
|
|
|
CommitDraft,
|
|
|
|
ConfirmDraft,
|
|
|
|
FinishDraft
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
active: -1,
|
|
|
|
order: {},
|
|
|
|
title: '',
|
|
|
|
finishStatus: '02',
|
|
|
|
orderData: {},
|
|
|
|
routeDict: {
|
|
|
|
0: 'commit',
|
|
|
|
1: 'confirm',
|
|
|
|
2: 'finish'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
systemName() {
|
|
|
|
switch (this.$route.query.permissionType) {
|
2019-08-21 15:15:08 +08:00
|
|
|
case PermissionType.LESSON: return this.$t('global.coursePrice');
|
|
|
|
case PermissionType.EXAM: return this.$t('global.testPrice');
|
|
|
|
case PermissionType.SIMULATION: return this.$t('global.simulationPrice');
|
|
|
|
case PermissionType.SCREEN: return this.$t('global.timeUnitPrice');
|
2019-08-14 10:36:55 +08:00
|
|
|
}
|
|
|
|
return '';
|
2019-09-02 15:37:57 +08:00
|
|
|
},
|
|
|
|
height() {
|
2019-09-02 17:24:42 +08:00
|
|
|
if (/\/dp\//.test(this.$route.path) ||
|
|
|
|
/\/plan\//.test(this.$route.path)) {
|
|
|
|
return this.$store.state.app.height;
|
|
|
|
}
|
|
|
|
|
2019-09-02 15:37:57 +08:00
|
|
|
return this.$store.state.app.height - 61;
|
2019-08-14 10:36:55 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route(newVal) {
|
|
|
|
this.initLoadPage();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.initLoadPage();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 加载课程信息
|
|
|
|
initLoadPage() {
|
|
|
|
const data = {
|
2019-08-30 17:00:18 +08:00
|
|
|
permissionType: this.$route.query.permissionType
|
2019-08-14 10:36:55 +08:00
|
|
|
};
|
2019-08-30 17:00:18 +08:00
|
|
|
if (this.$route.query.permissionType != '04') {
|
|
|
|
data['mapId'] = this.$route.query.mapId;
|
|
|
|
data['prdCode'] = this.$route.query.prdCode;
|
|
|
|
data['lessonId'] = this.$route.query.lessonId;
|
|
|
|
}
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-08-14 10:36:55 +08:00
|
|
|
getCommodityDetailByParams(data).then(response => {
|
|
|
|
this.active = 0;
|
|
|
|
this.orderData = response.data;
|
|
|
|
}).catch(() => {
|
2019-08-21 15:15:08 +08:00
|
|
|
this.$messageBox(this.$t('tip.failedCourse'));
|
2019-08-14 10:36:55 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
// 提交订单后处理
|
|
|
|
commit(data) {
|
|
|
|
this.active = 1;
|
|
|
|
this.order = data;
|
|
|
|
},
|
|
|
|
// 确认支付后处理
|
|
|
|
confirm(data) {
|
|
|
|
this.active = 2;
|
|
|
|
this.finishStatus = data;
|
|
|
|
this.$refs.finish.createCountTimer();
|
|
|
|
},
|
|
|
|
// 完成跳转处理
|
|
|
|
finish(data) {
|
|
|
|
this.active = 0;
|
|
|
|
const type = this.$route.query.permissionType;
|
|
|
|
if (type === PermissionType.LESSON) {
|
|
|
|
this.$router.replace({ path: `${UrlConfig.teach.detail}/${this.$route.params.lessonId}` });
|
|
|
|
} else if (type === PermissionType.EXAM) {
|
|
|
|
this.$router.replace({ path: `${UrlConfig.exam.course}/${this.orderData.lessonId}` });
|
|
|
|
} else if (type === PermissionType.SCREEN) {
|
|
|
|
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
|
|
|
|
} else if (type === PermissionType.SIMULATION) {
|
|
|
|
this.$router.replace({ path: `${UrlConfig.demonstration.detail}/${this.$route.params.lessonId}` });
|
|
|
|
} else {
|
|
|
|
this.$router.replace({ path: `/` });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|