mineCredits.vue 2.9 KB

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