exam_appointment.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  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.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">
  155. <!-- activeList.syncExamResult -->
  156. {{ activeList.result == 1 ? '通过' : activeList.result == 0 ? '未通过' : '-' }}
  157. </text>
  158. </view>
  159. </view>
  160. <u-line color="#EEEEEE" />
  161. <view class="foot" v-if="activeList.subscribeStatus === 1">
  162. <view class="btn" @click="hideModel">知道了</view>
  163. <view class="btn cancel" v-if="isShowFun(activeList)" @click="cancelBtn">取消预约</view>
  164. </view>
  165. <view class="foot" v-else><view class="abtns" @click="hideModel">知道了</view></view>
  166. </view>
  167. </u-popup>
  168. <!-- 弹框 取消预约-->
  169. <u-popup v-model="cancel_show" mode="center" class="detailsModel">
  170. <view class="tipBox">
  171. <view class="title">温馨提示</view>
  172. <view class="main">
  173. <view class="item">每次考试均有名额限制,</view>
  174. <view class="item">取消预约后,您可能无法再次预约本次考试。</view>
  175. <view class="item">请慎重考虑。</view>
  176. <view class="item">您确定要取消本次考试预约吗?。</view>
  177. </view>
  178. <view class="btn">
  179. <view class="btn1 cancel" @click="cancel_show = false">取消</view>
  180. <view class="btn1 submit" @click="submit">确定</view>
  181. </view>
  182. </view>
  183. </u-popup>
  184. </view>
  185. </template>
  186. <script>
  187. import { mapGetters,mapActions } from 'vuex';
  188. export default {
  189. data() {
  190. return {
  191. details_show: false,
  192. cancel_show: false,
  193. list: [
  194. {
  195. name: '已预约'
  196. },
  197. {
  198. name: '已取消'
  199. },
  200. {
  201. name: '已过期'
  202. }
  203. ],
  204. listData: [],
  205. current: 0,
  206. activeList: {
  207. applySiteStartTime: '',
  208. applySiteEndTime: '',
  209. applySiteStartTrainTime: '',
  210. applySiteEndTrainTime: ''
  211. },
  212. paramCount: '',
  213. };
  214. },
  215. onPullDownRefresh() {},
  216. onLoad(option) {
  217. option.current && (this.paramCount = option.current)
  218. },
  219. onShow() {
  220. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  221. return;
  222. }
  223. this.setSystemTime()
  224. if (String(this.paramCount)) {
  225. console.log('公众号', this.paramCount)
  226. this.current = +this.paramCount
  227. this.change(+this.paramCount)
  228. return
  229. }
  230. this.$api.getApplylist({ subscribeStatus: 1, exceedExamExpend: 2 }).then(res => {
  231. if (res.data.code === 200) {
  232. this.listData = res.data.rows;
  233. }
  234. });
  235. /* if(this.current === 2 && this.$method.isLogin()){
  236. this.$refs.refMy.init();
  237. } */
  238. },
  239. onShareAppMessage(res) {
  240. var self = this;
  241. return {
  242. title: '中正',
  243. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  244. };
  245. },
  246. methods: {
  247. ...mapActions(['setSystemTime']),
  248. toSign(item) {
  249. console.log('item', item)
  250. uni.navigateTo({
  251. url: '/pages2/exam/signCommit?reportStatus=' + item.reportStatus + '&reportFile=' + item.reportFile + '&subscribeId=' + item.subscribeId +
  252. '&phone=' + item.telphone
  253. })
  254. },
  255. isShowFun(times) {
  256. // var timestamp = parseInt(new Date().getTime() / 1000);
  257. var newDataAge = parseInt(new Date(new Date(this.sysTime*1000).toLocaleDateString()).getTime() / 1000);
  258. //报名开放时间”过了“结束时间点”,【取消预约】按钮隐藏
  259. if (times.applyEndTime <= this.sysTime) {
  260. return false;
  261. } else {
  262. //报名开放时间-进行中,【前培标记:已开通】,【取消预约】按钮隐藏
  263. if (times.beforeStatus === 1) {
  264. console.log(1);
  265. return false;
  266. } else if (times.examStatus !== 0) {
  267. console.log(2);
  268. return false;
  269. } else if (times.applySiteExamTime < newDataAge) {
  270. console.log(3);
  271. return false;
  272. } else if (times.applySiteExamTime > newDataAge) {
  273. console.log(4);
  274. return true;
  275. } else if (times.applySiteExamTime == newDataAge) {
  276. console.log(5);
  277. var hours = new Date(this.sysTime*1000).getHours();
  278. var mins = new Date(this.sysTime*1000).getMinutes();
  279. var arrays = times.applySiteStartTime.split(':').map(Number);
  280. if (arrays[0] > hours) {
  281. return true;
  282. } else if (arrays[0] < hours) {
  283. return false;
  284. } else {
  285. if (arrays[1] <= mins) {
  286. return false;
  287. } else {
  288. return true;
  289. }
  290. }
  291. } else {
  292. return true;
  293. }
  294. }
  295. },
  296. showDetails(item) {
  297. this.activeList = JSON.parse(JSON.stringify(item));
  298. this.details_show = true;
  299. },
  300. cancelBtn() {
  301. this.cancel_show = true;
  302. },
  303. hideModel() {
  304. this.details_show = false;
  305. },
  306. submit() {
  307. var bols = this.isShowFun(this.activeList);
  308. if (!bols) {
  309. uni.showToast({
  310. icon: 'none',
  311. title: '当前已无法取消预约'
  312. });
  313. return;
  314. }
  315. this.$api
  316. .editApply({
  317. subscribeId: this.activeList.subscribeId,
  318. subscribeStatus: 2
  319. })
  320. .then(res => {
  321. if (res.data.code === 200) {
  322. this.cancel_show = false;
  323. this.details_show = false;
  324. this.$api.getApplylist({ subscribeStatus: 1, exceedExamExpend: 2 }).then(res => {
  325. this.listData = res.data.rows;
  326. this.setSystemTime()
  327. });
  328. }
  329. });
  330. },
  331. change(index) {
  332. // if (this.current === index) {
  333. // return;
  334. // }
  335. this.current = index;
  336. var data = {};
  337. if (index === 0) {
  338. data = {
  339. subscribeStatus: 1,
  340. exceedExamExpend: 2
  341. };
  342. }
  343. if (index === 1) {
  344. data = {
  345. subscribeStatus: 2
  346. };
  347. }
  348. if (index === 2) {
  349. data = {
  350. subscribeStatus: 1,
  351. exceedExamExpend: 1
  352. };
  353. }
  354. // apply/list
  355. this.$api.getApplylist(data).then(res => {
  356. if (res.data.code === 200) {
  357. this.listData = res.data.rows;
  358. }
  359. });
  360. }
  361. },
  362. onReachBottom() {},
  363. computed: { ...mapGetters(['userInfo','sysTime']) }
  364. };
  365. </script>
  366. <style>
  367. page {
  368. background: #eaeef1;
  369. }
  370. .detailsModel .u-mode-center-box {
  371. border-radius: 24rpx;
  372. }
  373. </style>
  374. <style scoped lang="scss">
  375. .noData {
  376. text-align: center;
  377. font-size: 32rpx;
  378. font-family: PingFang SC;
  379. font-weight: 500;
  380. color: #999999;
  381. margin: 200rpx 0;
  382. }
  383. .examMain {
  384. padding: 8rpx;
  385. .time {
  386. text-align: center;
  387. font-size: 24rpx;
  388. font-family: PingFang SC;
  389. font-weight: 500;
  390. color: #999999;
  391. }
  392. .main {
  393. background: #ffffff;
  394. border-radius: 16rpx;
  395. margin: 20rpx 0;
  396. }
  397. .top {
  398. height: 103rpx;
  399. display: flex;
  400. justify-content: center;
  401. align-items: center;
  402. border-bottom: 1px solid #eeeeee;
  403. .subject {
  404. max-width: 514rpx;
  405. height: 40rpx;
  406. font-size: 30rpx;
  407. font-family: PingFang SC;
  408. font-weight: bold;
  409. color: #007aff;
  410. white-space: nowrap;
  411. overflow: hidden;
  412. text-overflow: ellipsis;
  413. }
  414. }
  415. .item {
  416. display: flex;
  417. justify-content: space-between;
  418. align-items: center;
  419. margin-left: 31rpx;
  420. height: 80rpx;
  421. padding-right: 24rpx;
  422. border-bottom: 1px solid #eeeeee;
  423. font-size: 24rpx;
  424. font-family: PingFang SC;
  425. font-weight: 500;
  426. color: #666666;
  427. .right {
  428. font-size: 30rpx;
  429. font-family: PingFang SC;
  430. font-weight: bold;
  431. }
  432. .unSign {
  433. text-decoration: underline;
  434. }
  435. }
  436. }
  437. .detailsBox {
  438. width: 640rpx;
  439. height: 1000rpx;
  440. background: #ffffff;
  441. border-radius: 24rpx;
  442. .time {
  443. margin: 32rpx 0;
  444. padding: 0 37rpx;
  445. font-size: 30rpx;
  446. font-family: PingFang SC;
  447. font-weight: bold;
  448. color: #333333;
  449. }
  450. .boxItem {
  451. margin-left: 36rpx;
  452. margin-bottom: 29rpx;
  453. &.border {
  454. border-bottom: 1px solid #eee;
  455. }
  456. .title {
  457. font-size: 24rpx;
  458. font-family: PingFang SC;
  459. font-weight: 500;
  460. color: #007aff;
  461. position: relative;
  462. &::before {
  463. content: '';
  464. width: 4rpx;
  465. height: 24rpx;
  466. background: #007aff;
  467. border-radius: 2rpx;
  468. position: absolute;
  469. top: 6rpx;
  470. left: -8rpx;
  471. }
  472. }
  473. .item {
  474. margin: 24rpx 0;
  475. font-size: 26rpx;
  476. font-family: PingFang SC;
  477. font-weight: 500;
  478. color: #999999;
  479. .val {
  480. color: #333333;
  481. }
  482. }
  483. }
  484. .foot {
  485. padding: 20rpx 40rpx;
  486. display: flex;
  487. justify-content: center;
  488. .btn {
  489. width: 200rpx;
  490. height: 80rpx;
  491. line-height: 80rpx;
  492. text-align: center;
  493. background: #f5f5f5;
  494. border-radius: 40rpx;
  495. font-size: 30rpx;
  496. font-family: PingFang SC;
  497. font-weight: bold;
  498. color: #007aff;
  499. &.cancel {
  500. background: #ff3b30;
  501. color: #ffffff;
  502. }
  503. }
  504. .abtns {
  505. width: 526rpx;
  506. height: 80rpx;
  507. line-height: 80rpx;
  508. text-align: center;
  509. background: #007aff;
  510. border-radius: 40rpx;
  511. font-size: 30rpx;
  512. font-family: PingFang SC;
  513. font-weight: bold;
  514. color: #fff;
  515. }
  516. }
  517. }
  518. .tipBox {
  519. width: 640rpx;
  520. padding: 30rpx 20rpx 40rpx;
  521. background: #ffffff;
  522. border-radius: 24rpx;
  523. font-family: PingFang SC;
  524. .title {
  525. text-align: center;
  526. font-size: 30rpx;
  527. font-weight: bold;
  528. color: #333333;
  529. margin-bottom: 40rpx;
  530. }
  531. .main {
  532. font-size: 30rpx;
  533. font-weight: 500;
  534. color: #666666;
  535. line-height: 48rpx;
  536. margin-bottom: 40rpx;
  537. }
  538. .btn {
  539. display: flex;
  540. justify-content: center;
  541. .btn1 {
  542. width: 200rpx;
  543. height: 80rpx;
  544. line-height: 80rpx;
  545. text-align: center;
  546. background: #f5f5f5;
  547. border-radius: 40px;
  548. font-size: 30rpx;
  549. font-weight: bold;
  550. color: #007aff;
  551. margin: 0 20rpx;
  552. &.submit {
  553. background: #007aff;
  554. color: #fff;
  555. }
  556. }
  557. }
  558. }
  559. </style>