exam_result.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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: 280rpx;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">{{ 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">
  33. <view class="left">考试成绩</view>
  34. <view class="right">{{ item.performance }}分</view>
  35. </view>
  36. <view class="item">
  37. <view class="left">考试结果</view>
  38. <view class="right pass" v-if="item.result === 1">通过</view>
  39. <view class="right nopass" v-if="item.result === 0">未通过</view>
  40. </view>
  41. <view class="item" v-if="item.result === 1">
  42. <view class="left">证书编号</view>
  43. <view class="right">{{ item.certificateCode }}</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 弹框 考试详情-->
  50. <u-popup v-model="details_show" mode="center" class="detailsModel">
  51. <view class="detailsBox">
  52. <view class="time">{{ $method.timestampToTime(activeList.createTime, false) }}</view>
  53. <view class="boxItem border">
  54. <view class="title">报考学员信息</view>
  55. <view class="item">
  56. 姓名:
  57. <text class="val">{{ activeList.realname }}</text>
  58. </view>
  59. <view class="item">
  60. 身份证:
  61. <text class="val">{{ activeList.idCard }}</text>
  62. </view>
  63. <view class="item">
  64. 考试身份:
  65. <text class="val">{{ activeList.studentType == 1 ? '非补考学员' : activeList.studentType == 2 ? '补考学员' : '' }}</text>
  66. </view>
  67. </view>
  68. <view class="boxItem">
  69. <view class="title">考试预约信息</view>
  70. <view class="item">
  71. 考试标题:
  72. <text class="val">{{ activeList.applyName }}</text>
  73. </view>
  74. <view class="item">
  75. 报名开放时间:
  76. <text class="val">{{ $method.timestampToTime(activeList.applyStartTime) }} ~ {{ $method.timestampToTime(activeList.applyEndTime) }}</text>
  77. </view>
  78. <view class="item">
  79. 报考专业:
  80. <text class="val">{{ activeList.categoryName }}</text>
  81. </view>
  82. <view class="item">
  83. 考试地点:
  84. <text class="val">{{ activeList.applySiteAddress }}</text>
  85. </view>
  86. <view class="item">
  87. 考试时间:
  88. <text class="val">{{
  89. $method.timestampToTime(activeList.applySiteExamTime) +
  90. ' ' +
  91. activeList.applySiteStartTime +
  92. '~' +
  93. activeList.applySiteEndTime
  94. }}</text>
  95. </view>
  96. <view class="item" v-if="activeList.applySiteAddressTrain">
  97. 考前培训地点:
  98. <text class="val">{{ activeList.applySiteAddressTrain }}</text>
  99. </view>
  100. <view class="item" v-if="activeList.applySiteExamTrainTime && activeList.applySiteStartTrainTime && activeList.applySiteEndTrainTime">
  101. 考前培训时间:
  102. <text class="val">{{
  103. $method.timestampToTime(activeList.applySiteExamTrainTime) +
  104. ' ' +
  105. activeList.applySiteStartTrainTime +
  106. '~' +
  107. activeList.applySiteEndTrainTime
  108. }}</text>
  109. </view>
  110. </view>
  111. <view class="boxItem">
  112. <view class="title">考试成绩和证书信息</view>
  113. <view class="item">
  114. 考试成绩:
  115. <text class="val">{{activeList.performance}}分</text>
  116. </view>
  117. <view class="item" v-if="activeList.result === 1">
  118. 考试结果:
  119. <text class="val pass">通过</text>
  120. </view>
  121. <view class="item" v-if="activeList.result === 0">考试结果:<text class="val nopass">未通过</text></view>
  122. <view class="item" v-if="activeList.result === 1">
  123. 证书编号:
  124. <text class="val">{{activeList.certificateCode}}</text>
  125. </view>
  126. </view>
  127. <u-line color="#EEEEEE" />
  128. <view class="foot"><view class="btn" @click="hideModel">知道了</view></view>
  129. </view>
  130. </u-popup>
  131. </view>
  132. </template>
  133. <script>
  134. import { mapGetters } from 'vuex';
  135. export default {
  136. data() {
  137. return {
  138. details_show: false,
  139. list: [
  140. {
  141. name: '已通过'
  142. },
  143. {
  144. name: '未通过'
  145. }
  146. ],
  147. list1: [1, 2, 3],
  148. listData: [],
  149. current: 0,
  150. activeList:{
  151. applySiteStartTime: '',
  152. applySiteEndTime: '',
  153. applySiteStartTrainTime: '',
  154. applySiteEndTrainTime: ''
  155. },
  156. };
  157. },
  158. onPullDownRefresh() {},
  159. onLoad(option) {
  160. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  161. return;
  162. }
  163. if (String(option.current)) {
  164. this.current = +option.current
  165. this.change(+option.current)
  166. return
  167. }
  168. this.$api.getApplylist().then(res => {
  169. if (res.data.code === 200) {
  170. var a = [];
  171. var b = [];
  172. res.data.rows.forEach(items => {
  173. if (items.result === 1) {
  174. a.push(items);
  175. }
  176. if (items.result === 0) {
  177. b.push(items);
  178. }
  179. });
  180. this.list = [
  181. {
  182. name: `已通过(${a.length})`
  183. },
  184. {
  185. name: `未通过(${b.length})`
  186. }
  187. ];
  188. this.listData = a
  189. }
  190. });
  191. },
  192. onShow() {
  193. /* if(this.current === 2 && this.$method.isLogin()){
  194. this.$refs.refMy.init();
  195. } */
  196. },
  197. onShareAppMessage(res) {
  198. var self = this;
  199. return {
  200. title: '中正',
  201. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  202. };
  203. },
  204. methods: {
  205. showDetails(item) {
  206. this.activeList = JSON.parse(JSON.stringify(item));
  207. this.details_show = true;
  208. },
  209. hideModel() {
  210. this.details_show = false;
  211. },
  212. change(index) {
  213. // if (this.current === index) {
  214. // return;
  215. // }
  216. this.current = index;
  217. var data = {};
  218. if (index === 0) {
  219. data.result = 1;
  220. }
  221. if (index === 1) {
  222. data.result = 0;
  223. }
  224. this.$api.getApplylist(data).then(res => {
  225. this.listData = res.data.rows;
  226. });
  227. this.current = index;
  228. }
  229. },
  230. onReachBottom() {}
  231. // computed: { ...mapGetters(['userInfo']) }
  232. };
  233. </script>
  234. <style>
  235. page {
  236. background: #eaeef1;
  237. }
  238. .detailsModel .u-mode-center-box {
  239. border-radius: 24rpx;
  240. }
  241. </style>
  242. <style scoped lang="scss">
  243. .noData {
  244. text-align: center;
  245. font-size: 32rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #999999;
  249. margin: 160rpx 0;
  250. }
  251. .pass {
  252. color: #34c759 !important;
  253. }
  254. .nopass {
  255. color: #ff3b30 !important;
  256. }
  257. .examMain {
  258. padding: 8rpx;
  259. .time {
  260. text-align: center;
  261. font-size: 24rpx;
  262. font-family: PingFang SC;
  263. font-weight: 500;
  264. color: #999999;
  265. }
  266. .main {
  267. background: #ffffff;
  268. border-radius: 16rpx;
  269. margin: 20rpx 0;
  270. }
  271. .top {
  272. height: 103rpx;
  273. display: flex;
  274. justify-content: center;
  275. align-items: center;
  276. border-bottom: 1px solid #eeeeee;
  277. .subject {
  278. max-width: 514rpx;
  279. height: 40rpx;
  280. font-size: 30rpx;
  281. font-family: PingFang SC;
  282. font-weight: bold;
  283. color: #007aff;
  284. white-space: nowrap;
  285. overflow: hidden;
  286. text-overflow: ellipsis;
  287. }
  288. }
  289. .item {
  290. display: flex;
  291. justify-content: space-between;
  292. align-items: center;
  293. margin-left: 31rpx;
  294. height: 80rpx;
  295. padding-right: 24rpx;
  296. border-bottom: 1px solid #eeeeee;
  297. font-size: 24rpx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. color: #666666;
  301. .right {
  302. font-size: 30rpx;
  303. font-family: PingFang SC;
  304. font-weight: bold;
  305. }
  306. }
  307. }
  308. .detailsBox {
  309. width: 640rpx;
  310. background: #ffffff;
  311. border-radius: 24rpx;
  312. .time {
  313. margin: 32rpx 0;
  314. padding: 0 37rpx;
  315. font-size: 30rpx;
  316. font-family: PingFang SC;
  317. font-weight: bold;
  318. color: #333333;
  319. }
  320. .boxItem {
  321. margin-left: 36rpx;
  322. margin-bottom: 29rpx;
  323. &.border {
  324. border-bottom: 1px solid #eee;
  325. }
  326. .title {
  327. font-size: 24rpx;
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. color: #007aff;
  331. position: relative;
  332. &::before {
  333. content: '';
  334. width: 4rpx;
  335. height: 24rpx;
  336. background: #007aff;
  337. border-radius: 2rpx;
  338. position: absolute;
  339. top: 6rpx;
  340. left: -12rpx;
  341. }
  342. }
  343. .item {
  344. margin: 24rpx 0;
  345. font-size: 26rpx;
  346. font-family: PingFang SC;
  347. font-weight: 500;
  348. color: #999999;
  349. .val {
  350. color: #333333;
  351. }
  352. }
  353. }
  354. .foot {
  355. padding: 20rpx 40rpx;
  356. display: flex;
  357. justify-content: center;
  358. .btn {
  359. width: 526rpx;
  360. height: 80rpx;
  361. line-height: 80rpx;
  362. text-align: center;
  363. background: #f5f5f5;
  364. border-radius: 40rpx;
  365. font-size: 30rpx;
  366. font-family: PingFang SC;
  367. font-weight: bold;
  368. background: #007aff;
  369. color: #ffffff;
  370. }
  371. }
  372. }
  373. .tipBox {
  374. width: 640rpx;
  375. padding: 30rpx 20rpx 40rpx;
  376. background: #ffffff;
  377. border-radius: 24rpx;
  378. font-family: PingFang SC;
  379. .title {
  380. text-align: center;
  381. font-size: 30rpx;
  382. font-weight: bold;
  383. color: #333333;
  384. margin-bottom: 40rpx;
  385. }
  386. .main {
  387. font-size: 30rpx;
  388. font-weight: 500;
  389. color: #666666;
  390. line-height: 48rpx;
  391. margin-bottom: 40rpx;
  392. }
  393. .btn {
  394. display: flex;
  395. justify-content: center;
  396. .btn1 {
  397. width: 200rpx;
  398. height: 80rpx;
  399. line-height: 80rpx;
  400. text-align: center;
  401. background: #f5f5f5;
  402. border-radius: 40px;
  403. font-size: 30rpx;
  404. font-weight: bold;
  405. color: #007aff;
  406. margin: 0 20rpx;
  407. &.submit {
  408. background: #007aff;
  409. color: #fff;
  410. }
  411. }
  412. }
  413. }
  414. </style>