|
|
|
@ -20,10 +20,10 @@ export default function DocRating({ docId }) {
|
|
|
|
|
setShowMessage(true);
|
|
|
|
|
setHasRated(true);
|
|
|
|
|
|
|
|
|
|
// 3秒后隐藏消息
|
|
|
|
|
// 5秒后隐藏消息
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
setShowMessage(false);
|
|
|
|
|
}, 3000);
|
|
|
|
|
}, 5000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (hasRated) {
|
|
|
|
@ -31,27 +31,32 @@ export default function DocRating({ docId }) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={styles.ratingSection}>
|
|
|
|
|
<p className={styles.ratingText}>请您对本文档做出评价</p>
|
|
|
|
|
<div className={styles.ratingButtons}>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => handleRating(true)}
|
|
|
|
|
className={`${styles.ratingButton} ${styles.positiveButton}`}
|
|
|
|
|
>
|
|
|
|
|
好
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => handleRating(false)}
|
|
|
|
|
className={`${styles.ratingButton} ${styles.negativeButton}`}
|
|
|
|
|
>
|
|
|
|
|
不好
|
|
|
|
|
</button>
|
|
|
|
|
<>
|
|
|
|
|
<div className={styles.ratingSection}>
|
|
|
|
|
<p className={styles.ratingText}>请您对本文档做出评价</p>
|
|
|
|
|
<div className={styles.ratingButtons}>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => handleRating(true)}
|
|
|
|
|
className={`${styles.ratingButton} ${styles.positiveButton}`}
|
|
|
|
|
>
|
|
|
|
|
好
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => handleRating(false)}
|
|
|
|
|
className={`${styles.ratingButton} ${styles.negativeButton}`}
|
|
|
|
|
>
|
|
|
|
|
不好
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{showMessage && (
|
|
|
|
|
<div className={styles.message}>
|
|
|
|
|
{message}
|
|
|
|
|
</div>
|
|
|
|
|
<>
|
|
|
|
|
<div className={styles.messageOverlay} />
|
|
|
|
|
<div className={styles.message}>
|
|
|
|
|
{message}
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|