exam_result.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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. this.$api.getApplylist().then(res => {
  161. if (res.data.code === 200) {
  162. var a = [];
  163. var b = [];
  164. res.data.rows.forEach(items => {
  165. if (items.result === 1) {
  166. a.push(items);
  167. }
  168. if (items.result === 0) {
  169. b.push(items);
  170. }
  171. });
  172. this.list = [
  173. {
  174. name: `已通过(${a.length})`
  175. },
  176. {
  177. name: `未通过(${b.length})`
  178. }
  179. ];
  180. this.listData = a
  181. }
  182. });
  183. },
  184. onShow() {
  185. /* if(this.current === 2 && this.$method.isLogin()){
  186. this.$refs.refMy.init();
  187. } */
  188. },
  189. onShareAppMessage(res) {
  190. var self = this;
  191. return {
  192. title: '中正',
  193. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  194. };
  195. },
  196. methods: {
  197. showDetails(item) {
  198. this.activeList = JSON.parse(JSON.stringify(item));
  199. this.details_show = true;
  200. },
  201. hideModel() {
  202. this.details_show = false;
  203. },
  204. change(index) {
  205. if (this.current === index) {
  206. return;
  207. }
  208. this.current = index;
  209. var data = {};
  210. if (index === 0) {
  211. data.result = 1;
  212. }
  213. if (index === 1) {
  214. data.result = 0;
  215. }
  216. this.$api.getApplylist(data).then(res => {
  217. this.listData = res.data.rows;
  218. });
  219. this.current = index;
  220. }
  221. },
  222. onReachBottom() {}
  223. // computed: { ...mapGetters(['userInfo']) }
  224. };
  225. </script>
  226. <style>
  227. page {
  228. background: #eaeef1;
  229. }
  230. .detailsModel .u-mode-center-box {
  231. border-radius: 24rpx;
  232. }
  233. </style>
  234. <style scoped lang="scss">
  235. .noData {
  236. text-align: center;
  237. font-size: 32rpx;
  238. font-family: PingFang SC;
  239. font-weight: 500;
  240. color: #999999;
  241. margin: 160rpx 0;
  242. }
  243. .pass {
  244. color: #34c759 !important;
  245. }
  246. .nopass {
  247. color: #ff3b30 !important;
  248. }
  249. .examMain {
  250. padding: 8rpx;
  251. .time {
  252. text-align: center;
  253. font-size: 24rpx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #999999;
  257. }
  258. .main {
  259. background: #ffffff;
  260. border-radius: 16rpx;
  261. margin: 20rpx 0;
  262. }
  263. .top {
  264. height: 103rpx;
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. border-bottom: 1px solid #eeeeee;
  269. .subject {
  270. max-width: 514rpx;
  271. height: 40rpx;
  272. font-size: 30rpx;
  273. font-family: PingFang SC;
  274. font-weight: bold;
  275. color: #007aff;
  276. white-space: nowrap;
  277. overflow: hidden;
  278. text-overflow: ellipsis;
  279. }
  280. }
  281. .item {
  282. display: flex;
  283. justify-content: space-between;
  284. align-items: center;
  285. margin-left: 31rpx;
  286. height: 80rpx;
  287. padding-right: 24rpx;
  288. border-bottom: 1px solid #eeeeee;
  289. font-size: 24rpx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #666666;
  293. .right {
  294. font-size: 30rpx;
  295. font-family: PingFang SC;
  296. font-weight: bold;
  297. }
  298. }
  299. }
  300. .detailsBox {
  301. width: 640rpx;
  302. background: #ffffff;
  303. border-radius: 24rpx;
  304. .time {
  305. margin: 32rpx 0;
  306. padding: 0 37rpx;
  307. font-size: 30rpx;
  308. font-family: PingFang SC;
  309. font-weight: bold;
  310. color: #333333;
  311. }
  312. .boxItem {
  313. margin-left: 36rpx;
  314. margin-bottom: 29rpx;
  315. &.border {
  316. border-bottom: 1px solid #eee;
  317. }
  318. .title {
  319. font-size: 24rpx;
  320. font-family: PingFang SC;
  321. font-weight: 500;
  322. color: #007aff;
  323. position: relative;
  324. &::before {
  325. content: '';
  326. width: 4rpx;
  327. height: 24rpx;
  328. background: #007aff;
  329. border-radius: 2rpx;
  330. position: absolute;
  331. top: 6rpx;
  332. left: -12rpx;
  333. }
  334. }
  335. .item {
  336. margin: 24rpx 0;
  337. font-size: 26rpx;
  338. font-family: PingFang SC;
  339. font-weight: 500;
  340. color: #999999;
  341. .val {
  342. color: #333333;
  343. }
  344. }
  345. }
  346. .foot {
  347. padding: 20rpx 40rpx;
  348. display: flex;
  349. justify-content: center;
  350. .btn {
  351. width: 526rpx;
  352. height: 80rpx;
  353. line-height: 80rpx;
  354. text-align: center;
  355. background: #f5f5f5;
  356. border-radius: 40rpx;
  357. font-size: 30rpx;
  358. font-family: PingFang SC;
  359. font-weight: bold;
  360. background: #007aff;
  361. color: #ffffff;
  362. }
  363. }
  364. }
  365. .tipBox {
  366. width: 640rpx;
  367. padding: 30rpx 20rpx 40rpx;
  368. background: #ffffff;
  369. border-radius: 24rpx;
  370. font-family: PingFang SC;
  371. .title {
  372. text-align: center;
  373. font-size: 30rpx;
  374. font-weight: bold;
  375. color: #333333;
  376. margin-bottom: 40rpx;
  377. }
  378. .main {
  379. font-size: 30rpx;
  380. font-weight: 500;
  381. color: #666666;
  382. line-height: 48rpx;
  383. margin-bottom: 40rpx;
  384. }
  385. .btn {
  386. display: flex;
  387. justify-content: center;
  388. .btn1 {
  389. width: 200rpx;
  390. height: 80rpx;
  391. line-height: 80rpx;
  392. text-align: center;
  393. background: #f5f5f5;
  394. border-radius: 40px;
  395. font-size: 30rpx;
  396. font-weight: bold;
  397. color: #007aff;
  398. margin: 0 20rpx;
  399. &.submit {
  400. background: #007aff;
  401. color: #fff;
  402. }
  403. }
  404. }
  405. }
  406. </style>