微信小程序页面迁移校验之前 P5任务处理之前

This commit is contained in:
Neo
2026-03-09 01:19:21 +08:00
parent 263bf96035
commit 6e20987d2f
1112 changed files with 153824 additions and 219694 deletions

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,30 @@
Component({
properties: {
/** 评分 0-10超出范围自动 clamp */
score: {
type: Number,
value: 0,
},
},
data: {
heartEmoji: '💙',
},
observers: {
score(val: number) {
const s = val < 0 ? 0 : val > 10 ? 10 : val
let emoji: string
if (s > 8.5) {
emoji = '💖'
} else if (s > 7) {
emoji = '🧡'
} else if (s > 5) {
emoji = '💛'
} else {
emoji = '💙'
}
this.setData({ heartEmoji: emoji })
},
},
})

View File

@@ -0,0 +1 @@
<text class="heart-icon">{{heartEmoji}}</text>

View File

@@ -0,0 +1,6 @@
.heart-icon {
font-size: 22rpx;
line-height: 1;
position: relative;
top: -4rpx;
}