修复评分星星bug

This commit is contained in:
ember 2025-12-04 23:29:27 +08:00
parent 09713b37b7
commit 3a5993fe2f
4 changed files with 9 additions and 9 deletions

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@ -1 +1 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站课程评分系统</title><script defer="defer" src="/js/chunk-vendors.3aa9144b.js"></script><script defer="defer" src="/js/app.9056f471.js"></script><link href="/css/chunk-vendors.f2db5e15.css" rel="stylesheet"><link href="/css/app.cc964a1e.css" rel="stylesheet"></head><body><noscript><strong>本系统需要JavaScript支持请启用JavaScript后继续。</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站课程评分系统</title><script defer="defer" src="/js/chunk-vendors.3aa9144b.js"></script><script defer="defer" src="/js/app.cec3f497.js"></script><link href="/css/chunk-vendors.f2db5e15.css" rel="stylesheet"><link href="/css/app.a1f3e2a4.css" rel="stylesheet"></head><body><noscript><strong>本系统需要JavaScript支持请启用JavaScript后继续。</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

View File

@ -57,13 +57,12 @@
</div>
<div class="user-rating-action">
<p>您的评分</p>
<div class="stars interactive">
<div class="stars interactive" @mouseleave="resetStars">
<span
v-for="n in 5"
:key="n"
:class="{ 'active': n <= userRating }"
:class="{ 'active': n <= (hoverRating || userRating) }"
@mouseover="highlightStars(n)"
@mouseout="resetStars"
@click="confirmRating(n)"
></span>
</div>
@ -252,6 +251,7 @@ export default {
course: {},
token: null,
userRating: 0,
hoverRating: 0,
totalRating: 0,
fiveStarPercent: 0,
fourStarPercent: 0,
@ -427,8 +427,8 @@ export default {
}
},
highlightStars(star) { this.userRating = star; },
resetStars() { this.fetchUserRating(); },
highlightStars(star) { this.hoverRating = star; },
resetStars() { this.hoverRating = 0; },
confirmRating(star) {
if (confirm(`您确定要给课程 "${this.course.course_name}" 评分:${star}.0 吗?此评分将覆盖之前的评分。`)) {