This commit is contained in:
Felix
2025-12-06 13:47:00 +08:00
parent d67c77c250
commit f860f4782d
3 changed files with 6 additions and 19 deletions

View File

@@ -144,7 +144,6 @@ type IPageMethods = {
playStandardVoice: () => void
playAssessmentVoice: () => void
resetAudioState: () => void
handleSliderChange: (e: any) => void
handleWordClick: (e: any) => void
handleSentenceSelect: (e: any) => void
handleDictMore: () => void
@@ -904,21 +903,6 @@ Page<IPageData, IPageInstance>({
})
},
// 处理进度条拖动
handleSliderChange(e: any) {
const value = e.detail.value
const duration = this.audioContext?.duration || 0
const currentTime = (value / 100) * duration
if (this.audioContext) {
this.audioContext.seek(currentTime)
this.setData({
currentTime,
sliderValue: value
})
}
},
async handleWordClick(e: any) {
const { word, index } = e.currentTarget.dataset
// 若例句未被选中,优先选中例句并阻止单词选择
@@ -959,7 +943,7 @@ Page<IPageData, IPageInstance>({
}
// 清理单词,移除标点符号
const cleanedWord = word.replace(/[.,?!*;:]/g, '').trim()
const cleanedWord = word.replace(/[.,?!*;:'"()]/g, '').trim()
if (!cleanedWord) return
// 先清空 prototypeWord避免新词没有原型时保留旧值

View File

@@ -1118,11 +1118,11 @@
@keyframes starCycle {
0% {
opacity: 0;
transform: translate(-20rpx, -20rpx) scale(0.5);
transform: translate(-24rpx, -24rpx) scale(0.5);
}
34% {
opacity: 1;
transform: translate(-20rpx, -20rpx) scale(0.5);
transform: translate(-24rpx, -24rpx) scale(0.5);
}
67% {
opacity: 1;

View File

@@ -906,6 +906,9 @@ class ApiManager {
png: 'image/png',
gif: 'image/gif',
webp: 'image/webp',
mpeg: 'audio/mpeg',
mp3: 'audio/mp3',
wav: 'audio/wav',
bmp: 'image/bmp'
}
return map[ext] || 'application/octet-stream'