|
@@ -401,20 +401,34 @@ Page({
|
|
|
const accuracy = result.overall; // 准确度 发音分
|
|
|
const fluency = result.fluency.overall; //流利度
|
|
|
let starArray = [];
|
|
|
- let myOverall = integrity * 0.5 + accuracy * 0.5 + fluency * 0.1 + tone * 0.1;
|
|
|
- // let score = overall / 20;
|
|
|
- let score = myOverall / 20;
|
|
|
- if (score <= 0) {
|
|
|
+ let myOverall = integrity * 0.3 + accuracy * 0.5 + fluency * 0.1 + tone * 0.1;
|
|
|
+ // let myOverall = 80;
|
|
|
+ console.log('我的总分', myOverall)
|
|
|
+ if (myOverall < 5) {
|
|
|
starArray = [0, 0, 0, 0, 0]
|
|
|
- } else {
|
|
|
- for (let i = 1; i < 5; i += 0.9) {
|
|
|
- if (i < score) {
|
|
|
- starArray.push(1);
|
|
|
- } else {
|
|
|
- starArray.push(0)
|
|
|
- }
|
|
|
- }
|
|
|
+ } else if (5 <= myOverall && myOverall < 30) {
|
|
|
+ starArray = [1, 0, 0, 0, 0]
|
|
|
+ } else if (30 <= myOverall && myOverall < 50) {
|
|
|
+ starArray = [1, 1, 0, 0, 0]
|
|
|
+ } else if (50 <= myOverall && myOverall < 70) {
|
|
|
+ starArray = [1, 1, 1, 0, 0]
|
|
|
+ } else if (70 <= myOverall && myOverall < 90) {
|
|
|
+ starArray = [1, 1, 1, 1, 0]
|
|
|
+ } else if (90 <= myOverall) {
|
|
|
+ starArray = [1, 1, 1, 1, 1]
|
|
|
}
|
|
|
+ // let score = myOverall / 20;
|
|
|
+ // if (score <= 0) {
|
|
|
+ // starArray = [0, 0, 0, 0, 0]
|
|
|
+ // } else {
|
|
|
+ // for (let i = 1; i < 5; i += 0.9) {
|
|
|
+ // if (i <= score) {
|
|
|
+ // starArray.push(1);
|
|
|
+ // } else {
|
|
|
+ // starArray.push(0)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
this.setData({
|
|
|
overall,
|