exam_result.vue 10 KB

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