list.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <yf-more-list url="/api/paper/paper/my-paging" :params="queryParams" ref="moreList">
  3. <template v-slot:item="{ data }">
  4. <uni-list-item
  5. :note="`得分:${data.userScore}`"
  6. :rightText="stateText(data)"
  7. :title="`考试时间:${data.createTime}`"
  8. link="navigateTo"
  9. :to="`/pages/paper/detail?id=${data.id}`">
  10. </uni-list-item>
  11. </template>
  12. </yf-more-list>
  13. </template>
  14. <script>
  15. export default {
  16. components: { },
  17. data() {
  18. return {
  19. queryParams:{
  20. examId: ''
  21. }
  22. }
  23. },
  24. onLoad(option) {
  25. this.queryParams.examId = option.id;
  26. },
  27. onShow() {
  28. if(this.$refs.moreList){
  29. this.$refs.moreList.initData()
  30. }
  31. },
  32. onReachBottom() {
  33. // 加载数据
  34. this.$refs.moreList.loadData()
  35. },
  36. onBackPress(e){
  37. //正常返回页面
  38. uni.redirectTo({
  39. url:"/pages/paper/index"
  40. })
  41. return true;
  42. },
  43. methods: {
  44. stateText(item){
  45. if(item.state===1){
  46. return '待阅卷'
  47. }else{
  48. if(item.userScore>=item.qualifyScore){
  49. return '合格'
  50. }else{
  51. return '不合格'
  52. }
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. <style>
  59. .container {
  60. font-size: 14rpx;
  61. }
  62. .exam-item{
  63. display: flex; align-items: center;
  64. line-height: 30px;
  65. }
  66. .exam-item .left{
  67. text-align: left;
  68. flex-grow: 1;
  69. }
  70. .exam-item .left .title{
  71. font-size: 16px;
  72. }
  73. .exam-item .left .desc{
  74. font-size: 14px;
  75. color: #888;
  76. }
  77. .exam-item .left .icons{
  78. font-size: 10px;
  79. display: flex;
  80. align-items: center;
  81. color: #666;
  82. }
  83. .right {
  84. display: flex;
  85. align-items: center;
  86. }
  87. .pass{
  88. color: #007AFF !important;
  89. margin-right: 5px;
  90. }
  91. .fail{
  92. color: #ff0000 !important;
  93. margin-right: 5px;
  94. }
  95. </style>