This commit is contained in:
Neo
2026-03-15 10:15:02 +08:00
parent 2dd217522c
commit 72bb11b34f
916 changed files with 65306 additions and 16102803 deletions

View File

@@ -1,6 +1,6 @@
Component({
properties: {
/** 评分 0-10内部转换为 0-5 星 */
/** 评分 0-10内部转换为 0-5 星,支持半星 */
score: {
type: Number,
value: 0,
@@ -19,7 +19,7 @@ Component({
observers: {
score(val: number) {
// score(0-10) → star(0-5)
// score(0-10) → star(0-5),支持半星(如 7.5 → 3.75星)
const clamped = Math.max(0, Math.min(10, val))
this.setData({ starValue: clamped / 2 })
},

View File

@@ -3,5 +3,7 @@
count="{{5}}"
allow-half
size="{{size}}"
color="#fbbf24"
gap="{{4}}"
disabled="{{readonly}}"
/>

View File

@@ -1,3 +1,4 @@
/* 星星评分组件样式 */
:host {
display: inline-block;
}