index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. <template>
  2. <div class="my-order">
  3. <div class="my-order__header">
  4. <el-tabs :value="activeName" @tab-click="tabChange">
  5. <el-tab-pane
  6. v-for="(tab, tabIndex) in list"
  7. :key="tabIndex"
  8. :name="tab.name"
  9. >
  10. <span slot="label" class="label">{{
  11. tab.count ? `${tab.label}(${tab.count})` : `${tab.label}`
  12. }}</span>
  13. </el-tab-pane>
  14. </el-tabs>
  15. </div>
  16. <div class="my-order__body">
  17. <template v-if="activeName == '1'">
  18. <div class="mock-list">
  19. <div class="mock-list__header">
  20. <div class="tabs">
  21. <div
  22. class="tab"
  23. :class="{ active: examParam.mockStatus == 0 }"
  24. @click="stateChange(0)"
  25. >
  26. 未考试
  27. </div>
  28. <div
  29. class="tab"
  30. :class="{ active: examParam.mockStatus == 1 }"
  31. @click="stateChange(1)"
  32. >
  33. 已结束
  34. </div>
  35. </div>
  36. </div>
  37. <div class="mock-list__body">
  38. <div class="selects">
  39. <div class="item clearfix">
  40. <div class="text">考试时间</div>
  41. <div class="select">
  42. <el-date-picker
  43. v-model="examParam.dateRange"
  44. type="datetimerange"
  45. value-format="timestamp"
  46. @change="mockExamDateChange"
  47. placeholder="选择日期"
  48. >
  49. </el-date-picker>
  50. </div>
  51. </div>
  52. <div class="item clearfix">
  53. <div class="text">考试标题</div>
  54. <div class="select">
  55. <el-select
  56. placeholder="请选择"
  57. v-model="examParam.applyName"
  58. @change="mockSubscribeListSubscribe"
  59. >
  60. <el-option
  61. v-for="(item, index) in listApplyName"
  62. :key="index"
  63. :label="item.applyName"
  64. :value="item.applyId"
  65. >
  66. </el-option>
  67. </el-select>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="list">
  72. <div
  73. class="mock-item"
  74. v-for="(item, index) in examList"
  75. :key="index"
  76. >
  77. <template v-if="examParam.mockStatus == 0">
  78. <div class="mock-item__header">
  79. <div class="title">{{ item.subjectName }}</div>
  80. <!-- <div class="time">2022/4/15 9:30:00</div> -->
  81. </div>
  82. <div class="mock-item__body">
  83. <div class="content">
  84. <div class="item">
  85. <span class="item__left">项目:</span>
  86. <span class="item__right"
  87. >{{ item.businessName }} {{ item.projectName }}</span
  88. >
  89. </div>
  90. <div class="item">
  91. <span class="item__left">专业:</span>
  92. <span class="item__right">{{ item.categoryName }}</span>
  93. </div>
  94. <!-- <div class="item">
  95. <span class="item__left">科目:</span>
  96. <span class="item__right">{{ item.subjectName }}</span>
  97. </div> -->
  98. <div class="item">
  99. <span class="item__left">考试时间:</span>
  100. <span class="item__right">
  101. {{ $tools.timestampToTime(item.applySiteExamTime) }}
  102. {{ item.applySiteStartTime }} -
  103. {{ item.applySiteEndTime }}
  104. </span>
  105. </div>
  106. </div>
  107. <div class="btn-wrap">
  108. <div class="btn-item" v-if="goTest(item)">
  109. <el-button class="btn" disabled type="primary"
  110. >去考试</el-button
  111. >
  112. <div class="text" v-if="!isStart(item)">考试未开始</div>
  113. </div>
  114. <div class="btn-item" v-else-if="item.handStatus">
  115. <el-button class="btn" disabled type="primary"
  116. >已考试</el-button
  117. >
  118. </div>
  119. <div class="btn-item" v-else>
  120. <el-button
  121. class="btn"
  122. @click="goExamCount(item)"
  123. type="primary"
  124. >去考试</el-button
  125. >
  126. </div>
  127. </div>
  128. </div>
  129. </template>
  130. <template v-if="examParam.mockStatus == 1">
  131. <div class="mock-item__header">
  132. <div class="title">{{ item.applyName }}</div>
  133. <!-- <div class="time">2022/4/15 9:30:00</div> -->
  134. </div>
  135. <div class="mock-item__body">
  136. <div class="content">
  137. <div class="item">
  138. <span class="item__left">项目:</span>
  139. <span class="item__right"
  140. >{{ item.businessName }} {{ item.projectName }}</span
  141. >
  142. </div>
  143. <div class="item">
  144. <span class="item__left">专业:</span>
  145. <span class="item__right">{{ item.categoryName }}</span>
  146. </div>
  147. <div class="item">
  148. <span class="item__left">科目:</span>
  149. <span class="item__right">{{ item.subjectName }}</span>
  150. </div>
  151. <div class="item">
  152. <span class="item__left">考试时间:</span>
  153. <span class="item__right">
  154. {{ $tools.timestampToTime(item.applySiteExamTime) }}
  155. {{ item.applySiteStartTime }} -
  156. {{ item.applySiteEndTime }}
  157. </span>
  158. </div>
  159. </div>
  160. <div class="btn-wrap btn-wrap--over">
  161. <template>
  162. <div class="btn-item" v-if="item.reSubscribe == 1">
  163. <el-button
  164. class="btn"
  165. plain
  166. type="primary"
  167. @click="reApply(item)"
  168. >重新预约</el-button
  169. >
  170. </div>
  171. <div class="btn-item">
  172. <el-button
  173. class="btn"
  174. :disabled="item.canDo === 0"
  175. plain
  176. type="primary"
  177. @click="doQuestion(item)"
  178. >去做题</el-button
  179. >
  180. <div class="text red" v-if="!item.handStatus">
  181. 由于未按时参加考试,主观题将不会提交至后台进行人工阅卷
  182. </div>
  183. </div>
  184. <div class="btn-item" v-if="item.handStatus">
  185. <el-button
  186. class="btn"
  187. plain
  188. type="primary"
  189. @click="report(item)"
  190. >查看报告</el-button
  191. >
  192. <div class="text red">
  193. 当前报告含主观题需人工阅卷,阅卷完成后显示完整报告
  194. </div>
  195. </div>
  196. </template>
  197. </div>
  198. </div>
  199. <div
  200. class="mock-item__footer"
  201. v-if="
  202. item.liveEndTime && item.liveStartTime && item.liveUrl
  203. "
  204. >
  205. <div class="text">
  206. 模考讲解直播时间:{{
  207. $tools.timestampToTime(item.liveStartTime, false)
  208. }}
  209. - {{ $tools.timestampToTime(item.liveEndTime, false) }}
  210. </div>
  211. <el-button
  212. class="btn"
  213. type="primary"
  214. plain
  215. @click="goLive(item)"
  216. >去查看</el-button
  217. >
  218. </div>
  219. </template>
  220. </div>
  221. </div>
  222. <div class="pagination">
  223. <el-pagination
  224. @current-change="examCurrentChange"
  225. background
  226. layout="prev, pager, next"
  227. :total="examParam.total"
  228. :pager-count="5"
  229. :page-size="formData.pageSize"
  230. >
  231. </el-pagination>
  232. </div>
  233. </div>
  234. </div>
  235. </template>
  236. <template v-if="activeName == '2'">
  237. <div class="mock-list">
  238. <div class="mock-list__body">
  239. <div class="selects">
  240. <div class="item clearfix">
  241. <div class="text">业务层次</div>
  242. <div class="select">
  243. <el-select
  244. placeholder="请选择"
  245. clearable
  246. @change="businessChange"
  247. v-model="appointParam.businessId"
  248. >
  249. <el-option
  250. v-for="(item, index) in businesslist"
  251. :key="index"
  252. :label="
  253. item.educationName +
  254. ':' +
  255. item.businessName +
  256. '-' +
  257. item.projectName
  258. "
  259. :value="item.businessId"
  260. >
  261. </el-option>
  262. </el-select>
  263. </div>
  264. </div>
  265. <div class="item clearfix">
  266. <div class="text">专业</div>
  267. <div class="select">
  268. <el-select
  269. placeholder="请选择"
  270. @change="subjectChange"
  271. v-model="appointParam.majorId"
  272. >
  273. <el-option
  274. v-for="(item, index) in sList"
  275. :key="index"
  276. :label="item.categoryName"
  277. :value="item.id"
  278. >
  279. </el-option>
  280. </el-select>
  281. </div>
  282. </div>
  283. <div class="item clearfix">
  284. <div class="text">考试时间</div>
  285. <div class="select">
  286. <el-date-picker
  287. @change="mockApplyListApply"
  288. v-model="appointParam.dateRange"
  289. type="datetimerange"
  290. value-format="timestamp"
  291. placeholder="选择日期"
  292. >
  293. </el-date-picker>
  294. </div>
  295. </div>
  296. </div>
  297. <div class="list">
  298. <div
  299. class="mock-item"
  300. v-for="(item, mockIndex) in mockList"
  301. :key="mockIndex"
  302. >
  303. <div class="mock-item__header">
  304. <div class="title">{{ item.applyName }}</div>
  305. <!-- <div class="time">{{$tools.timestampToTime(item.examTime)}}</div> -->
  306. </div>
  307. <div class="mock-item__body">
  308. <div class="content">
  309. <div class="item">
  310. <span class="item__left">项目:</span>
  311. <span class="item__right"
  312. >{{ item.businessName }} {{ item.projectName }}</span
  313. >
  314. </div>
  315. <div class="item">
  316. <span class="item__left">专业:</span>
  317. <span class="item__right">{{ item.categoryName }}</span>
  318. </div>
  319. <div class="item">
  320. <span class="item__left">科目:</span>
  321. <span class="item__right">{{ item.subjectName }}</span>
  322. </div>
  323. <div class="item">
  324. <span class="item__left">考试时间:</span>
  325. <span class="item__right">
  326. {{ $tools.timestampToTime(item.examTime) }}
  327. {{ item.startTime }} - {{ item.endTime }}
  328. </span>
  329. </div>
  330. </div>
  331. <div class="btn-wrap">
  332. <div class="btn-item" v-if="!item.isSubscribe">
  333. <el-button class="btn" disabled type="primary" plain
  334. >已预约</el-button
  335. >
  336. </div>
  337. <div class="btn-item" v-else>
  338. <el-button
  339. class="btn"
  340. type="primary"
  341. plain
  342. :disabled="!canApply(item)"
  343. @click="appoint(item)"
  344. >预约考试</el-button
  345. >
  346. </div>
  347. </div>
  348. </div>
  349. </div>
  350. </div>
  351. <div class="pagination">
  352. <el-pagination
  353. @current-change="appointParamCurrentChange"
  354. background
  355. layout="prev, pager, next"
  356. :total="appointParam.total"
  357. :pager-count="5"
  358. :page-size="appointParam.pageSize"
  359. >
  360. </el-pagination>
  361. </div>
  362. </div>
  363. </div>
  364. </template>
  365. <template v-if="activeName == '3'">
  366. <div class="mock-list">
  367. <div class="mock-list__body">
  368. <div class="selects">
  369. <div class="item clearfix">
  370. <div class="text">考试时间</div>
  371. <div class="select">
  372. <el-date-picker
  373. v-model="liveParam.dateRange"
  374. type="datetimerange"
  375. value-format="timestamp"
  376. @change="mockLiveDateChange"
  377. placeholder="选择日期"
  378. >
  379. </el-date-picker>
  380. </div>
  381. </div>
  382. <div class="item clearfix">
  383. <div class="text">考试标题</div>
  384. <div class="select">
  385. <el-select
  386. placeholder="请选择"
  387. @change="mockApplyListMockLive"
  388. v-model="liveParam.applyName"
  389. >
  390. <el-option
  391. v-for="(item, index) in listLiveName"
  392. :key="index"
  393. :label="item.applyName"
  394. :value="item.applyId"
  395. >
  396. </el-option>
  397. </el-select>
  398. </div>
  399. </div>
  400. </div>
  401. <div class="live-list clearfix">
  402. <div
  403. class="live-item"
  404. v-for="(item, index) in liveList"
  405. :key="index"
  406. @click="goLivingRoom(item)"
  407. >
  408. <div class="live-item__header">
  409. <img src="@/assets/pic.png" alt="" class="img" />
  410. <div
  411. class="note"
  412. :class="{
  413. 'note--blue': item.liveStatus == 1,
  414. 'note--green': item.liveStatus == 2,
  415. 'note--gray': item.liveStatus == 3,
  416. }"
  417. >
  418. <img
  419. v-if="item.liveStatus == 2"
  420. src="@/assets/play.png"
  421. alt=""
  422. />
  423. <img
  424. v-if="item.liveStatus == 0"
  425. src="@/assets/living.png"
  426. alt=""
  427. />
  428. <img
  429. v-if="item.liveStatus == 1"
  430. src="@/assets/wait.png"
  431. alt=""
  432. />
  433. {{ item.liveStatus == 0 ? "直播中" : "" }}
  434. {{ item.liveStatus == 1 ? "未开播" : "" }}
  435. {{ item.liveStatus == 2 ? "回放中" : "" }}
  436. {{ item.liveStatus == 3 ? "已结束" : "" }}
  437. </div>
  438. </div>
  439. <div class="live-item__body">
  440. <div class="title">{{ item.sectionName }}</div>
  441. <div class="desc">
  442. 直播时间:{{
  443. $tools.timestampToTime(item.liveStartTime, false)
  444. }}
  445. - {{ $tools.timestampToTime(item.liveEndTime, false) }}
  446. </div>
  447. </div>
  448. </div>
  449. </div>
  450. <div class="pagination">
  451. <el-pagination
  452. @current-change="liveParamCurrentChange"
  453. background
  454. layout="prev, pager, next"
  455. :total="liveParam.total"
  456. :pager-count="5"
  457. :page-size="liveParam.pageSize"
  458. >
  459. </el-pagination>
  460. </div>
  461. </div>
  462. </div>
  463. </template>
  464. </div>
  465. <el-dialog :visible.sync="appointModal" width="462px" class="appoint-modal">
  466. <div class="appoint-modal__content">
  467. <img class="img" src="@/assets/appoinsuccess.png" alt="" />
  468. <div class="title">预约成功</div>
  469. <div class="content">
  470. 您预约的模拟考试,安排如下:
  471. <div class="item">
  472. <span class="item__left">模考场次:</span>
  473. <span class="item__right">{{ showItem.applyName }} </span>
  474. </div>
  475. <div class="item">
  476. <span class="item__left">项目:</span>
  477. <span class="item__right"
  478. >{{ showItem.businessName }} {{ showItem.projectName }}
  479. </span>
  480. </div>
  481. <!-- <div class="item">
  482. <span class="item__left">专业:</span>
  483. <span class="item__right">{{ showItem.subjectName }} </span>
  484. </div> -->
  485. <div class="item">
  486. <span class="item__left">科目:</span>
  487. <span class="item__right">{{ showItem.subjectName }} </span>
  488. </div>
  489. <div class="item">
  490. <span class="item__left">考试时间:</span>
  491. <span class="item__right">
  492. {{ $tools.timestampToTime(showItem.examTime) }}
  493. {{ showItem.startTime }} - {{ showItem.endTime }}
  494. </span>
  495. </div>
  496. 请准时参加考试哦~
  497. <el-button class="btn" type="primary" @click="ok">我知道了</el-button>
  498. </div>
  499. </div>
  500. </el-dialog>
  501. <el-dialog
  502. :visible.sync="playBackModal"
  503. width="800px"
  504. @close="closePlayBackModal"
  505. >
  506. <div class="">
  507. <div v-show="vid" id="player"></div>
  508. </div>
  509. </el-dialog>
  510. </div>
  511. </template>
  512. <script>
  513. import { mapMutations, mapActions, mapGetters } from "vuex";
  514. export default {
  515. name: "MyOrder",
  516. data() {
  517. return {
  518. vid: "",
  519. vodPlayerJs: "https://player.polyv.net/script/player.js",
  520. playerJs:
  521. "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  522. uidzb: "egsxlptzdq",
  523. appointModal: false,
  524. playBackModal: false,
  525. appointParam: {
  526. dateRange: "",
  527. pageNum: 1,
  528. pageSize: 10,
  529. businessId: "",
  530. majorId: "",
  531. total: 0,
  532. },
  533. examParam: {
  534. applyName: "",
  535. dateRange: "",
  536. pageNum: 1,
  537. pageSize: 10,
  538. mockStatus: 0,
  539. total: 0,
  540. },
  541. liveParam: {
  542. applyName: "",
  543. dateRange: "",
  544. pageNum: 1,
  545. pageSize: 10,
  546. total: 0,
  547. },
  548. total: 1,
  549. title: 0,
  550. liveList: [],
  551. orderList: [],
  552. mockList: [],
  553. examList: [],
  554. sList: [],
  555. showItem: {},
  556. businesslist: [],
  557. activeName: "1",
  558. formData: {
  559. status: "0,1",
  560. pageNum: 1,
  561. pageSize: 10,
  562. },
  563. player: null,
  564. date: "",
  565. state: 0,
  566. nowTime: 0,
  567. subscribeId: 0,
  568. listApplyName: [],
  569. listLiveName: [],
  570. list: [
  571. {
  572. label: "模拟考试",
  573. count: 0,
  574. name: "1",
  575. },
  576. {
  577. label: "考试预约",
  578. count: 0,
  579. name: "2",
  580. },
  581. {
  582. label: "讲解直播",
  583. count: 0,
  584. name: "3",
  585. },
  586. ],
  587. };
  588. },
  589. computed: {
  590. ...mapGetters(["sysTime"]),
  591. },
  592. async mounted() {
  593. this.nowTime = +this.$tools.timest();
  594. this.mockSubscribeListSubscribe();
  595. },
  596. async destroyed() {
  597. await this.clears();
  598. },
  599. methods: {
  600. ...mapActions(["setSystemTime"]),
  601. mockExamDateChange() {
  602. this.mockApplyListApplyName();
  603. },
  604. mockLiveDateChange() {
  605. this.mockLiveListApplyName();
  606. },
  607. mockLiveListApplyName() {
  608. let liveParam = JSON.parse(JSON.stringify(this.liveParam));
  609. if (liveParam.dateRange && liveParam.dateRange[0]) {
  610. liveParam.startTime = liveParam.dateRange[0].toString().substr(0, 10);
  611. }
  612. if (liveParam.dateRange && liveParam.dateRange[1]) {
  613. liveParam.endTime = liveParam.dateRange[1].toString().substr(0, 10);
  614. }
  615. this.$request.mockApplyListApplyName(liveParam).then((res) => {
  616. this.listLiveName = res.rows;
  617. this.liveParam.applyName = "";
  618. this.mockApplyListMockLive();
  619. });
  620. },
  621. mockApplyListApplyName() {
  622. let examParam = JSON.parse(JSON.stringify(this.examParam));
  623. if (examParam.dateRange && examParam.dateRange[0]) {
  624. examParam.startTime = examParam.dateRange[0].toString().substr(0, 10);
  625. }
  626. if (examParam.dateRange && examParam.dateRange[1]) {
  627. examParam.endTime = examParam.dateRange[1].toString().substr(0, 10);
  628. }
  629. this.$request.mockApplyListApplyName(examParam).then((res) => {
  630. this.listApplyName = res.rows;
  631. this.examParam.applyName = "";
  632. this.mockSubscribeListSubscribe();
  633. });
  634. },
  635. async closePlayBackModal() {
  636. await this.clears();
  637. },
  638. goLivingRoom(item) {
  639. if (item.liveStatus == 0) {
  640. //直播中
  641. this.$router.push({
  642. path: "/living-room/" + item.liveUrl,
  643. query: {
  644. sectionType: 2,
  645. }
  646. });
  647. } else if (item.liveStatus == 1) {
  648. //未开播
  649. this.$message.warning("暂未开播,请在开播后查看");
  650. } else if (item.liveStatus == 2) {
  651. //回放中
  652. this.playBackModal = true;
  653. this.$nextTick(() => {
  654. this.vid = item.recordingUrl;
  655. this.loadPlayerScript(this.loadPlayer);
  656. });
  657. } else if (item.liveStatus == 3) {
  658. //已结束
  659. this.$message.warning("直播已结束,不能查看回放");
  660. }
  661. },
  662. loadPlayerScript(callback) {
  663. if (!window.polyvPlayer) {
  664. const myScript = document.createElement("script");
  665. myScript.setAttribute("src", this.vodPlayerJs);
  666. myScript.onload = callback;
  667. document.body.appendChild(myScript);
  668. } else {
  669. callback();
  670. }
  671. },
  672. loadPlayer() {
  673. var self = this;
  674. const polyvPlayer = window.polyvPlayer;
  675. self.$request.obtainpolyvvideosign(self.vid).then((res) => {
  676. self.player = polyvPlayer({
  677. wrap: "#player",
  678. width: "100%",
  679. showLine: "off",
  680. height: 455,
  681. ban_history_time: "on",
  682. vid: self.vid,
  683. autoplay: true,
  684. ban_seek: "on",
  685. speed: true,
  686. teaser_show: 1,
  687. tail_show: 1,
  688. hideSwitchPlayer: true,
  689. watchStartTime: 0,
  690. ts: res.data.ts,
  691. sign: res.data.sign,
  692. playsafe: function (vid, next) {
  693. next();
  694. },
  695. });
  696. });
  697. },
  698. clears() {
  699. return new Promise((resolve, reject) => {
  700. this.vid = "";
  701. if (this.player) {
  702. this.player.destroy();
  703. }
  704. resolve();
  705. });
  706. },
  707. report(item) {
  708. this.$router.push({
  709. path: "/mock-report",
  710. query: {
  711. recordId: item.recordId,
  712. examId: item.examId,
  713. eachExamId: item.eachExamId,
  714. subscribeId: item.subscribeId,
  715. },
  716. });
  717. },
  718. doQuestion(item) {
  719. if (item.canDo === 0) {
  720. this.$message.warning("请等待所有科目考试结束后再进入刷题");
  721. return;
  722. }
  723. this.$router.push({
  724. path: "/mock-exam",
  725. query: {
  726. examId: item.examId,
  727. eachExamId: item.eachExamId,
  728. },
  729. });
  730. },
  731. async reApply(item) {
  732. this.activeName = "2";
  733. await this.mockApplyListApplyBusiness();
  734. this.mockApplyListApply();
  735. },
  736. goLive(item) {
  737. this.$router.push({
  738. path: "/living-room/" + item.liveUrl,
  739. query: {
  740. sectionType: 2,
  741. }
  742. });
  743. },
  744. goTest(item) {
  745. let startTime = this.$tools.TimeTotimestamp(
  746. this.$tools.timestampToTime(item.applySiteExamTime) +
  747. " " +
  748. item.applySiteStartTime
  749. );
  750. let canGo =
  751. startTime - this.nowTime <= 600 &&
  752. startTime - this.nowTime >= (-(item.timeLimit * 60) || 0);
  753. return !canGo;
  754. },
  755. isStart(item) {
  756. let startTime = this.$tools.TimeTotimestamp(
  757. this.$tools.timestampToTime(item.applySiteExamTime) +
  758. " " +
  759. item.applySiteStartTime
  760. );
  761. return startTime - this.nowTime <= 600;
  762. },
  763. goExamCount(item) {
  764. if (this.goTest(item)) {
  765. this.$message.warning("不在考试时间");
  766. return;
  767. }
  768. this.$router.push({
  769. path: "/mock-countdown",
  770. query: {
  771. start: this.$tools.TimeTotimestamp(
  772. this.$tools.timestampToTime(item.applySiteExamTime) +
  773. " " +
  774. item.applySiteStartTime
  775. ),
  776. mockName: item.applyName,
  777. limit: item.timeLimit,
  778. examId: item.examId,
  779. eachExamId: item.eachExamId,
  780. examEndTime: this.$tools.TimeTotimestamp(
  781. this.$tools.timestampToTime(item.applySiteExamTime) +
  782. " " +
  783. item.applySiteEndTime
  784. ),
  785. subscribeId: item.subscribeId,
  786. },
  787. });
  788. },
  789. appoint(item) {
  790. let canApply = this.canApply(item);
  791. if (!canApply) {
  792. this.$message.warning("不在预约时间范围");
  793. return;
  794. }
  795. if (!item.isSubscribe) {
  796. this.$message.warning("您已预约");
  797. return;
  798. }
  799. this.$request
  800. .mockSubscribe({
  801. applySiteExamTime: item.examTime,
  802. applySiteEndTime: item.endTime,
  803. applySiteStartTime: item.startTime,
  804. applyId: item.applyId,
  805. mockMajorSubjectId: item.mockMajorSubjectId,
  806. eachExamId: item.eachExamId,
  807. // applySiteExamTime:1653899220,
  808. // applySiteEndTime:"17:27:54",
  809. // applySiteStartTime:'16:27:54',
  810. // applyId:26,
  811. // mockMajorSubjectId:49
  812. })
  813. .then((res) => {
  814. if (res.code == 200) {
  815. this.showItem = item;
  816. this.subscribeId = res.data;
  817. this.appointModal = true;
  818. this.mockApplyListApply();
  819. } else {
  820. this.$message.warning(err.msg);
  821. }
  822. })
  823. .catch((err) => {
  824. this.$message.warning(err.msg);
  825. });
  826. },
  827. canApply(item) {
  828. let startTime = item.applyStartTime;
  829. let endTime = item.applyEndTime;
  830. let examTime = item.examTime;
  831. console.log(this.sysTime);
  832. console.log(startTime);
  833. console.log(endTime);
  834. console.log(examTime);
  835. if (
  836. this.sysTime >= startTime &&
  837. this.sysTime <= endTime &&
  838. this.sysTime < examTime
  839. ) {
  840. return true;
  841. } else {
  842. return false;
  843. }
  844. },
  845. async businessChange(e) {
  846. let projectObj = this.businesslist.find((item) => item.businessId == e);
  847. let projectId = "";
  848. if (projectObj) {
  849. projectId = projectObj.projectId;
  850. }
  851. await this.courseMajorList({
  852. businessId: this.appointParam.businessId,
  853. projectId: projectId,
  854. status: 1,
  855. });
  856. this.mockApplyListApply();
  857. },
  858. subjectChange(e) {
  859. this.mockApplyListApply();
  860. },
  861. ok() {
  862. this.appointModal = false;
  863. this.$confirm(`开考前10分钟提醒入场,不错过实战机会`, "开考提醒", {
  864. confirmButtonText: "立即开启",
  865. cancelButtonText: "取消",
  866. closeOnClickModal: false,
  867. closeOnPressEscape: false,
  868. distinguishCancelAndClose: false,
  869. showClose: true,
  870. })
  871. .then((_) => {
  872. this.mockSubscribeEdit();
  873. })
  874. .catch((_) => {});
  875. },
  876. mockSubscribeEdit() {
  877. this.$request
  878. .mockSubscribeEdit({
  879. mockRemind: 1,
  880. subscribeId: this.subscribeId,
  881. })
  882. .then((res) => {
  883. this.$message.success("开启成功");
  884. });
  885. },
  886. mockApplyListApplyBusiness() {
  887. return new Promise((resolve) => {
  888. this.$request.mockApplyListApplyBusiness().then(async (res) => {
  889. this.businesslist = res.rows;
  890. this.appointParam.businessId = this.businesslist[0].businessId;
  891. await this.courseMajorList({
  892. businessId: res.rows[0].businessId,
  893. projectId: res.rows[0].projectId,
  894. status: 1,
  895. });
  896. resolve();
  897. });
  898. });
  899. },
  900. courseMajorList(data) {
  901. return new Promise((resolve) => {
  902. let self = this;
  903. this.$request.courseMajorList(data).then((res) => {
  904. if (res.code == 200) {
  905. self.sList = res.rows;
  906. let allItem = { id: "", categoryName: "全部" };
  907. self.sList.unshift(allItem);
  908. this.appointParam.majorId = "";
  909. resolve();
  910. }
  911. });
  912. });
  913. },
  914. examCurrentChange(e) {
  915. this.examParam.pageNum = e;
  916. this.mockSubscribeListSubscribe();
  917. },
  918. appointParamCurrentChange(e) {
  919. this.appointParam.pageNum = e;
  920. this.mockApplyListApply();
  921. },
  922. liveParamCurrentChange(e) {
  923. this.liveParam.pageNum = e;
  924. this.mockLiveListApplyName();
  925. },
  926. async tabChange(e) {
  927. if (this.activeName == e.name) {
  928. return;
  929. }
  930. this.formData.pageNum = 1;
  931. this.activeName = e.name;
  932. if (this.activeName == "1") {
  933. this.mockSubscribeListSubscribe();
  934. return;
  935. }
  936. if (this.activeName == "2") {
  937. await this.mockApplyListApplyBusiness();
  938. this.mockApplyListApply();
  939. return;
  940. }
  941. if (this.activeName == "3") {
  942. this.mockApplyListMockLive();
  943. return;
  944. }
  945. },
  946. mockSubscribeListSubscribe() {
  947. let examParam = JSON.parse(JSON.stringify(this.examParam));
  948. if (examParam.dateRange && examParam.dateRange[0]) {
  949. examParam.startTime = examParam.dateRange[0].toString().substr(0, 10);
  950. }
  951. if (examParam.dateRange && examParam.dateRange[1]) {
  952. examParam.endTime = examParam.dateRange[1].toString().substr(0, 10);
  953. }
  954. if (this.listApplyName.length) {
  955. examParam.applyName = this.listApplyName.find(
  956. (item) => examParam.applyName == item.applyId
  957. )
  958. ? this.listApplyName.find(
  959. (item) => examParam.applyName == item.applyId
  960. ).applyName
  961. : "";
  962. }
  963. this.$request.mockSubscribeListSubscribe(examParam).then((res) => {
  964. this.examList = res.rows;
  965. this.examParam.total = res.total;
  966. });
  967. },
  968. async mockApplyListApply() {
  969. let appointParam = JSON.parse(JSON.stringify(this.appointParam));
  970. if (appointParam.dateRange && appointParam.dateRange[0]) {
  971. appointParam.startTime = appointParam.dateRange[0]
  972. .toString()
  973. .substr(0, 10);
  974. }
  975. if (appointParam.dateRange && appointParam.dateRange[1]) {
  976. appointParam.endTime = appointParam.dateRange[1]
  977. .toString()
  978. .substr(0, 10);
  979. }
  980. this.setSystemTime();
  981. this.$request.mockApplyListApply(appointParam).then((res) => {
  982. this.mockList = res.rows;
  983. this.appointParam.total = res.total;
  984. });
  985. },
  986. mockApplyListMockLive() {
  987. let liveParam = JSON.parse(JSON.stringify(this.liveParam));
  988. if (liveParam.dateRange && liveParam.dateRange[0]) {
  989. liveParam.startTime = liveParam.dateRange[0].toString().substr(0, 10);
  990. }
  991. if (liveParam.dateRange && liveParam.dateRange[1]) {
  992. liveParam.endTime = liveParam.dateRange[1].toString().substr(0, 10);
  993. }
  994. if (this.listLiveName.length) {
  995. liveParam.applyName = this.listLiveName.find(
  996. (item) => liveParam.applyName == item.applyId
  997. )
  998. ? this.listLiveName.find(
  999. (item) => liveParam.applyName == item.applyId
  1000. ).applyName
  1001. : "";
  1002. }
  1003. this.$request.mockApplyListMockLive(liveParam).then((res) => {
  1004. this.liveList = res.rows;
  1005. this.liveParam.total = res.total;
  1006. });
  1007. },
  1008. stateChange(state) {
  1009. this.examParam.mockStatus = state;
  1010. this.mockSubscribeListSubscribe();
  1011. },
  1012. },
  1013. };
  1014. </script>
  1015. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1016. <style scoped lang="scss">
  1017. .my-order {
  1018. &__header {
  1019. /deep/ .el-tabs__header {
  1020. margin-bottom: 0;
  1021. }
  1022. .label {
  1023. padding: 0 30px !important;
  1024. }
  1025. }
  1026. &__body {
  1027. .mock-list {
  1028. &__header {
  1029. .tabs {
  1030. padding: 14px 0;
  1031. .tab {
  1032. cursor: pointer;
  1033. display: inline-block;
  1034. padding: 0 50px;
  1035. position: relative;
  1036. color: #666666;
  1037. &.active {
  1038. color: #3f8dfd;
  1039. }
  1040. }
  1041. }
  1042. }
  1043. &__body {
  1044. .selects {
  1045. margin-top: 15px;
  1046. display: flex;
  1047. .item {
  1048. flex: 1;
  1049. padding: 0 10px;
  1050. .text {
  1051. margin-top: 10px;
  1052. float: left;
  1053. width: 60px;
  1054. font-size: 14px;
  1055. font-family: Microsoft YaHei;
  1056. font-weight: 400;
  1057. color: #666666;
  1058. }
  1059. .select {
  1060. margin-left: 60px;
  1061. .el-select,
  1062. .el-input {
  1063. width: 100%;
  1064. }
  1065. }
  1066. }
  1067. }
  1068. .list {
  1069. margin-top: 20px;
  1070. .mock-item {
  1071. margin-top: 20px;
  1072. border: 1px solid #eeeeee;
  1073. box-shadow: 0px 0px 7px 1px rgba(0, 0, 0, 0.04);
  1074. border-radius: 8px;
  1075. &__header {
  1076. padding: 0 20px;
  1077. height: 48px;
  1078. display: flex;
  1079. align-items: center;
  1080. .title {
  1081. flex: 1;
  1082. font-size: 16px;
  1083. font-family: Microsoft YaHei;
  1084. font-weight: bold;
  1085. color: #333333;
  1086. }
  1087. .time {
  1088. font-size: 12px;
  1089. font-family: Microsoft YaHei;
  1090. font-weight: 400;
  1091. color: #666666;
  1092. }
  1093. }
  1094. &__body {
  1095. border-top: 1px solid #eee;
  1096. display: flex;
  1097. .content {
  1098. height: 160px;
  1099. padding: 16px;
  1100. flex: 1;
  1101. .item {
  1102. padding: 4px 0;
  1103. &__left {
  1104. width: 80px;
  1105. display: inline-block;
  1106. vertical-align: middle;
  1107. font-size: 16px;
  1108. font-family: Microsoft YaHei;
  1109. font-weight: 400;
  1110. color: #333333;
  1111. }
  1112. &__right {
  1113. vertical-align: middle;
  1114. font-size: 16px;
  1115. font-family: Microsoft YaHei;
  1116. font-weight: 400;
  1117. color: #666666;
  1118. }
  1119. }
  1120. }
  1121. .btn-wrap {
  1122. border-left: 1px solid #eee;
  1123. width: 154px;
  1124. height: 160px;
  1125. display: flex;
  1126. padding-top: 60px;
  1127. justify-content: center;
  1128. &--over {
  1129. width: 568px;
  1130. }
  1131. .btn-item {
  1132. width: 200px;
  1133. margin: 0 5px;
  1134. text-align: center;
  1135. }
  1136. .btn {
  1137. width: 122px;
  1138. height: 32px;
  1139. padding: 0;
  1140. line-height: 32px;
  1141. border-radius: 16px;
  1142. text-align: center;
  1143. margin: 0 5px;
  1144. }
  1145. .text {
  1146. text-align: center;
  1147. color: #999999;
  1148. &.red {
  1149. color: #f5222d;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. &__footer {
  1155. border-top: 1px solid #eee;
  1156. height: 64px;
  1157. padding: 0 20px;
  1158. display: flex;
  1159. align-items: center;
  1160. .text {
  1161. font-size: 16px;
  1162. font-family: Microsoft YaHei;
  1163. font-weight: 400;
  1164. color: #333333;
  1165. flex: 1;
  1166. }
  1167. .btn {
  1168. width: 122px;
  1169. height: 32px;
  1170. border-radius: 16px;
  1171. padding: 0;
  1172. line-height: 32px;
  1173. text-align: center;
  1174. }
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. .live-list {
  1181. .live-item {
  1182. cursor: pointer;
  1183. float: left;
  1184. margin-top: 86px;
  1185. margin-right: 24px;
  1186. width: 240px;
  1187. height: 140px;
  1188. background: #ffffff;
  1189. box-shadow: 0px 3px 6px 0px rgba(213, 218, 224, 0.8);
  1190. border-radius: 10px;
  1191. position: relative;
  1192. padding: 62px 8px 0;
  1193. &__header {
  1194. position: absolute;
  1195. left: 8px;
  1196. top: -62px;
  1197. width: 224px;
  1198. height: 125px;
  1199. background: #333333;
  1200. border-radius: 8px;
  1201. .img {
  1202. width: 100%;
  1203. height: 100%;
  1204. }
  1205. .note {
  1206. width: 80px;
  1207. height: 24px;
  1208. display: flex;
  1209. align-items: center;
  1210. justify-content: center;
  1211. color: #fff;
  1212. background: #9254de;
  1213. border-radius: 8px 0px 8px 0px;
  1214. position: absolute;
  1215. left: 0;
  1216. top: 0;
  1217. img {
  1218. margin-right: 5px;
  1219. }
  1220. &--blue {
  1221. background: #3f8dfd;
  1222. }
  1223. &--green {
  1224. background: #36cfc9;
  1225. }
  1226. &--gray {
  1227. background: #999999;
  1228. }
  1229. }
  1230. }
  1231. &__body {
  1232. .title {
  1233. margin-top: 12px;
  1234. font-size: 14px;
  1235. font-family: Microsoft YaHei;
  1236. font-weight: 400;
  1237. color: #333333;
  1238. }
  1239. .desc {
  1240. margin-top: 5px;
  1241. font-size: 14px;
  1242. font-family: Microsoft YaHei;
  1243. font-weight: 400;
  1244. color: #999999;
  1245. }
  1246. }
  1247. }
  1248. }
  1249. .no-data {
  1250. text-align: center;
  1251. padding: 50px 0;
  1252. color: #666;
  1253. font-size: 16px;
  1254. }
  1255. .pagination {
  1256. padding: 30px 0;
  1257. text-align: center;
  1258. }
  1259. }
  1260. .appoint-modal {
  1261. /deep/ .el-dialog__header {
  1262. display: none;
  1263. }
  1264. /deep/ .el-dialog__body {
  1265. padding: 0;
  1266. overflow: unset;
  1267. }
  1268. &__content {
  1269. height: 452px;
  1270. position: relative;
  1271. padding-top: 120px;
  1272. .img {
  1273. width: 196px;
  1274. position: absolute;
  1275. left: 50%;
  1276. top: -54px;
  1277. margin-left: -98px;
  1278. }
  1279. .title {
  1280. text-align: center;
  1281. font-size: 16px;
  1282. font-family: Microsoft YaHei;
  1283. font-weight: bold;
  1284. color: #333333;
  1285. }
  1286. .content {
  1287. padding: 24px;
  1288. font-size: 16px;
  1289. font-family: Microsoft YaHei;
  1290. font-weight: 400;
  1291. color: #666666;
  1292. line-height: 24px;
  1293. .item {
  1294. line-height: 30px;
  1295. &__left {
  1296. font-size: 16px;
  1297. color: #333;
  1298. }
  1299. &__right {
  1300. font-size: 16px;
  1301. color: #666;
  1302. }
  1303. }
  1304. .btn {
  1305. display: block;
  1306. margin: 20px auto;
  1307. width: 200px;
  1308. height: 40px;
  1309. border-radius: 8px;
  1310. line-height: 40px;
  1311. padding: 0;
  1312. text-align: center;
  1313. }
  1314. }
  1315. }
  1316. }
  1317. }
  1318. </style>