mineCredits.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="container">
  3. <view class="list-box">
  4. <view class="list-item-box">
  5. <view class="list-item">
  6. 学习年度
  7. </view>
  8. <view class="list-item">
  9. 会员网络教育<br/>完成学分情况
  10. </view>
  11. <view class="list-item">
  12. 年检情况
  13. </view>
  14. <view class="list-item">
  15. 是否完成观看
  16. </view>
  17. </view>
  18. <view class="list-item-box" v-for="(item, index) in list" :key="index">
  19. <view class="list-item">
  20. {{item.year}}
  21. </view>
  22. <view class="list-item">
  23. {{item.credit}}
  24. </view>
  25. <view class="list-item" v-html="item.annIns!=='学分未达标不能申请年检' ? '完成学分' : '学分未达标,<br/>不能申请年检'"></view>
  26. <view class="list-item">
  27. <view class="button" :class="[item.finish ? 'primary' : 'error']">
  28. {{item.finish ? '已完成观看' : '未完成'}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup>
  36. import { ref } from 'vue'
  37. import { onLoad } from '@dcloudio/uni-app'
  38. import { loadCredit } from '@/api/edu.js'
  39. const list = ref([])
  40. const initList = () => {
  41. loadCredit().then(res=>{
  42. if(res && res?.code ===0){
  43. list.value = res.data
  44. }
  45. })
  46. }
  47. onLoad(() => {
  48. initList()
  49. console.log('onLoad')
  50. })
  51. </script>
  52. <style lang="scss">
  53. page{
  54. background-color: $uni-bg-color;
  55. }
  56. .container {
  57. // height: 100vh;
  58. width: 100vw;
  59. // background-color: #fff;
  60. padding: 0 20rpx env(safe-area-inset-bottom, 0);
  61. }
  62. .list-box {
  63. margin: 20rpx 20rpx;
  64. background-color: $uni-bg-color-grey;
  65. border-radius: $uni-card-border-radius;
  66. padding: 20rpx 15rpx;
  67. // margin-bottom: 30rpx;
  68. .list-item-box {
  69. &:first-child {
  70. border-bottom: 5rpx solid #E6E6E6;
  71. font-size: $uni-font-size-1;
  72. font-weight: bold;
  73. .list-item {
  74. width: 25%;
  75. text-align: center;
  76. &:last-child {
  77. color: #303133;
  78. font-weight: bold;
  79. }
  80. }
  81. }
  82. padding: 15rpx 0;
  83. text-align: center;
  84. font-size: $uni-font-size-3;
  85. font-weight: bold;
  86. display: flex;
  87. align-items: center;
  88. .list-item {
  89. width: 25%;
  90. text-align: center;
  91. &:last-child {
  92. color: $uni-text-color-inverse;
  93. font-weight: normal;
  94. }
  95. }
  96. .button {
  97. width: fit-content;
  98. border-radius: $uni-card-border-radius;
  99. margin: 0 auto;
  100. }
  101. .primary {
  102. padding: 5rpx 25rpx;
  103. background-color: $uni-color-primary;
  104. }
  105. .error {
  106. padding: 5rpx 15rpx;
  107. background-color: $uni-color-error;
  108. }
  109. }
  110. }
  111. </style>