|
@@ -41,10 +41,10 @@
|
|
|
<div class="text">考试时间</div>
|
|
|
<div class="select">
|
|
|
<el-date-picker
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
v-model="examParam.dateRange"
|
|
|
- type="daterange"
|
|
|
- @change="mockSubscribeListSubscribe"
|
|
|
+ type="datetimerange"
|
|
|
+ value-format="timestamp"
|
|
|
+ @change="mockExamDateChange"
|
|
|
placeholder="选择日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
@@ -53,12 +53,16 @@
|
|
|
<div class="item clearfix">
|
|
|
<div class="text">考试标题</div>
|
|
|
<div class="select">
|
|
|
- <el-select placeholder="请选择" v-model="title">
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择"
|
|
|
+ v-model="examParam.applyName"
|
|
|
+ @change="mockSubscribeListSubscribe"
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="item in 5"
|
|
|
- :key="item"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
+ v-for="(item, index) in listApplyName"
|
|
|
+ :key="index"
|
|
|
+ :label="item.applyName"
|
|
|
+ :value="item.applyId"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -74,7 +78,7 @@
|
|
|
>
|
|
|
<template v-if="examParam.mockStatus == 0">
|
|
|
<div class="mock-item__header">
|
|
|
- <div class="title">{{ item.applyName }}</div>
|
|
|
+ <div class="title">{{ item.subjectName }}</div>
|
|
|
<!-- <div class="time">2022/4/15 9:30:00</div> -->
|
|
|
</div>
|
|
|
|
|
@@ -90,10 +94,10 @@
|
|
|
<span class="item__left">专业:</span>
|
|
|
<span class="item__right">{{ item.categoryName }}</span>
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
+ <!-- <div class="item">
|
|
|
<span class="item__left">科目:</span>
|
|
|
<span class="item__right">{{ item.subjectName }}</span>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div class="item">
|
|
|
<span class="item__left">考试时间:</span>
|
|
|
<span class="item__right">
|
|
@@ -109,7 +113,12 @@
|
|
|
>去考试</el-button
|
|
|
>
|
|
|
|
|
|
- <div class="text">考试未开始</div>
|
|
|
+ <div class="text" v-if="!isStart(item)">考试未开始</div>
|
|
|
+ </div>
|
|
|
+ <div class="btn-item" v-else-if="item.handStatus">
|
|
|
+ <el-button class="btn" disabled type="primary"
|
|
|
+ >已考试</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class="btn-item" v-else>
|
|
|
<el-button
|
|
@@ -156,7 +165,7 @@
|
|
|
</div>
|
|
|
<div class="btn-wrap btn-wrap--over">
|
|
|
<template>
|
|
|
- <div class="btn-item" v-if="item.reSubcribe == 1">
|
|
|
+ <div class="btn-item" v-if="item.reSubscribe == 1">
|
|
|
<el-button
|
|
|
class="btn"
|
|
|
plain
|
|
@@ -194,7 +203,12 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mock-item__footer">
|
|
|
+ <div
|
|
|
+ class="mock-item__footer"
|
|
|
+ v-if="
|
|
|
+ item.liveEndTime && item.liveStartTime && item.liveUrl
|
|
|
+ "
|
|
|
+ >
|
|
|
<div class="text">
|
|
|
模考讲解直播时间:{{
|
|
|
$tools.timestampToTime(item.liveStartTime, false)
|
|
@@ -244,7 +258,13 @@
|
|
|
<el-option
|
|
|
v-for="(item, index) in businesslist"
|
|
|
:key="index"
|
|
|
- :label="item.businessName + item.projectName"
|
|
|
+ :label="
|
|
|
+ item.educationName +
|
|
|
+ ':' +
|
|
|
+ item.businessName +
|
|
|
+ '-' +
|
|
|
+ item.projectName
|
|
|
+ "
|
|
|
:value="item.businessId"
|
|
|
>
|
|
|
</el-option>
|
|
@@ -258,12 +278,12 @@
|
|
|
<el-select
|
|
|
placeholder="请选择"
|
|
|
@change="subjectChange"
|
|
|
- v-model="appointParam.subjectId"
|
|
|
+ v-model="appointParam.majorId"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in sList"
|
|
|
:key="index"
|
|
|
- :label="item.subjectName"
|
|
|
+ :label="item.categoryName"
|
|
|
:value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
@@ -275,9 +295,9 @@
|
|
|
<div class="select">
|
|
|
<el-date-picker
|
|
|
@change="mockApplyListApply"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
v-model="appointParam.dateRange"
|
|
|
- type="daterange"
|
|
|
+ type="datetimerange"
|
|
|
+ value-format="timestamp"
|
|
|
placeholder="选择日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
@@ -364,10 +384,10 @@
|
|
|
<div class="text">考试时间</div>
|
|
|
<div class="select">
|
|
|
<el-date-picker
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
v-model="liveParam.dateRange"
|
|
|
- type="daterange"
|
|
|
- @change="mockApplyListMockLive"
|
|
|
+ type="datetimerange"
|
|
|
+ value-format="timestamp"
|
|
|
+ @change="mockLiveDateChange"
|
|
|
placeholder="选择日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
@@ -376,12 +396,16 @@
|
|
|
<div class="item clearfix">
|
|
|
<div class="text">考试标题</div>
|
|
|
<div class="select">
|
|
|
- <el-select placeholder="请选择" v-model="title">
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="mockApplyListMockLive"
|
|
|
+ v-model="liveParam.applyName"
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="item in 5"
|
|
|
- :key="item"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
+ v-for="(item, index) in listLiveName"
|
|
|
+ :key="index"
|
|
|
+ :label="item.applyName"
|
|
|
+ :value="item.applyId"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -429,7 +453,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="live-item__body">
|
|
|
- <div class="title">{{ item.applyName }}</div>
|
|
|
+ <div class="title">{{ item.sectionName }}</div>
|
|
|
<div class="desc">
|
|
|
直播时间:{{
|
|
|
$tools.timestampToTime(item.liveStartTime, false)
|
|
@@ -507,7 +531,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapMutations } from "vuex";
|
|
|
+import { mapMutations, mapActions, mapGetters } from "vuex";
|
|
|
export default {
|
|
|
name: "MyOrder",
|
|
|
data() {
|
|
@@ -524,10 +548,11 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
businessId: "",
|
|
|
- subjectId: "",
|
|
|
+ majorId: "",
|
|
|
total: 0,
|
|
|
},
|
|
|
examParam: {
|
|
|
+ applyName: "",
|
|
|
dateRange: "",
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
@@ -535,6 +560,7 @@ export default {
|
|
|
total: 0,
|
|
|
},
|
|
|
liveParam: {
|
|
|
+ applyName: "",
|
|
|
dateRange: "",
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
@@ -559,6 +585,9 @@ export default {
|
|
|
date: "",
|
|
|
state: 0,
|
|
|
nowTime: 0,
|
|
|
+ subscribeId: 0,
|
|
|
+ listApplyName: [],
|
|
|
+ listLiveName: [],
|
|
|
list: [
|
|
|
{
|
|
|
label: "模拟考试",
|
|
@@ -578,7 +607,10 @@ export default {
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["sysTime"]),
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
this.nowTime = +this.$tools.timest();
|
|
|
this.mockSubscribeListSubscribe();
|
|
|
},
|
|
@@ -586,6 +618,43 @@ export default {
|
|
|
await this.clears();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapActions(["setSystemTime"]),
|
|
|
+ mockExamDateChange() {
|
|
|
+ this.mockApplyListApplyName();
|
|
|
+ },
|
|
|
+ mockLiveDateChange() {
|
|
|
+ this.mockLiveListApplyName();
|
|
|
+ },
|
|
|
+ mockLiveListApplyName() {
|
|
|
+ let liveParam = JSON.parse(JSON.stringify(this.liveParam));
|
|
|
+ if (liveParam.dateRange && liveParam.dateRange[0]) {
|
|
|
+ liveParam.startTime = liveParam.dateRange[0].toString().substr(0, 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (liveParam.dateRange && liveParam.dateRange[1]) {
|
|
|
+ liveParam.endTime = liveParam.dateRange[1].toString().substr(0, 10);
|
|
|
+ }
|
|
|
+ this.$request.mockApplyListApplyName(liveParam).then((res) => {
|
|
|
+ this.listLiveName = res.rows;
|
|
|
+ this.liveParam.applyName = "";
|
|
|
+ this.mockApplyListMockLive();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ mockApplyListApplyName() {
|
|
|
+ let examParam = JSON.parse(JSON.stringify(this.examParam));
|
|
|
+ if (examParam.dateRange && examParam.dateRange[0]) {
|
|
|
+ examParam.startTime = examParam.dateRange[0].toString().substr(0, 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (examParam.dateRange && examParam.dateRange[1]) {
|
|
|
+ examParam.endTime = examParam.dateRange[1].toString().substr(0, 10);
|
|
|
+ }
|
|
|
+ this.$request.mockApplyListApplyName(examParam).then((res) => {
|
|
|
+ this.listApplyName = res.rows;
|
|
|
+ this.examParam.applyName = "";
|
|
|
+ this.mockSubscribeListSubscribe();
|
|
|
+ });
|
|
|
+ },
|
|
|
async closePlayBackModal() {
|
|
|
await this.clears();
|
|
|
},
|
|
@@ -601,8 +670,10 @@ export default {
|
|
|
} else if (item.liveStatus == 2) {
|
|
|
//回放中
|
|
|
this.playBackModal = true;
|
|
|
- this.vid = item.liveUrl;
|
|
|
- this.loadPlayerScript(this.loadPlayer);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.vid = item.recordingUrl;
|
|
|
+ this.loadPlayerScript(this.loadPlayer);
|
|
|
+ });
|
|
|
} else if (item.liveStatus == 3) {
|
|
|
//已结束
|
|
|
this.$message.warning("直播已结束,不能查看回放");
|
|
@@ -660,6 +731,7 @@ export default {
|
|
|
recordId: item.recordId,
|
|
|
examId: item.examId,
|
|
|
eachExamId: item.eachExamId,
|
|
|
+ subscribeId: item.subscribeId,
|
|
|
},
|
|
|
});
|
|
|
},
|
|
@@ -689,23 +761,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
goTest(item) {
|
|
|
- let nowTime = +this.$tools.timest();
|
|
|
let startTime = this.$tools.TimeTotimestamp(
|
|
|
this.$tools.timestampToTime(item.applySiteExamTime) +
|
|
|
" " +
|
|
|
item.applySiteStartTime
|
|
|
);
|
|
|
let canGo =
|
|
|
- startTime - nowTime <= 600 &&
|
|
|
- startTime - nowTime >= (-(item.timeLimit * 60) || 0);
|
|
|
+ startTime - this.nowTime <= 600 &&
|
|
|
+ startTime - this.nowTime >= (-(item.timeLimit * 60) || 0);
|
|
|
|
|
|
return !canGo;
|
|
|
},
|
|
|
+ isStart(item) {
|
|
|
+ let startTime = this.$tools.TimeTotimestamp(
|
|
|
+ this.$tools.timestampToTime(item.applySiteExamTime) +
|
|
|
+ " " +
|
|
|
+ item.applySiteStartTime
|
|
|
+ );
|
|
|
+
|
|
|
+ return startTime - this.nowTime <= 600;
|
|
|
+ },
|
|
|
goExamCount(item) {
|
|
|
- // if (this.goTest(item)) {
|
|
|
- // this.$message.warning("不在考试时间");
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ if (this.goTest(item)) {
|
|
|
+ this.$message.warning("不在考试时间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
this.$router.push({
|
|
|
path: "/mock-countdown",
|
|
@@ -715,6 +795,7 @@ export default {
|
|
|
" " +
|
|
|
item.applySiteStartTime
|
|
|
),
|
|
|
+ mockName: item.applyName,
|
|
|
limit: item.timeLimit,
|
|
|
examId: item.examId,
|
|
|
eachExamId: item.eachExamId,
|
|
@@ -750,9 +831,14 @@ export default {
|
|
|
// mockMajorSubjectId:49
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- this.showItem = item;
|
|
|
- this.appointModal = true;
|
|
|
- this.mockApplyListApply();
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.showItem = item;
|
|
|
+ this.subscribeId = res.data;
|
|
|
+ this.appointModal = true;
|
|
|
+ this.mockApplyListApply();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(err.msg);
|
|
|
+ }
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.$message.warning(err.msg);
|
|
@@ -761,7 +847,16 @@ export default {
|
|
|
canApply(item) {
|
|
|
let startTime = item.applyStartTime;
|
|
|
let endTime = item.applyEndTime;
|
|
|
- if (this.nowTime >= startTime && this.nowTime <= endTime) {
|
|
|
+ let examTime = item.examTime;
|
|
|
+ console.log(this.sysTime);
|
|
|
+ console.log(startTime);
|
|
|
+ console.log(endTime);
|
|
|
+ console.log(examTime);
|
|
|
+ if (
|
|
|
+ this.sysTime >= startTime &&
|
|
|
+ this.sysTime <= endTime &&
|
|
|
+ this.sysTime < examTime
|
|
|
+ ) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return false;
|
|
@@ -773,12 +868,12 @@ export default {
|
|
|
let projectId = "";
|
|
|
|
|
|
if (projectObj) {
|
|
|
- projectId.projectId;
|
|
|
+ projectId = projectObj.projectId;
|
|
|
}
|
|
|
-
|
|
|
await this.courseMajorList({
|
|
|
businessId: this.appointParam.businessId,
|
|
|
projectId: projectId,
|
|
|
+ status: 1,
|
|
|
});
|
|
|
this.mockApplyListApply();
|
|
|
},
|
|
@@ -796,10 +891,21 @@ export default {
|
|
|
showClose: true,
|
|
|
})
|
|
|
.then((_) => {
|
|
|
- console.log("开启");
|
|
|
+ this.mockSubscribeEdit();
|
|
|
})
|
|
|
.catch((_) => {});
|
|
|
},
|
|
|
+
|
|
|
+ mockSubscribeEdit() {
|
|
|
+ this.$request
|
|
|
+ .mockSubscribeEdit({
|
|
|
+ mockRemind: 1,
|
|
|
+ subscribeId: this.subscribeId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("开启成功");
|
|
|
+ });
|
|
|
+ },
|
|
|
mockApplyListApplyBusiness() {
|
|
|
return new Promise((resolve) => {
|
|
|
this.$request.mockApplyListApplyBusiness().then(async (res) => {
|
|
@@ -820,9 +926,9 @@ export default {
|
|
|
this.$request.courseMajorList(data).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
self.sList = res.rows;
|
|
|
- let allItem = { id: "", subjectName: "全部" };
|
|
|
+ let allItem = { id: "", categoryName: "全部" };
|
|
|
self.sList.unshift(allItem);
|
|
|
- this.appointParam.subjectId = "";
|
|
|
+ this.appointParam.majorId = "";
|
|
|
|
|
|
resolve();
|
|
|
}
|
|
@@ -839,6 +945,7 @@ export default {
|
|
|
},
|
|
|
liveParamCurrentChange(e) {
|
|
|
this.liveParam.pageNum = e;
|
|
|
+ this.mockLiveListApplyName();
|
|
|
},
|
|
|
async tabChange(e) {
|
|
|
if (this.activeName == e.name) {
|
|
@@ -869,13 +976,21 @@ export default {
|
|
|
mockSubscribeListSubscribe() {
|
|
|
let examParam = JSON.parse(JSON.stringify(this.examParam));
|
|
|
if (examParam.dateRange && examParam.dateRange[0]) {
|
|
|
- examParam.endTime = this.$tools.TimeTotimestamp(examParam.dateRange[0]);
|
|
|
+ examParam.startTime = examParam.dateRange[0].toString().substr(0, 10);
|
|
|
}
|
|
|
|
|
|
if (examParam.dateRange && examParam.dateRange[1]) {
|
|
|
- examParam.startTime = this.$tools.TimeTotimestamp(
|
|
|
- examParam.dateRange[1]
|
|
|
- );
|
|
|
+ examParam.endTime = examParam.dateRange[1].toString().substr(0, 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.listApplyName.length) {
|
|
|
+ examParam.applyName = this.listApplyName.find(
|
|
|
+ (item) => examParam.applyName == item.applyId
|
|
|
+ )
|
|
|
+ ? this.listApplyName.find(
|
|
|
+ (item) => examParam.applyName == item.applyId
|
|
|
+ ).applyName
|
|
|
+ : "";
|
|
|
}
|
|
|
this.$request.mockSubscribeListSubscribe(examParam).then((res) => {
|
|
|
this.examList = res.rows;
|
|
@@ -883,20 +998,20 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- mockApplyListApply() {
|
|
|
+ async mockApplyListApply() {
|
|
|
let appointParam = JSON.parse(JSON.stringify(this.appointParam));
|
|
|
if (appointParam.dateRange && appointParam.dateRange[0]) {
|
|
|
- appointParam.endTime = this.$tools.TimeTotimestamp(
|
|
|
- appointParam.dateRange[0]
|
|
|
- );
|
|
|
+ appointParam.startTime = appointParam.dateRange[0]
|
|
|
+ .toString()
|
|
|
+ .substr(0, 10);
|
|
|
}
|
|
|
|
|
|
if (appointParam.dateRange && appointParam.dateRange[1]) {
|
|
|
- appointParam.startTime = this.$tools.TimeTotimestamp(
|
|
|
- appointParam.dateRange[1]
|
|
|
- );
|
|
|
+ appointParam.endTime = appointParam.dateRange[1]
|
|
|
+ .toString()
|
|
|
+ .substr(0, 10);
|
|
|
}
|
|
|
-
|
|
|
+ this.setSystemTime();
|
|
|
this.$request.mockApplyListApply(appointParam).then((res) => {
|
|
|
this.mockList = res.rows;
|
|
|
this.appointParam.total = res.total;
|
|
@@ -905,13 +1020,21 @@ export default {
|
|
|
mockApplyListMockLive() {
|
|
|
let liveParam = JSON.parse(JSON.stringify(this.liveParam));
|
|
|
if (liveParam.dateRange && liveParam.dateRange[0]) {
|
|
|
- liveParam.endTime = this.$tools.TimeTotimestamp(liveParam.dateRange[0]);
|
|
|
+ liveParam.startTime = liveParam.dateRange[0].toString().substr(0, 10);
|
|
|
}
|
|
|
|
|
|
if (liveParam.dateRange && liveParam.dateRange[1]) {
|
|
|
- liveParam.startTime = this.$tools.TimeTotimestamp(
|
|
|
- liveParam.dateRange[1]
|
|
|
- );
|
|
|
+ liveParam.endTime = liveParam.dateRange[1].toString().substr(0, 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.listLiveName.length) {
|
|
|
+ liveParam.applyName = this.listLiveName.find(
|
|
|
+ (item) => liveParam.applyName == item.applyId
|
|
|
+ )
|
|
|
+ ? this.listLiveName.find(
|
|
|
+ (item) => liveParam.applyName == item.applyId
|
|
|
+ ).applyName
|
|
|
+ : "";
|
|
|
}
|
|
|
this.$request.mockApplyListMockLive(liveParam).then((res) => {
|
|
|
this.liveList = res.rows;
|
|
@@ -1181,7 +1304,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.desc {
|
|
|
- margin-top: 10px;
|
|
|
+ margin-top: 5px;
|
|
|
font-size: 14px;
|
|
|
font-family: Microsoft YaHei;
|
|
|
font-weight: 400;
|