You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.3 KiB

4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
1 month ago
4 months ago
  1. <template>
  2. <view class="content">
  3. <view class="ul padding">
  4. <view class="li" v-for="(item,index) in dataList" :key="index" @click="goPage(item)">
  5. <view class="num" :style="{background: colorArr[index]}">{{index+1}}</view>
  6. <view class="rightTxt">
  7. <view class="h1">{{ item.name }}</view>
  8. <view class="flex">
  9. <view class="proccess">
  10. <up-line-progress :percentage="item.percentage" height="8" activeColor="#3776FF" :showText="false"></up-line-progress>
  11. </view>
  12. <view class="rate">{{ item.already }}/ {{item.total}}</view>
  13. <!-- <view class="rate">正确率 100%</view> -->
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script setup>
  21. import { ref } from 'vue'
  22. import carStore from '@/store/modules/car.js'
  23. let usecarStore = carStore()
  24. import { columnFid, } from '@/config/api.js'
  25. function goPage(item) {
  26. usecarStore.setCar('chapter', item.param)
  27. uni.navigateTo({
  28. url: '/pages/exercises/brushQuestions/brushQuestions'
  29. })
  30. }
  31. let dataList = ref([])
  32. async function columnFidFn() {
  33. dataList.value = []
  34. let obj = {
  35. type: '4',
  36. stepType: usecarStore.carInfo.stepType,
  37. carType: usecarStore.carInfo.carType,
  38. city: usecarStore.carInfo.city
  39. }
  40. const {data: res} = await columnFid(obj)
  41. for(let i=0; i<res.length; i++) {
  42. res[i].percentage = (res[i].total / res[i].already) * 100%
  43. dataList.value.push(res[i])
  44. }
  45. console.log(dataList.value)
  46. }
  47. columnFidFn()
  48. const colorArr = ['#3776FF', '#64C76C', '#8484FF', '#F05C1C', '#FDD650', '#6FD568', '#52C1D0']
  49. </script>
  50. <style lang="scss" scoped>
  51. .content {
  52. width: 100%;
  53. .ul {
  54. width: 100%;
  55. .li {
  56. width: 100%;
  57. display: flex;
  58. padding: 30rpx 0 0 0;
  59. border-bottom: 1px solid #F4F4F4;
  60. .num {
  61. height: 34rpx;
  62. width: 34rpx;
  63. // padding: 10rpx 10rpx;
  64. text-align: center;
  65. background: #3776FF;
  66. border-radius: 50%;
  67. font-size: 24rpx;
  68. color: #fff;
  69. line-height: 34rpx;
  70. margin-top: 8rpx;
  71. }
  72. .h1 {
  73. font-size: 32rpx;
  74. color: #333;
  75. margin-bottom: 20rpx;
  76. }
  77. .rightTxt {
  78. padding-left: 20rpx;
  79. margin-bottom: 30rpx;
  80. }
  81. .flex {
  82. .proccess {
  83. margin-right: 20rpx;
  84. width: 120rpx;
  85. }
  86. .rate {
  87. font-size: 24rpx;
  88. color: #CCCCCC;
  89. margin-right: 30rpx;
  90. }
  91. }
  92. }
  93. }
  94. }
  95. </style>