Commit 23f75e16 authored by 罗超's avatar 罗超

1

parent bc68eba6
......@@ -37,11 +37,12 @@
</van-circle> -->
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/Dashboard.png"
style="width: 360rpx; position: absolute; top: 10px; left: 11px"
style="width: 180px; position: absolute; top: 20px; left: 20px"
mode="widthFix"
class="canvasBg"
/>
<canvas
style="width: 400rpx; height: 400rpx"
style="width: 200px; height: 200px"
canvas-id="firstCanvas"
id="firstCanvas"
></canvas>
......@@ -109,6 +110,11 @@ export default {
if (res) {
if (res.Code == 1) {
data.dataList = res.Data;
that.initCanvas(
res.Data.TotalScore,
res.Data.StuComment,
res.Data.ExamScore
);
}
}
},
......@@ -130,11 +136,9 @@ export default {
},
initCanvas(score, comment, tatalScore) {
let end = (score / tatalScore) * (2.25 - 0.75) + 0.75;
console.log(133, end);
let ctx = uni.createCanvasContext("firstCanvas");
ctx.beginPath();
console.log(130, ctx);
ctx.arc(110, 110, 95, 0.75 * Math.PI, end * Math.PI);
ctx.arc(110, 110, 86, 0.75 * Math.PI, end * Math.PI);
ctx.lineWidth = 7;
ctx.lineCap = "round";
ctx.textAlign = "center";
......@@ -149,6 +153,7 @@ export default {
ctx.draw();
},
};
let that = methods;
return {
...toRefs(data),
...methods,
......
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