exam_appointment.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. <template>
  2. <view>
  3. <nav-bar title="考试预约"></nav-bar>
  4. <view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
  5. <u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF" inactive-color="#999"></u-tabs>
  6. </view>
  7. <view class="safeArea" style="position: absolute;top: 288rpx;width: 100%;">
  8. <view class="examMain">
  9. <view class="noData" v-if="!listData.length">您暂无相关考试预约哦~</view>
  10. <view v-for="(item, index) in listData" :key="index" class="examList">
  11. <view class="time">{{ $method.timestampToTime(item.createTime, false) }}</view>
  12. <view class="main">
  13. <view class="top" @click="showDetails(item)">
  14. <view class="subject">{{ item.goodsName }}</view>
  15. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  16. </view>
  17. <view class="item">
  18. <view class="left">报考专业</view>
  19. <view class="right" v-if="item.categoryName">{{ item.categoryName }}专业</view>
  20. </view>
  21. <view class="item">
  22. <view class="left">考试地点</view>
  23. <view class="right">{{ item.applySiteAddress || '' }}</view>
  24. </view>
  25. <view class="item">
  26. <view class="left">考试时间</view>
  27. <view class="right">
  28. {{ $method.timestampToTime(item.applySiteExamTime) }} {{ item.applySiteStartTime }} ~
  29. {{ item.applySiteEndTime }}
  30. </view>
  31. </view>
  32. <view class="item" v-if="item.applySiteAddressTrain">
  33. <view class="left">考前培训地点</view>
  34. <view class="right">{{ item.applySiteAddressTrain }}</view>
  35. </view>
  36. <view class="item" v-if="item.applySiteExamTrainTime && item.applySiteStartTrainTime && item.applySiteEndTrainTime">
  37. <view class="left">考前培训时间</view>
  38. <view class="right">
  39. {{ $method.timestampToTime(item.applySiteExamTrainTime) }} {{ item.applySiteStartTrainTime }} ~
  40. {{ item.applySiteEndTrainTime }}
  41. </view>
  42. </view>
  43. <view class="item">
  44. <view class="left">准考证号</view>
  45. <view class="right">
  46. {{ item.examineeCode || '' }}
  47. </view>
  48. </view>
  49. <!-- fromPlat:1云学堂 2智慧考场 -->
  50. <view v-if="item.fromPlat == 2" class="item">
  51. <view class="left">座位号</view>
  52. <view class="right">
  53. {{ item.seatNumber || '' }}
  54. </view>
  55. </view>
  56. <!-- applyReportStatus是否显示签署承诺书 1是,0否 v-if="item.applyReportStatus == 0"-->
  57. <view v-if="item.applyReportStatus == 1" class="item" @click="toSign(item)">
  58. <view class="left">疫情防控承诺书</view>
  59. <view class="right unSign" >
  60. {{ item.reportStatus == 1 ? '已签署' : item.reportStatus == 0 ? '未签署' : '' }}
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 弹框 考试详情-->
  68. <u-popup v-model="details_show" mode="center" class="detailsModel">
  69. <view class="detailsBox">
  70. <view class="time">{{ $method.timestampToTime(activeList.createTime, false) }}</view>
  71. <view class="boxItem border">
  72. <view class="title">报考学员信息</view>
  73. <view class="item">
  74. 姓名:
  75. <text class="val">{{ activeList.realname }}</text>
  76. </view>
  77. <view class="item">
  78. 身份证:
  79. <text class="val">{{ activeList.idCard }}</text>
  80. </view>
  81. <view class="item">
  82. 考试身份:
  83. <text class="val">{{ activeList.studentType == 1 ? '非补考学员' : activeList.studentType == 2 ? '补考学员' : '' }}</text>
  84. </view>
  85. </view>
  86. <view class="boxItem border">
  87. <view class="title">考试预约信息</view>
  88. <view class="item">
  89. 考试标题:
  90. <text class="val">{{ activeList.applyName }}</text>
  91. </view>
  92. <view class="item">
  93. 报名开放时间:
  94. <text class="val">{{ $method.timestampToTime(activeList.applyStartTime) }} ~ {{ $method.timestampToTime(activeList.applyEndTime) }}</text>
  95. </view>
  96. <view class="item">
  97. 报考专业:
  98. <text class="val">{{ activeList.categoryName || ''}}</text>
  99. </view>
  100. <view class="item">
  101. 考试地点:
  102. <!-- activeList.seatNumber 有座位号就显示roomAddress,否则显示applySiteAddress -->
  103. <text class="val">{{ activeList.seatNumber ? (activeList.roomAddress || '') : (activeList.applySiteAddress || '') }}</text>
  104. </view>
  105. <view class="item">
  106. 考试时间:
  107. <text class="val">
  108. {{
  109. $method.timestampToTime(activeList.applySiteExamTime) +
  110. ' ' +
  111. activeList.applySiteStartTime +
  112. '~' +
  113. activeList.applySiteEndTime
  114. }}
  115. </text>
  116. </view>
  117. <view class="item">
  118. 准考证号:
  119. <text class="val">
  120. {{ activeList.examineeCode || '' }}
  121. </text>
  122. </view>
  123. <view v-if="activeList.fromPlat == 2" class="item">
  124. 座位号:
  125. <text class="val">
  126. {{ activeList.seatNumber || '' }}
  127. </text>
  128. </view>
  129. <view class="item" v-if="activeList.applySiteAddressTrain">
  130. 考前培训地点:
  131. <text class="val">{{ activeList.applySiteAddressTrain }}</text>
  132. </view>
  133. <view class="item" v-if="activeList.applySiteExamTrainTime && activeList.applySiteStartTrainTime && activeList.applySiteEndTrainTime">
  134. 考前培训时间:
  135. <text class="val">
  136. {{
  137. $method.timestampToTime(activeList.applySiteExamTrainTime) +
  138. ' ' +
  139. activeList.applySiteStartTrainTime +
  140. '~' +
  141. activeList.applySiteEndTrainTime
  142. }}
  143. </text>
  144. </view>
  145. </view>
  146. <view class="boxItem border">
  147. <view class="title">考试成绩和证书信息</view>
  148. <view class="item">
  149. 考试成绩:
  150. <text class="val">{{ activeList.performance || '-' }}分</text>
  151. </view>
  152. <view class="item">
  153. 考试结果:
  154. <text class="val">{{ activeList.syncExamResult || '' }}</text>
  155. </view>
  156. </view>
  157. <u-line color="#EEEEEE" />
  158. <view class="foot" v-if="activeList.subscribeStatus === 1">
  159. <view class="btn" @click="hideModel">知道了</view>
  160. <view class="btn cancel" v-if="isShowFun(activeList)" @click="cancelBtn">取消预约</view>
  161. </view>
  162. <view class="foot" v-else><view class="abtns" @click="hideModel">知道了</view></view>
  163. </view>
  164. </u-popup>
  165. <!-- 弹框 取消预约-->
  166. <u-popup v-model="cancel_show" mode="center" class="detailsModel">
  167. <view class="tipBox">
  168. <view class="title">温馨提示</view>
  169. <view class="main">
  170. <view class="item">每次考试均有名额限制,</view>
  171. <view class="item">取消预约后,您可能无法再次预约本次考试。</view>
  172. <view class="item">请慎重考虑。</view>
  173. <view class="item">您确定要取消本次考试预约吗?。</view>
  174. </view>
  175. <view class="btn">
  176. <view class="btn1 cancel" @click="cancel_show = false">取消</view>
  177. <view class="btn1 submit" @click="submit">确定</view>
  178. </view>
  179. </view>
  180. </u-popup>
  181. </view>
  182. </template>
  183. <script>
  184. import { mapGetters,mapActions } from 'vuex';
  185. export default {
  186. data() {
  187. return {
  188. details_show: false,
  189. cancel_show: false,
  190. list: [
  191. {
  192. name: '已预约'
  193. },
  194. {
  195. name: '已取消'
  196. },
  197. {
  198. name: '已过期'
  199. }
  200. ],
  201. listData: [],
  202. current: 0,
  203. activeList: {
  204. applySiteStartTime: '',
  205. applySiteEndTime: '',
  206. applySiteStartTrainTime: '',
  207. applySiteEndTrainTime: ''
  208. },
  209. paramCount: '',
  210. };
  211. },
  212. onPullDownRefresh() {},
  213. onLoad(option) {
  214. option.current && (this.paramCount = option.current)
  215. },
  216. onShow() {
  217. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  218. return;
  219. }
  220. this.setSystemTime()
  221. if (String(this.paramCount)) {
  222. console.log('公众号', this.paramCount)
  223. this.current = +this.paramCount
  224. this.change(+this.paramCount)
  225. return
  226. }
  227. this.$api.getApplylist({ subscribeStatus: 1, exceedExamExpend: 2 }).then(res => {
  228. if (res.data.code === 200) {
  229. this.listData = res.data.rows;
  230. }
  231. });
  232. /* if(this.current === 2 && this.$method.isLogin()){
  233. this.$refs.refMy.init();
  234. } */
  235. },
  236. onShareAppMessage(res) {
  237. var self = this;
  238. return {
  239. title: '中正',
  240. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  241. };
  242. },
  243. methods: {
  244. ...mapActions(['setSystemTime']),
  245. toSign(item) {
  246. console.log('item', item)
  247. uni.navigateTo({
  248. url: '/pages2/exam/signCommit?reportStatus=' + item.reportStatus + '&reportFile=' + item.reportFile + '&subscribeId=' + item.subscribeId +
  249. '&phone=' + item.telphone
  250. })
  251. },
  252. isShowFun(times) {
  253. // var timestamp = parseInt(new Date().getTime() / 1000);
  254. var newDataAge = parseInt(new Date(new Date(this.sysTime*1000).toLocaleDateString()).getTime() / 1000);
  255. //报名开放时间”过了“结束时间点”,【取消预约】按钮隐藏
  256. if (times.applyEndTime <= this.sysTime) {
  257. return false;
  258. } else {
  259. //报名开放时间-进行中,【前培标记:已开通】,【取消预约】按钮隐藏
  260. if (times.beforeStatus === 1) {
  261. console.log(1);
  262. return false;
  263. } else if (times.examStatus !== 0) {
  264. console.log(2);
  265. return false;
  266. } else if (times.applySiteExamTime < newDataAge) {
  267. console.log(3);
  268. return false;
  269. } else if (times.applySiteExamTime > newDataAge) {
  270. console.log(4);
  271. return true;
  272. } else if (times.applySiteExamTime == newDataAge) {
  273. console.log(5);
  274. var hours = new Date(this.sysTime*1000).getHours();
  275. var mins = new Date(this.sysTime*1000).getMinutes();
  276. var arrays = times.applySiteStartTime.split(':').map(Number);
  277. if (arrays[0] > hours) {
  278. return true;
  279. } else if (arrays[0] < hours) {
  280. return false;
  281. } else {
  282. if (arrays[1] <= mins) {
  283. return false;
  284. } else {
  285. return true;
  286. }
  287. }
  288. } else {
  289. return true;
  290. }
  291. }
  292. },
  293. showDetails(item) {
  294. this.activeList = JSON.parse(JSON.stringify(item));
  295. this.details_show = true;
  296. },
  297. cancelBtn() {
  298. this.cancel_show = true;
  299. },
  300. hideModel() {
  301. this.details_show = false;
  302. },
  303. submit() {
  304. var bols = this.isShowFun(this.activeList);
  305. if (!bols) {
  306. uni.showToast({
  307. icon: 'none',
  308. title: '当前已无法取消预约'
  309. });
  310. return;
  311. }
  312. this.$api
  313. .editApply({
  314. subscribeId: this.activeList.subscribeId,
  315. subscribeStatus: 2
  316. })
  317. .then(res => {
  318. if (res.data.code === 200) {
  319. this.cancel_show = false;
  320. this.details_show = false;
  321. this.$api.getApplylist({ subscribeStatus: 1, exceedExamExpend: 2 }).then(res => {
  322. this.listData = res.data.rows;
  323. this.setSystemTime()
  324. });
  325. }
  326. });
  327. },
  328. change(index) {
  329. // if (this.current === index) {
  330. // return;
  331. // }
  332. this.current = index;
  333. var data = {};
  334. if (index === 0) {
  335. data = {
  336. subscribeStatus: 1,
  337. exceedExamExpend: 2
  338. };
  339. }
  340. if (index === 1) {
  341. data = {
  342. subscribeStatus: 2
  343. };
  344. }
  345. if (index === 2) {
  346. data = {
  347. subscribeStatus: 1,
  348. exceedExamExpend: 1
  349. };
  350. }
  351. // apply/list
  352. this.$api.getApplylist(data).then(res => {
  353. if (res.data.code === 200) {
  354. this.listData = res.data.rows;
  355. }
  356. });
  357. }
  358. },
  359. onReachBottom() {},
  360. computed: { ...mapGetters(['userInfo','sysTime']) }
  361. };
  362. </script>
  363. <style>
  364. page {
  365. background: #eaeef1;
  366. }
  367. .detailsModel .u-mode-center-box {
  368. border-radius: 24rpx;
  369. }
  370. </style>
  371. <style scoped lang="scss">
  372. .noData {
  373. text-align: center;
  374. font-size: 32rpx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #999999;
  378. margin: 200rpx 0;
  379. }
  380. .examMain {
  381. padding: 8rpx;
  382. .time {
  383. text-align: center;
  384. font-size: 24rpx;
  385. font-family: PingFang SC;
  386. font-weight: 500;
  387. color: #999999;
  388. }
  389. .main {
  390. background: #ffffff;
  391. border-radius: 16rpx;
  392. margin: 20rpx 0;
  393. }
  394. .top {
  395. height: 103rpx;
  396. display: flex;
  397. justify-content: center;
  398. align-items: center;
  399. border-bottom: 1px solid #eeeeee;
  400. .subject {
  401. max-width: 514rpx;
  402. height: 40rpx;
  403. font-size: 30rpx;
  404. font-family: PingFang SC;
  405. font-weight: bold;
  406. color: #007aff;
  407. white-space: nowrap;
  408. overflow: hidden;
  409. text-overflow: ellipsis;
  410. }
  411. }
  412. .item {
  413. display: flex;
  414. justify-content: space-between;
  415. align-items: center;
  416. margin-left: 31rpx;
  417. height: 80rpx;
  418. padding-right: 24rpx;
  419. border-bottom: 1px solid #eeeeee;
  420. font-size: 24rpx;
  421. font-family: PingFang SC;
  422. font-weight: 500;
  423. color: #666666;
  424. .right {
  425. font-size: 30rpx;
  426. font-family: PingFang SC;
  427. font-weight: bold;
  428. }
  429. .unSign {
  430. text-decoration: underline;
  431. }
  432. }
  433. }
  434. .detailsBox {
  435. width: 640rpx;
  436. height: 1000rpx;
  437. background: #ffffff;
  438. border-radius: 24rpx;
  439. .time {
  440. margin: 32rpx 0;
  441. padding: 0 37rpx;
  442. font-size: 30rpx;
  443. font-family: PingFang SC;
  444. font-weight: bold;
  445. color: #333333;
  446. }
  447. .boxItem {
  448. margin-left: 36rpx;
  449. margin-bottom: 29rpx;
  450. &.border {
  451. border-bottom: 1px solid #eee;
  452. }
  453. .title {
  454. font-size: 24rpx;
  455. font-family: PingFang SC;
  456. font-weight: 500;
  457. color: #007aff;
  458. position: relative;
  459. &::before {
  460. content: '';
  461. width: 4rpx;
  462. height: 24rpx;
  463. background: #007aff;
  464. border-radius: 2rpx;
  465. position: absolute;
  466. top: 6rpx;
  467. left: -8rpx;
  468. }
  469. }
  470. .item {
  471. margin: 24rpx 0;
  472. font-size: 26rpx;
  473. font-family: PingFang SC;
  474. font-weight: 500;
  475. color: #999999;
  476. .val {
  477. color: #333333;
  478. }
  479. }
  480. }
  481. .foot {
  482. padding: 20rpx 40rpx;
  483. display: flex;
  484. justify-content: center;
  485. .btn {
  486. width: 200rpx;
  487. height: 80rpx;
  488. line-height: 80rpx;
  489. text-align: center;
  490. background: #f5f5f5;
  491. border-radius: 40rpx;
  492. font-size: 30rpx;
  493. font-family: PingFang SC;
  494. font-weight: bold;
  495. color: #007aff;
  496. &.cancel {
  497. background: #ff3b30;
  498. color: #ffffff;
  499. }
  500. }
  501. .abtns {
  502. width: 526rpx;
  503. height: 80rpx;
  504. line-height: 80rpx;
  505. text-align: center;
  506. background: #007aff;
  507. border-radius: 40rpx;
  508. font-size: 30rpx;
  509. font-family: PingFang SC;
  510. font-weight: bold;
  511. color: #fff;
  512. }
  513. }
  514. }
  515. .tipBox {
  516. width: 640rpx;
  517. padding: 30rpx 20rpx 40rpx;
  518. background: #ffffff;
  519. border-radius: 24rpx;
  520. font-family: PingFang SC;
  521. .title {
  522. text-align: center;
  523. font-size: 30rpx;
  524. font-weight: bold;
  525. color: #333333;
  526. margin-bottom: 40rpx;
  527. }
  528. .main {
  529. font-size: 30rpx;
  530. font-weight: 500;
  531. color: #666666;
  532. line-height: 48rpx;
  533. margin-bottom: 40rpx;
  534. }
  535. .btn {
  536. display: flex;
  537. justify-content: center;
  538. .btn1 {
  539. width: 200rpx;
  540. height: 80rpx;
  541. line-height: 80rpx;
  542. text-align: center;
  543. background: #f5f5f5;
  544. border-radius: 40px;
  545. font-size: 30rpx;
  546. font-weight: bold;
  547. color: #007aff;
  548. margin: 0 20rpx;
  549. &.submit {
  550. background: #007aff;
  551. color: #fff;
  552. }
  553. }
  554. }
  555. }
  556. </style>