|
@@ -29,7 +29,13 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="dis_fst">
|
|
|
- <!-- <view class="btnACs">错题解析</view> -->
|
|
|
+ <navigator
|
|
|
+ :url="
|
|
|
+ '/pages2/subject/wrongBank?explain=1&id=' + reportdata.examId
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <view class="btnACs">错题解析</view>
|
|
|
+ </navigator>
|
|
|
<navigator
|
|
|
:url="
|
|
|
'/pages2/bank/questionBankExplain?explain=1&id=' +
|
|
@@ -77,7 +83,7 @@ export default {
|
|
|
id: '',
|
|
|
reportdata: {},
|
|
|
context1: null,
|
|
|
- context2: null
|
|
|
+ context2: null,
|
|
|
};
|
|
|
},
|
|
|
onUnload() {},
|
|
@@ -95,7 +101,7 @@ export default {
|
|
|
.in(this)
|
|
|
.select('.canvas')
|
|
|
.boundingClientRect()
|
|
|
- .exec(newRes => {
|
|
|
+ .exec(async newRes => {
|
|
|
var width = newRes[0].width;
|
|
|
var height = newRes[0].height;
|
|
|
var caculateX = winW / 750;
|
|
@@ -106,8 +112,19 @@ export default {
|
|
|
context1.setStrokeStyle('#EEEEEE');
|
|
|
context1.setLineWidth(caculateX * 20);
|
|
|
context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true);
|
|
|
- // context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, (this.reportdata.performance / this.reportdata.goodsId) * 2 * Math.PI, false);
|
|
|
context1.stroke();
|
|
|
+ context1.draw();
|
|
|
+
|
|
|
+ var context2 = uni.createCanvasContext('Canvas2');
|
|
|
+ this.context2 = context2;
|
|
|
+ context2.setStrokeStyle('#EEEEEE');
|
|
|
+ context2.setLineWidth(caculateX * 20);
|
|
|
+ context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true);
|
|
|
+ context2.stroke();
|
|
|
+ context2.draw();
|
|
|
+
|
|
|
+ await this.examReport();
|
|
|
+
|
|
|
context1.beginPath();
|
|
|
context1.setStrokeStyle('#32D74B');
|
|
|
context1.setFillStyle('#32D74B');
|
|
@@ -121,19 +138,13 @@ export default {
|
|
|
context1.fillText(`满分${this.reportdata.totalScore}`, caculateX * 90, caculateX * 130, caculateX * 180);
|
|
|
context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, (this.reportdata.performance / this.reportdata.totalScore) * 2 * Math.PI, false);
|
|
|
context1.stroke();
|
|
|
- context1.draw();
|
|
|
-
|
|
|
- var context2 = uni.createCanvasContext('Canvas2');
|
|
|
- this.context2 = context2;
|
|
|
- context2.setStrokeStyle('#EEEEEE');
|
|
|
- context2.setLineWidth(caculateX * 20);
|
|
|
- context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true);
|
|
|
- context2.stroke();
|
|
|
+ context1.draw(true);
|
|
|
+
|
|
|
context2.beginPath();
|
|
|
context2.setStrokeStyle('#007AFF');
|
|
|
context2.setFillStyle('#007AFF');
|
|
|
context2.setTextAlign('center');
|
|
|
- context1.setTextBaseline('middle');
|
|
|
+ context2.setTextBaseline('middle');
|
|
|
context2.setLineCap('round');
|
|
|
context2.setFontSize(caculateX * 64);
|
|
|
context2.fillText(`${this.reportdata.doTime}'`, caculateX * 90, caculateX * 90, caculateX * 180);
|
|
@@ -142,7 +153,7 @@ export default {
|
|
|
context2.fillText(`限时${this.reportdata.examTime}'`, caculateX * 90, caculateX * 130, caculateX * 180);
|
|
|
context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, (this.reportdata.doTime / this.reportdata.examTime) * 2 * Math.PI, false);
|
|
|
context2.stroke();
|
|
|
- context2.draw();
|
|
|
+ context2.draw(true);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -205,9 +216,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
examReport() {
|
|
|
- this.$api.examReport(this.id).then(res => {
|
|
|
- this.reportdata = res.data.data;
|
|
|
- });
|
|
|
+ return new Promise(resolve => {
|
|
|
+ this.$api.examReport(this.id).then(res => {
|
|
|
+ this.reportdata = res.data.data;
|
|
|
+ });
|
|
|
+
|
|
|
+ resolve()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|