Commit a2691718 authored by liujiangnan's avatar liujiangnan

feat: 评语

parent 4882ef2e
......@@ -210,6 +210,8 @@ export default class NewClass extends cc.Component {
for (let i = 0; i < 3; i++) {
cc.find(`result_bg/star_${i+1}_light`, qpyNode).active = false;
}
const label = cc.find(`result_bg/textnode/label`, qpyNode).getComponent(cc.Label);
label.string = "";
}
......@@ -342,7 +344,6 @@ export default class NewClass extends cc.Component {
if (OP_06_3) {
const rowData = JSON.parse(OP_06_3);
cc.find(`Canvas/videoContainer`).attr({rowData});
// TODO 星星算法和评语
let lightStarCount = 0;
rowData.item_arr.forEach(row => {
lightStarCount += row.star_count;
......@@ -351,6 +352,14 @@ export default class NewClass extends cc.Component {
for (let i = 0; i < lightStarCount; i++) {
cc.find(`result_bg/star_${i+1}_light`, qpyNode).active = true;
}
const label = cc.find(`result_bg/textnode/label`, qpyNode).getComponent(cc.Label);
if (lightStarCount == 0 || lightStarCount == 1) {
label.string = `再多听听原声,\n大声录音让我听到,\n争取拿到三颗星!`;
} else if (lightStarCount == 2) {
label.string = `宝贝的发音很好哦\n差一点点就完美了~\n多试几次,\n争取拿到三颗星!`;
} else {
label.string = `宝贝的发音太好了!\n再接再厉呀!`;
}
qpyNode.active = true;
} else {
qpyNode.active = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment