|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<view class="content"> |
|
|
|
<view class="ul padding"> |
|
|
|
<view class="li" v-for="(item,index) in tabData" :key="index" @click="goPage(index)"> |
|
|
|
<view class="li" v-for="(item,index) in dataList" :key="index" @click="goPage(item)"> |
|
|
|
<view class="num" :style="{background: colorArr[index]}">{{index+1}}</view> |
|
|
|
<view class="rightTxt"> |
|
|
|
<view class="h1">{{ item.name }}</view> |
|
|
@ -9,8 +9,7 @@ |
|
|
|
<view class="proccess"> |
|
|
|
<up-line-progress :percentage="80" height="8" activeColor="#3776FF" :showText="false"></up-line-progress> |
|
|
|
</view> |
|
|
|
<view class="rate">{{ item.num1 }}/{{ item.num2 }}</view> |
|
|
|
<view class="rate">正确率 {{ item.acc }}</view> |
|
|
|
<view class="rate">{{ item.already }}/ {{item.total}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -20,21 +19,35 @@ |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { ref } from 'vue' |
|
|
|
const colorArr = ref([ |
|
|
|
'#3776FF', '#64C76C', '#8484FF', '#F05C1C', '#FDD650', '#6FD568', '#52C1D0' |
|
|
|
]) |
|
|
|
const tabData = ref([ |
|
|
|
{name: '单选题', num1: '60', num2: '260', acc: '100%'}, |
|
|
|
{name: '多选题', num1: '60', num2: '260', acc: '100%'}, |
|
|
|
{name: '判断题', num1: '60', num2: '260', acc: '100%'}, |
|
|
|
{name: '文本题', num1: '60', num2: '260', acc: '100%'}, |
|
|
|
{name: '图片题', num1: '60', num2: '260', acc: '100%'}, |
|
|
|
]) |
|
|
|
function goPage(index) { |
|
|
|
import carStore from '@/store/modules/car.js' |
|
|
|
let usecarStore = carStore() |
|
|
|
import { columnFid, columnPid } from '@/config/api.js' |
|
|
|
function goPage(item) { |
|
|
|
usecarStore.setCar('types', item.param) |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/exercises/brushQuestions/brushQuestions' |
|
|
|
}) |
|
|
|
} |
|
|
|
let dataList = ref([]) |
|
|
|
async function columnFidFn() { |
|
|
|
dataList.value = [] |
|
|
|
let obj = { |
|
|
|
type: '2', |
|
|
|
stepType: usecarStore.carInfo.stepType, |
|
|
|
carType: usecarStore.carInfo.carType |
|
|
|
} |
|
|
|
const {data: res} = await columnFid(obj) |
|
|
|
for(let i=0; i<res.length; i++) { |
|
|
|
res[i].percentage = (res[i].total / res[i].already) * 100% |
|
|
|
dataList.value.push(res[i]) |
|
|
|
} |
|
|
|
console.log(dataList.value) |
|
|
|
} |
|
|
|
|
|
|
|
columnFidFn() |
|
|
|
|
|
|
|
const colorArr = ['#3776FF', '#64C76C', '#8484FF', '#F05C1C', '#FDD650', '#6FD568', '#52C1D0'] |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|