exam_appointment.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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. <view class="item">
  50. <view class="left">座位号</view>
  51. <view class="right">
  52. {{ item.seatNumber || '' }}
  53. </view>
  54. </view>
  55. <!-- applyReportStatus是否需要签署承诺书 1是,0否 -->
  56. <view v-if="item.applyReportStatus == 1" class="item" @click="toSign(item)">
  57. <view class="left">疫情防控承诺书</view>
  58. <!-- :class="{unSign: item.reportStatus == 0}" -->
  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. <!-- fromPlat:1云学堂 2智慧考场 -->
  103. <text class="val">{{ activeList.fromPlat == 2 ? (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 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. if (String(this.paramCount)) {
  221. console.log('公众号', this.paramCount)
  222. this.current = +this.paramCount
  223. this.change(+this.paramCount)
  224. return
  225. }
  226. this.setSystemTime()
  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. console.log('----')
  333. this.current = index;
  334. var data = {};
  335. if (index === 0) {
  336. data = {
  337. subscribeStatus: 1,
  338. exceedExamExpend: 2
  339. };
  340. }
  341. if (index === 1) {
  342. data = {
  343. subscribeStatus: 2
  344. };
  345. }
  346. if (index === 2) {
  347. data = {
  348. subscribeStatus: 1,
  349. exceedExamExpend: 1
  350. };
  351. }
  352. // apply/list
  353. this.$api.getApplylist(data).then(res => {
  354. if (res.data.code === 200) {
  355. // this.listData = res.data.rows;
  356. this.listData = [1,2]
  357. }
  358. });
  359. }
  360. },
  361. onReachBottom() {},
  362. computed: { ...mapGetters(['userInfo','sysTime']) }
  363. };
  364. </script>
  365. <style>
  366. page {
  367. background: #eaeef1;
  368. }
  369. .detailsModel .u-mode-center-box {
  370. border-radius: 24rpx;
  371. }
  372. </style>
  373. <style scoped lang="scss">
  374. .noData {
  375. text-align: center;
  376. font-size: 32rpx;
  377. font-family: PingFang SC;
  378. font-weight: 500;
  379. color: #999999;
  380. margin: 200rpx 0;
  381. }
  382. .examMain {
  383. padding: 8rpx;
  384. .time {
  385. text-align: center;
  386. font-size: 24rpx;
  387. font-family: PingFang SC;
  388. font-weight: 500;
  389. color: #999999;
  390. }
  391. .main {
  392. background: #ffffff;
  393. border-radius: 16rpx;
  394. margin: 20rpx 0;
  395. }
  396. .top {
  397. height: 103rpx;
  398. display: flex;
  399. justify-content: center;
  400. align-items: center;
  401. border-bottom: 1px solid #eeeeee;
  402. .subject {
  403. max-width: 514rpx;
  404. height: 40rpx;
  405. font-size: 30rpx;
  406. font-family: PingFang SC;
  407. font-weight: bold;
  408. color: #007aff;
  409. white-space: nowrap;
  410. overflow: hidden;
  411. text-overflow: ellipsis;
  412. }
  413. }
  414. .item {
  415. display: flex;
  416. justify-content: space-between;
  417. align-items: center;
  418. margin-left: 31rpx;
  419. height: 80rpx;
  420. padding-right: 24rpx;
  421. border-bottom: 1px solid #eeeeee;
  422. font-size: 24rpx;
  423. font-family: PingFang SC;
  424. font-weight: 500;
  425. color: #666666;
  426. .right {
  427. font-size: 30rpx;
  428. font-family: PingFang SC;
  429. font-weight: bold;
  430. }
  431. .unSign {
  432. text-decoration: underline;
  433. }
  434. }
  435. }
  436. .detailsBox {
  437. width: 640rpx;
  438. height: 1000rpx;
  439. background: #ffffff;
  440. border-radius: 24rpx;
  441. .time {
  442. margin: 32rpx 0;
  443. padding: 0 37rpx;
  444. font-size: 30rpx;
  445. font-family: PingFang SC;
  446. font-weight: bold;
  447. color: #333333;
  448. }
  449. .boxItem {
  450. margin-left: 36rpx;
  451. margin-bottom: 29rpx;
  452. &.border {
  453. border-bottom: 1px solid #eee;
  454. }
  455. .title {
  456. font-size: 24rpx;
  457. font-family: PingFang SC;
  458. font-weight: 500;
  459. color: #007aff;
  460. position: relative;
  461. &::before {
  462. content: '';
  463. width: 4rpx;
  464. height: 24rpx;
  465. background: #007aff;
  466. border-radius: 2rpx;
  467. position: absolute;
  468. top: 6rpx;
  469. left: -8rpx;
  470. }
  471. }
  472. .item {
  473. margin: 24rpx 0;
  474. font-size: 26rpx;
  475. font-family: PingFang SC;
  476. font-weight: 500;
  477. color: #999999;
  478. .val {
  479. color: #333333;
  480. }
  481. }
  482. }
  483. .foot {
  484. padding: 20rpx 40rpx;
  485. display: flex;
  486. justify-content: center;
  487. .btn {
  488. width: 200rpx;
  489. height: 80rpx;
  490. line-height: 80rpx;
  491. text-align: center;
  492. background: #f5f5f5;
  493. border-radius: 40rpx;
  494. font-size: 30rpx;
  495. font-family: PingFang SC;
  496. font-weight: bold;
  497. color: #007aff;
  498. &.cancel {
  499. background: #ff3b30;
  500. color: #ffffff;
  501. }
  502. }
  503. .abtns {
  504. width: 526rpx;
  505. height: 80rpx;
  506. line-height: 80rpx;
  507. text-align: center;
  508. background: #007aff;
  509. border-radius: 40rpx;
  510. font-size: 30rpx;
  511. font-family: PingFang SC;
  512. font-weight: bold;
  513. color: #fff;
  514. }
  515. }
  516. }
  517. .tipBox {
  518. width: 640rpx;
  519. padding: 30rpx 20rpx 40rpx;
  520. background: #ffffff;
  521. border-radius: 24rpx;
  522. font-family: PingFang SC;
  523. .title {
  524. text-align: center;
  525. font-size: 30rpx;
  526. font-weight: bold;
  527. color: #333333;
  528. margin-bottom: 40rpx;
  529. }
  530. .main {
  531. font-size: 30rpx;
  532. font-weight: 500;
  533. color: #666666;
  534. line-height: 48rpx;
  535. margin-bottom: 40rpx;
  536. }
  537. .btn {
  538. display: flex;
  539. justify-content: center;
  540. .btn1 {
  541. width: 200rpx;
  542. height: 80rpx;
  543. line-height: 80rpx;
  544. text-align: center;
  545. background: #f5f5f5;
  546. border-radius: 40px;
  547. font-size: 30rpx;
  548. font-weight: bold;
  549. color: #007aff;
  550. margin: 0 20rpx;
  551. &.submit {
  552. background: #007aff;
  553. color: #fff;
  554. }
  555. }
  556. }
  557. }
  558. </style>