exam_appointment.vue 14 KB

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