This commit is contained in:
Felix
2025-12-21 21:18:57 +08:00
parent c006a2c4c7
commit 9ce8044e2a
7 changed files with 63 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
<view wx:if="{{hasScoreInfo}}">
<view class="score-modal-content {{visible ? 'show' : ''}}" catchtouchstart="noop" catchtouchmove="noop" catchtouchend="noop" catchtap="noop">
<view class="score-modal-content {{visible ? 'show' : ''}}">
<view class="score-modal-header">
<view class="score-modal-title"></view>
<t-icon name="close" class="score-modal-close" size="40rpx" bindtap="onClose" />

View File

@@ -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; }

View File

@@ -591,11 +591,11 @@ Page<IPageData, IPageInstance>({
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<IPageData, IPageInstance>({
}
// 录音事件监听(提前绑定,避免事件丢失)
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<IPageData, IPageInstance>({
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<IPageData, IPageInstance>({
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

View File

@@ -36,7 +36,7 @@
<view wx:for="{{highlightWords}}" wx:key="index"
class="overlay-word {{highlightShow ? 'show' : ''}} {{highlightZoom ? 'zoom' : ''}}"
style="left: {{item.left}}px; top: {{item.top}}px; width: {{item.width}}px; height: {{item.height}}px; {{item.transform ? ('transform: ' + item.transform) : ''}}">
<view class="overlay-text {{analizing ? 'loading-shimmer' : ''}}" style="animation-delay: {{index * 200}}ms;">{{item.text}}</view>
<!-- <view class="overlay-text {{analizing ? 'loading-shimmer' : ''}}" style="animation-delay: {{index * 200}}ms;">{{item.text}}</view> -->
<view class="overlay-text {{analizing ? 'loading-shimmer' : ''}}" style="animation-delay: {{index * 200}}ms; {{index === 0 ? 'text-transform: capitalize;' : ''}}">{{item.text}}</view>
</view>
</view>

View File

@@ -204,6 +204,9 @@ Page<IData, IPageInstance>({
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<IData, IPageInstance>({
}
})
this.onScoreTap()
}).catch(() => {
}).catch(err => {
this.setData({
isRecording: false,
overlayVisible: false,
@@ -285,7 +288,24 @@ Page<IData, IPageInstance>({
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<IData, IPageInstance>({
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<IData, IPageInstance>({
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()

View File

@@ -866,7 +866,7 @@ Page({
if (typeof msg === 'string' && msg.indexOf('积分') !== -1) {
wx.showModal({
title: '积分不足',
content: '您的积分不足,是否前往购买',
content: '您的积分不足,是否前往获取',
confirmText: '获取',
cancelText: '取消',
success: (res) => {

View File

@@ -86,7 +86,7 @@
<view class="list-item {{animateWaterfall ? 'fade-in' : ''}}" wx:for="{{selectedDateImages}}" wx:for-item="image" wx:for-index="k" wx:key="image_id" catch:tap="onImageTap" data-image-id="{{image.image_id}}" style="animation-delay: {{k * 0.15}}s;">
<t-skeleton wx:if="{{image.thumbnail_loading}}" class="full-image" row-col="{{[1]}}" animation="gradient" loading></t-skeleton>
<image wx:else class="full-image" src="{{image.thumbnail_url}}" mode="widthFix" bindload="onThumbLoaded" data-image-id="{{image.image_id}}"/>
<view wx:if="{{image.thumb_loaded}}" class="image-more-wrap" catchtap="noop">
<view wx:if="{{image.thumbnail_url}}" class="image-more-wrap" catchtap="noop">
<view class="mini-button" bindtap="onImageMoreTap" data-image-id="{{image.image_id}}">
<view class="ul-mini {{image.more_open ? 'active' : ''}}">
<view class="dot1"></view>
@@ -107,7 +107,7 @@
<view class="wf-item {{animateWaterfall ? 'fade-in' : ''}}" wx:for="{{waterfallLeft}}" wx:for-index="i" wx:key="image_id" catch:tap="onImageTap" data-image-id="{{item.image_id}}" style="animation-delay: {{i * 0.15}}s;">
<t-skeleton wx:if="{{item.thumbnail_loading}}" class="wf-image" row-col="{{[1]}}" animation="gradient" loading></t-skeleton>
<image wx:else class="wf-image" src="{{item.thumbnail_url}}" mode="widthFix" bindload="onWfThumbLoaded" data-image-id="{{item.image_id}}"/>
<view wx:if="{{item.thumb_loaded}}" class="image-more-wrap" catchtap="noop">
<view wx:if="{{item.thumbnail_url}}" class="image-more-wrap" catchtap="noop">
<view class="mini-button" bindtap="onImageMoreTap" data-image-id="{{item.image_id}}">
<view class="ul-mini {{item.more_open ? 'active' : ''}}">
<view class="dot1"></view>
@@ -125,7 +125,7 @@
<view class="wf-item {{animateWaterfall ? 'fade-in' : ''}}" wx:for="{{waterfallRight}}" wx:for-index="j" wx:key="image_id" catch:tap="onImageTap" data-image-id="{{item.image_id}}" style="animation-delay: {{j * 0.15 + 0.15}}s;">
<t-skeleton wx:if="{{item.thumbnail_loading}}" class="wf-image" row-col="{{[1]}}" animation="gradient" loading></t-skeleton>
<image wx:else class="wf-image" src="{{item.thumbnail_url}}" mode="widthFix" bindload="onWfThumbLoaded" data-image-id="{{item.image_id}}"/>
<view wx:if="{{item.thumb_loaded}}" class="image-more-wrap" catchtap="noop">
<view wx:if="{{item.thumb_lothumbnail_urladed}}" class="image-more-wrap" catchtap="noop">
<view class="mini-button" bindtap="onImageMoreTap" data-image-id="{{item.image_id}}">
<view class="ul-mini {{item.more_open ? 'active' : ''}}">
<view class="dot1"></view>