diff --git a/miniprogram/components/score-modal/score-modal.wxml b/miniprogram/components/score-modal/score-modal.wxml index 9c14489..b9fb826 100644 --- a/miniprogram/components/score-modal/score-modal.wxml +++ b/miniprogram/components/score-modal/score-modal.wxml @@ -1,5 +1,5 @@ - + diff --git a/miniprogram/components/score-modal/score-modal.wxss b/miniprogram/components/score-modal/score-modal.wxss index 9003941..6e6a238 100644 --- a/miniprogram/components/score-modal/score-modal.wxss +++ b/miniprogram/components/score-modal/score-modal.wxss @@ -21,7 +21,7 @@ .score-modal-close { position: absolute; top: 12rpx; right: 12rpx; color: #666; } .score-container { height: 100vh; } .score-image-container { display: flex; align-items: center; padding: 0 0 0 12rpx; min-height: 120rpx; } -.score-text { flex: 1; font-size: 30rpx; line-height: 42rpx; color: #001858; font-weight: 600; word-break: break-word; } +.score-text { flex: 1; font-size: 30rpx; line-height: 42rpx; color: #001858; font-weight: 600; word-break: break-word; text-transform: capitalize;} .score-modal-play { flex-shrink: 0; margin-right: 20rpx; } .score-overview {} .score-circles { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 24rpx; } diff --git a/miniprogram/pages/assessment/assessment.ts b/miniprogram/pages/assessment/assessment.ts index ea736ca..b06d15f 100644 --- a/miniprogram/pages/assessment/assessment.ts +++ b/miniprogram/pages/assessment/assessment.ts @@ -591,11 +591,11 @@ Page({ logger.info('---lisa-handleRecordEnd') this.stopRecording() // 淡出高亮层 - // this.setData({ overlayVisible: false }) - // const timer = setTimeout(() => { - // this.setData({ highlightShow: false, highlightZoom: false, focusTransform: '', highlightWords: [] }) - // clearTimeout(timer) - // }, 320) + this.setData({ overlayVisible: false }) + const timer = setTimeout(() => { + this.setData({ highlightShow: false, highlightZoom: false, focusTransform: '', highlightWords: [] }) + clearTimeout(timer) + }, 320) }, // 点击图片预览 @@ -1251,6 +1251,9 @@ Page({ } // 录音事件监听(提前绑定,避免事件丢失) + try { (recorderManager as any).offStop && (recorderManager as any).offStop() } catch (e) {} + try { (recorderManager as any).offError && (recorderManager as any).offError() } catch (e) {} + recorderHandlersBound = false if (!recorderHandlersBound) { recorderManager.onStop((res) => { const ms = Date.now() - this.data.recordStartTime @@ -1323,7 +1326,24 @@ Page({ highlightWords: [], analizing: false }) - wx.showToast({ title: '评估失败', icon: 'none' }) + const msg = (err as any)?.message || '' + if (typeof msg === 'string' && msg.indexOf('积分') !== -1) { + wx.showModal({ + title: '积分不足', + content: '您的积分不足,是否前往获取?', + confirmText: '获取', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + wx.redirectTo({ url: '/pages/coupon/coupon' }) + } else { + // wx.navigateBack({ delta: 1 }) + } + } + }) + } else { + wx.showToast({ title: msg || '评估失败', icon: 'none' }) + } // wx.hideLoading() }).finally(() => { this.setData({ @@ -1424,6 +1444,9 @@ Page({ if (this.audioContext) { this.audioContext.destroy() } + try { (recorderManager as any).offStop && (recorderManager as any).offStop() } catch (e) {} + try { (recorderManager as any).offError && (recorderManager as any).offError() } catch (e) {} + recorderHandlersBound = false if (this.circleAnimTimer) { clearInterval(this.circleAnimTimer) this.circleAnimTimer = undefined diff --git a/miniprogram/pages/assessment/assessment.wxml b/miniprogram/pages/assessment/assessment.wxml index 6a0f229..d80611b 100644 --- a/miniprogram/pages/assessment/assessment.wxml +++ b/miniprogram/pages/assessment/assessment.wxml @@ -36,7 +36,7 @@ - {{item.text}} + {{item.text}} diff --git a/miniprogram/pages/scene_sentence/scene_sentence.ts b/miniprogram/pages/scene_sentence/scene_sentence.ts index 64e9f0d..ee1bed8 100644 --- a/miniprogram/pages/scene_sentence/scene_sentence.ts +++ b/miniprogram/pages/scene_sentence/scene_sentence.ts @@ -204,6 +204,9 @@ Page({ this.audioCtx.onStop(() => { this.setData({ isPlaying: false }) }) this.audioCtx.onError(() => { this.setData({ isPlaying: false }) }) } + try { (recorderManager as any).offStop && (recorderManager as any).offStop() } catch (e) {} + try { (recorderManager as any).offError && (recorderManager as any).offError() } catch (e) {} + recorderHandlersBound = false if (!recorderHandlersBound) { recorderManager.onStop((res) => { const ms = Date.now() - (this.data.recordStartTime || 0) @@ -276,7 +279,7 @@ Page({ } }) this.onScoreTap() - }).catch(() => { + }).catch(err => { this.setData({ isRecording: false, overlayVisible: false, @@ -285,7 +288,24 @@ Page({ highlightWords: [], analizing: false }) - wx.showToast({ title: '评估失败', icon: 'none' }) + const msg = (err as any)?.message || '' + if (typeof msg === 'string' && msg.indexOf('积分') !== -1) { + wx.showModal({ + title: '积分不足', + content: '您的积分不足,是否前往获取?', + confirmText: '获取', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + wx.redirectTo({ url: '/pages/coupon/coupon' }) + } else { + // wx.navigateBack({ delta: 1 }) + } + } + }) + } else { + wx.showToast({ title: msg || '评估失败', icon: 'none' }) + } }).finally(() => { this.setData({ isRecording: false, @@ -354,14 +374,8 @@ Page({ const cur = scene && scene.list && scene.list[idx] ? scene.list[idx] : undefined const currentSentence = cur ? { content: cur.sentenceEn, file_id: cur.pronunciationUrl || undefined, id: cur.imageTextId } : undefined const englishWords = cur && cur.sentenceEn ? cur.sentenceEn.split(' ') : [] - const commonMistakes = (cur as any)?.commonMistakes || [ - '1. 漏冠词a(×bowl mint leaves)', - '2. refreshing误读为/ˈrefrʌʃɪŋ/' - ] - const pragmaticAlternative = (cur as any)?.pragmaticAlternative || [ - 'This bowl of mint leaves appears very refreshing.(更书面)', - 'These mint leaves look crisp and fresh.(强调口感)' - ] + const commonMistakes = (cur as any)?.commonMistakes || [] + const pragmaticAlternative = (cur as any)?.pragmaticAlternative || [] const responsePairs = (cur as any)?.responsePairs || [] this.setData({ scene, @@ -1127,6 +1141,9 @@ Page({ clearInterval(this.pollTimer) this.pollTimer = undefined } + try { (recorderManager as any).offStop && (recorderManager as any).offStop() } catch (e) {} + try { (recorderManager as any).offError && (recorderManager as any).offError() } catch (e) {} + recorderHandlersBound = false if (this.audioCtx) { try { this.audioCtx.destroy() diff --git a/miniprogram/pages/upload/upload.ts b/miniprogram/pages/upload/upload.ts index c1c2f1c..4a473d1 100755 --- a/miniprogram/pages/upload/upload.ts +++ b/miniprogram/pages/upload/upload.ts @@ -866,7 +866,7 @@ Page({ if (typeof msg === 'string' && msg.indexOf('积分') !== -1) { wx.showModal({ title: '积分不足', - content: '您的积分不足,是否前往购买?', + content: '您的积分不足,是否前往获取?', confirmText: '获取', cancelText: '取消', success: (res) => { diff --git a/miniprogram/pages/upload/upload.wxml b/miniprogram/pages/upload/upload.wxml index 35dfa5d..e66d2ba 100755 --- a/miniprogram/pages/upload/upload.wxml +++ b/miniprogram/pages/upload/upload.wxml @@ -86,7 +86,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -125,7 +125,7 @@ - +