|
|
|
@ -7,10 +7,16 @@
|
|
|
|
|
<h2 class="sub-heading">你成功的复述了所提的问题吗?</h2>
|
|
|
|
|
<div class="buttons">
|
|
|
|
|
<!-- 使用 Element Plus 的 ElButton 组件 -->
|
|
|
|
|
<el-button class="ax_default button" @click="showRating = true"
|
|
|
|
|
<el-button
|
|
|
|
|
class="ax_default button"
|
|
|
|
|
@click="handleYesClick"
|
|
|
|
|
:disabled="isButtonPressed"
|
|
|
|
|
><span class="button-text">是</span></el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button class="ax_default button" @click="updateScoreMinus"
|
|
|
|
|
<el-button
|
|
|
|
|
class="ax_default button"
|
|
|
|
|
@click="updateScoreMinus"
|
|
|
|
|
:disabled="isButtonPressed"
|
|
|
|
|
><span class="button-text">否</span></el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
@ -63,6 +69,7 @@ const showAngryFace = ref(false) // 控制生气表情和文字的显示
|
|
|
|
|
const stopNumbers = route.query.stopNumbers
|
|
|
|
|
const stopName = route.query.stopName
|
|
|
|
|
const studentScore = ref(parseInt(route.query.studentScore) || 0)
|
|
|
|
|
const isButtonPressed = ref(false)
|
|
|
|
|
|
|
|
|
|
// 将 stopNumbers 转换为整数 user_id
|
|
|
|
|
const userId = parseInt(
|
|
|
|
@ -72,6 +79,12 @@ const userId = parseInt(
|
|
|
|
|
// 获取 router 实例
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
|
|
// 处理"是"按钮的点击
|
|
|
|
|
const handleYesClick = () => {
|
|
|
|
|
showRating.value = true
|
|
|
|
|
isButtonPressed.value = true // 按钮被禁用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 评分变化时更新 studentScore,并累加评分
|
|
|
|
|
const updateScore = (value) => {
|
|
|
|
|
// 累加评分到传递过来的 studentScore 上
|
|
|
|
@ -104,6 +117,8 @@ const updateScore = (value) => {
|
|
|
|
|
|
|
|
|
|
// 减少 studentScore 1 分
|
|
|
|
|
const updateScoreMinus = () => {
|
|
|
|
|
isButtonPressed.value = true // 按钮被禁用
|
|
|
|
|
|
|
|
|
|
// 扣除 1 分
|
|
|
|
|
studentScore.value -= 1
|
|
|
|
|
|
|
|
|
|