Skip to content

Commit e689d3a

Browse files
committed
修正异常
1 parent 6fe2a30 commit e689d3a

3 files changed

Lines changed: 74 additions & 15 deletions

File tree

src/components/ProgressiveSidebar.vue

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const rangeConfigs = {
3131
<div :class="['arrow-icon', { 'is-active': isOpen }]"></div>
3232
</button>
3333

34-
<div class="sidebar-inner" v-if="isOpen">
34+
<div class="sidebar-inner">
3535
<h3 class="sidebar-title">训练设置</h3>
3636

3737
<div class="range-setting-container">
@@ -56,6 +56,20 @@ const rangeConfigs = {
5656
</div>
5757
</div>
5858
</div>
59+
60+
<div class="setting-tips">
61+
<div class="tips-header">
62+
<span class="tips-title">调节建议</span>
63+
</div>
64+
<ul class="tips-list">
65+
<li>
66+
<strong>先准后快:</strong> 双拼初期由于键位陌生,速度会比全拼慢,这很正常。切勿盲目加速,错误的肌肉记忆很难纠正。请务必确保<span class="highlight">准确率优先(95%+)</span>,速度自然水到渠成。
67+
</li>
68+
<li>
69+
<strong>速度参考:</strong> 0-40 WPM 新手(键位记忆阶段,需看键盘或思考), 40-60 WPM 入门(形成肌肉记忆,不再卡顿),60-80 WPM 舒适区(日常基准线,注意力回归内容),80+ WPM 精通(行云流水,人机合一)。
70+
</li>
71+
</ul>
72+
</div>
5973
</aside>
6074
</template>
6175

@@ -207,5 +221,54 @@ const rangeConfigs = {
207221
}
208222
}
209223
}
224+
225+
.setting-tips {
226+
margin-top: 8px;
227+
padding: 16px;
228+
background: rgba(0, 0, 0, 0.03);
229+
border-radius: 12px;
230+
border-left: 3px solid @primary-color;
231+
232+
.tips-header {
233+
display: flex;
234+
align-items: center;
235+
gap: 8px;
236+
margin-bottom: 10px;
237+
238+
.tips-icon {
239+
font-size: 1.1rem;
240+
}
241+
242+
.tips-title {
243+
font-size: 0.85rem;
244+
font-weight: bold;
245+
color: var(--black);
246+
opacity: 0.8;
247+
}
248+
}
249+
250+
.tips-list {
251+
margin: 0;
252+
padding-left: 18px;
253+
list-style-type: disc;
254+
255+
li {
256+
font-size: 0.75rem;
257+
line-height: 1.6;
258+
color: var(--black);
259+
opacity: 0.6;
260+
margin-bottom: 6px;
261+
262+
&:last-child {
263+
margin-bottom: 0;
264+
}
265+
266+
.highlight {
267+
color: @primary-color;
268+
font-weight: bold;
269+
}
270+
}
271+
}
272+
}
210273
}
211274
</style>

src/components/SingleMode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ watchPostEffect(() => {
172172
hanziSeq.value.unshift(newChar);
173173
hanziSeq.value.pop();
174174
isValid.value = false;
175-
}, 100);
175+
}, 30);
176176
}
177177
});
178178

src/pages/ProgressiveMode.vue

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,14 @@ import { useProgressiveLogic } from "../utils/useProgressiveLogic";
66
import SingleMode from "../components/SingleMode.vue";
77
import { progressiveKeys } from "../utils/pinyin";
88
9-
const CONFIG = {
10-
TARGET_ACCURACY: 0.95,
11-
TARGET_COUNT: 20,
12-
TARGET_SPEED: 35,
13-
};
14-
159
const getTargetCount = (index: number) => {
1610
const PREVIEW_SIZE = 10;
1711
const MIN_TRAINING_SIZE = 15;
1812
const difficultyBonus = Math.floor(index / 3) * 5;
1913
return PREVIEW_SIZE + MIN_TRAINING_SIZE + difficultyBonus;
2014
};
21-
2215
const store = useStore();
23-
const { currentProgressiveIndex } = storeToRefs(store);
16+
const { currentProgressiveIndex, settings } = storeToRefs(store);
2417
const singleModeRef = ref();
2518
2619
const { hanziList, getNextChar } = useProgressiveLogic(currentProgressiveIndex);
@@ -32,17 +25,20 @@ const isPerformanceMet = (stats: {
3225
}) => {
3326
const targetCount = getTargetCount(currentProgressiveIndex.value);
3427
const currentKey = progressiveKeys[currentProgressiveIndex.value];
28+
29+
const targetAcc = settings.value.targetAccuracy / 100;
30+
const targetSpd = settings.value.targetSpeed;
31+
3532
const keyStat = latestKeysAccuracy.value.find(
3633
(item) => item.key === currentKey,
3734
);
38-
const isKeyMastered = keyStat
39-
? keyStat.accuracy >= CONFIG.TARGET_ACCURACY
40-
: false;
35+
36+
const isKeyMastered = keyStat ? keyStat.accuracy >= targetAcc : false;
4137
4238
return (
43-
stats.accuracy >= CONFIG.TARGET_ACCURACY &&
39+
stats.accuracy >= targetAcc &&
4440
isKeyMastered &&
45-
stats.speed >= CONFIG.TARGET_SPEED &&
41+
stats.speed >= targetSpd &&
4642
stats.count >= targetCount
4743
);
4844
};

0 commit comments

Comments
 (0)