exam_result.vue 9.8 KB

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