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.

98 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
1 month 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, columnPid } 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. }
  39. const {data: res} = await columnFid(obj)
  40. for(let i=0; i<res.length; i++) {
  41. res[i].percentage = (res[i].total / res[i].already) * 100%
  42. dataList.value.push(res[i])
  43. }
  44. console.log(dataList.value)
  45. }
  46. columnFidFn()
  47. const colorArr = ['#3776FF', '#64C76C', '#8484FF', '#F05C1C', '#FDD650', '#6FD568', '#52C1D0']
  48. </script>
  49. <style lang="scss" scoped>
  50. .content {
  51. width: 100%;
  52. .ul {
  53. width: 100%;
  54. .li {
  55. width: 100%;
  56. display: flex;
  57. padding: 30rpx 0 0 0;
  58. border-bottom: 1px solid #F4F4F4;
  59. .num {
  60. height: 34rpx;
  61. width: 34rpx;
  62. // padding: 10rpx 10rpx;
  63. text-align: center;
  64. background: #3776FF;
  65. border-radius: 50%;
  66. font-size: 24rpx;
  67. color: #fff;
  68. line-height: 34rpx;
  69. margin-top: 8rpx;
  70. }
  71. .h1 {
  72. font-size: 32rpx;
  73. color: #333;
  74. margin-bottom: 20rpx;
  75. }
  76. .rightTxt {
  77. padding-left: 20rpx;
  78. margin-bottom: 30rpx;
  79. }
  80. .flex {
  81. .proccess {
  82. margin-right: 20rpx;
  83. width: 120rpx;
  84. }
  85. .rate {
  86. font-size: 24rpx;
  87. color: #CCCCCC;
  88. margin-right: 30rpx;
  89. }
  90. }
  91. }
  92. }
  93. }
  94. </style>