|
|
@@ -75,6 +75,10 @@ export default {
|
|
|
scoreFontSize:{
|
|
|
type:Number,
|
|
|
default:50
|
|
|
+ },
|
|
|
+ rtOrWrSize:{
|
|
|
+ type:Number,
|
|
|
+ default:2
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -667,14 +671,14 @@ export default {
|
|
|
ctx.strokeStyle = ctx.fillStyle; // 使用与文字相同的颜色
|
|
|
ctx.lineWidth = 4;
|
|
|
ctx.stroke();
|
|
|
- if(item.displayType === 0 || item.displayType === 2){
|
|
|
+ if(item.displayType === 0 || item.displayType === 2){//0-分数 1-对错 2-等级
|
|
|
ctx.fillText(item.displayName,obj.x+35*this.zoomRate*this.scale,obj.y);
|
|
|
}else{
|
|
|
//判断是什么类型 scoreType 分数类型1:全对 2:半对 3: 全错
|
|
|
const iconX=obj.x +35*this.zoomRate*this.scale;
|
|
|
- const iconY=obj.y-fontSize*this.zoomRate*this.scale;
|
|
|
- const iconWidth = 2 * fontSize*this.zoomRate*this.scale;
|
|
|
- const iconHeight = 2 * fontSize*this.zoomRate*this.scale;
|
|
|
+ const iconY=obj.y-this.rtOrWrSize*fontSize*this.zoomRate*this.scale;
|
|
|
+ const iconWidth = this.rtOrWrSize * fontSize*this.zoomRate*this.scale;
|
|
|
+ const iconHeight = this.rtOrWrSize * fontSize*this.zoomRate*this.scale;
|
|
|
if(item.correctType==0){
|
|
|
//0 分全错
|
|
|
ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
|
|
|
@@ -705,15 +709,27 @@ export default {
|
|
|
if(item.displayType === 2){
|
|
|
ctx.fillText(item.displayName,obj.x+35*this.zoomRate*this.scale,obj.y);
|
|
|
}else{
|
|
|
- if(item.correctType==0){
|
|
|
+ if(item.correctType===0){
|
|
|
//0 分全错
|
|
|
ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
|
|
|
}else if(item.correctType==2){
|
|
|
//满分 全对
|
|
|
ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
|
|
|
- }else{
|
|
|
+ }else if(item.correctType==1){
|
|
|
//半对
|
|
|
ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
|
|
|
+ }else{
|
|
|
+ const displayName = isNaN(item.displayName)?0:Number(item.displayName);
|
|
|
+ if(displayName==0){
|
|
|
+ //0 分全错
|
|
|
+ ctx.drawImage(this.CacheAllWrong, iconX, iconY, iconWidth, iconHeight);
|
|
|
+ }else if(displayName==item.fullScore){
|
|
|
+ //满分全对
|
|
|
+ ctx.drawImage(this.CacheAllRight, iconX, iconY, iconWidth, iconHeight);
|
|
|
+ }else{
|
|
|
+ //半对
|
|
|
+ ctx.drawImage(this.CacheHalfRight, iconX, iconY, iconWidth, iconHeight);
|
|
|
+ }
|
|
|
}
|
|
|
if(item.displayType === 0){//0-分数 显示分数和对错
|
|
|
ctx.fillText(item.displayName,obj.x+35*this.zoomRate*this.scale,obj.y);
|