fix scroll view
This commit is contained in:
@@ -83,6 +83,7 @@ interface IData {
|
||||
fixedMode?: QuestionMode,
|
||||
canvasWidth?: number,
|
||||
canvasHeight?: number,
|
||||
showConfetti?: boolean
|
||||
confetti?: any
|
||||
nextButtonIcon?: string
|
||||
isAutoSwitching?: boolean
|
||||
@@ -300,6 +301,7 @@ Page<IData, IPageInstance>({
|
||||
fixedMode: undefined,
|
||||
canvasWidth: 0,
|
||||
canvasHeight: 0,
|
||||
showConfetti: false,
|
||||
confetti: null,
|
||||
nextButtonIcon: 'chevron-right',
|
||||
isAutoSwitching: false,
|
||||
@@ -439,7 +441,7 @@ Page<IData, IPageInstance>({
|
||||
if (depth <= 0) return 'dot-0'
|
||||
if (depth === 1) return 'dot-1'
|
||||
if (depth === 2) return 'dot-2'
|
||||
return 'dot-3'
|
||||
return 'dot-1'
|
||||
})
|
||||
this.setData({ processDotClasses: items })
|
||||
},
|
||||
@@ -597,19 +599,26 @@ Page<IData, IPageInstance>({
|
||||
},
|
||||
fireConfetti() {
|
||||
// 触发五彩纸屑效果 - 注意这是异步方法,返回Promise
|
||||
this.setData({ showConfetti: true });
|
||||
(this as any).confetti.fire({
|
||||
particleCount: 100,
|
||||
spread: 70,
|
||||
origin: { x: 0.5, y: 0.5 }
|
||||
}).then(() => {
|
||||
logger.log('五彩纸屑效果已启动');
|
||||
// 动画大概持续几秒,这里设置延迟关闭
|
||||
setTimeout(() => {
|
||||
this.setData({ showConfetti: false });
|
||||
}, 5000);
|
||||
}).catch((err: any) => {
|
||||
logger.error('启动失败', err);
|
||||
this.setData({ showConfetti: false });
|
||||
});
|
||||
},
|
||||
|
||||
resetConfetti() {
|
||||
// 重置画布,清除五彩纸屑
|
||||
this.setData({ showConfetti: false });
|
||||
(this as any).confetti?.reset?.();
|
||||
},
|
||||
|
||||
@@ -2248,8 +2257,8 @@ Page<IData, IPageInstance>({
|
||||
|
||||
let sceneList: any[] = []
|
||||
let eventList: any[] = []
|
||||
let userRole = {}
|
||||
let assistantRole = {}
|
||||
let userRole: any = null
|
||||
let assistantRole: any = null
|
||||
let style = {}
|
||||
|
||||
const hasScene = scenesSelected.length > 0
|
||||
@@ -2367,6 +2376,13 @@ Page<IData, IPageInstance>({
|
||||
assistantRole = { en: String(pair.role1_en), zh: String(pair.role1_zh || pair.role1_en) }
|
||||
}
|
||||
}
|
||||
} else if (rolesList.length > 0) {
|
||||
// 如果没有选择角色,随机选择一个并默认分配 role1 给 user
|
||||
const pair = rolesList[Math.floor(Math.random() * rolesList.length)]
|
||||
if (pair) {
|
||||
userRole = { en: String(pair.role1_en), zh: String(pair.role1_zh || pair.role1_en) }
|
||||
assistantRole = { en: String(pair.role2_en), zh: String(pair.role2_zh || pair.role2_en) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -276,11 +276,10 @@
|
||||
<view class="bottom-bar {{contentVisible ? 'show' : ''}}" wx:if="{{questionMode !== 'conversation'}}">
|
||||
<t-icon name="chevron-left" class="bottom-btn {{currentIndex <= 0 ? 'disabled' : ''}}" size="48rpx" bind:tap="onPrevTap" />
|
||||
<t-icon name="{{isPlaying ? 'pause' : 'play'}}" class="bottom-btn" size="48rpx" bind:tap="playStandardVoice" />
|
||||
<!-- <t-icon name="swap" class="bottom-btn" size="48rpx" bind:tap="toggleMode" /> -->
|
||||
<t-icon name="fact-check" class="bottom-btn {{resultDisplayed ? '' : 'disabled'}}" size="48rpx" bind:tap="onScoreTap" />
|
||||
<t-icon name="{{nextButtonIcon || 'chevron-right'}}" class="bottom-btn {{(qaList && (currentIndex >= qaList.length - 1)) ? 'disabled' : ''}}" size="48rpx" bind:tap="onNextTap" />
|
||||
</view>
|
||||
<t-drawer visible="{{historyVisible}}" placement="left" bind:visible-change="onHistoryDrawerClose" close-btn="{{true}}">
|
||||
<t-drawer visible="{{historyVisible}}" placement="left" bind:visible-change="onHistoryDrawerClose" close-btn="{{true}}">
|
||||
<scroll-view scroll-y class="history-drawer-scroll" bindscrolltolower="onHistoryScrollBottom">
|
||||
<view class="history-list">
|
||||
<t-cell
|
||||
@@ -384,66 +383,66 @@
|
||||
<text class="modal-title">题目解析</text>
|
||||
<t-icon name="close" class="modal-close" size="40rpx" bind:tap="onCloseDetailModal" />
|
||||
</view>
|
||||
<scroll-view class="detail-body" scroll-y="{{true}}">
|
||||
<view class="section">
|
||||
<text class="question-text">{{qaDetailQuestionText}}</text>
|
||||
</view>
|
||||
<view class="section">
|
||||
<view class="overview-card {{qaDetailResultStatus}}">
|
||||
<view class="overview-icon">
|
||||
<t-icon name="{{qaDetailIconName}}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="overview-content">
|
||||
<text class="overview-label">评估详情 (EVALUATION DETAIL)</text>
|
||||
<text class="overview-text">{{qaDetailOverviewText}}</text>
|
||||
<scroll-view class="detail-body" scroll-y="{{true}}">
|
||||
<view class="section">
|
||||
<text class="question-text">{{qaDetailQuestionText}}</text>
|
||||
</view>
|
||||
<view class="section">
|
||||
<view class="overview-card {{qaDetailResultStatus}}">
|
||||
<view class="overview-icon">
|
||||
<t-icon name="{{qaDetailIconName}}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="overview-content">
|
||||
<text class="overview-label">评估详情 (EVALUATION DETAIL)</text>
|
||||
<text class="overview-text">{{qaDetailOverviewText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:for="{{qaDetailBlocks}}" wx:key="index">
|
||||
<view class="section" wx:if="{{item.items && item.items.length}}">
|
||||
<!-- <text class="section-title">{{item.title}}</text> -->
|
||||
<view wx:if="{{item.variant === 'incorrect'}}" class="detail-row incorrect">
|
||||
<view class="detail-icon">
|
||||
<t-icon name="{{item.iconName || 'data-error' }}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<text class="detail-label">错误选项</text>
|
||||
<view class="detail-items incorrect-list">
|
||||
<view class="incorrect-item" wx:for="{{item.items}}" wx:key="index">
|
||||
<view class="incorrect-head">
|
||||
<view class="chip incorrect">{{item.content}}</view>
|
||||
<text class="error-type">{{item.error_type}}</text>
|
||||
<block wx:for="{{qaDetailBlocks}}" wx:key="index">
|
||||
<view class="section" wx:if="{{item.items && item.items.length}}">
|
||||
<!-- <text class="section-title">{{item.title}}</text> -->
|
||||
<view wx:if="{{item.variant === 'incorrect'}}" class="detail-row incorrect">
|
||||
<view class="detail-icon">
|
||||
<t-icon name="{{item.iconName || 'data-error' }}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<text class="detail-label">错误选项</text>
|
||||
<view class="detail-items incorrect-list">
|
||||
<view class="incorrect-item" wx:for="{{item.items}}" wx:key="index">
|
||||
<view class="incorrect-head">
|
||||
<view class="chip incorrect">{{item.content}}</view>
|
||||
<text class="error-type">{{item.error_type}}</text>
|
||||
</view>
|
||||
<text class="error-reason">{{item.error_reason}}</text>
|
||||
</view>
|
||||
<text class="error-reason">{{item.error_reason}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.variant === 'info'}}" class="detail-row your-choice {{qaDetailResultStatus}}">
|
||||
<view class="detail-icon">
|
||||
<t-icon name="{{item.iconName || 'info-circle' }}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<text class="detail-label">{{item.title}}</text>
|
||||
<view class="detail-items">
|
||||
<text class="detail-item" wx:for="{{item.items}}" wx:key="index">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.variant !== 'incorrect' && item.variant !== 'info'}}" class="detail-row {{item.variant}}">
|
||||
<view class="detail-icon">
|
||||
<t-icon name="{{item.iconName || 'info-circle' }}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<text class="detail-label">{{item.title}}</text>
|
||||
<view class="detail-items">
|
||||
<text class="detail-item" wx:for="{{item.items}}" wx:key="index">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.variant === 'info'}}" class="detail-row your-choice {{qaDetailResultStatus}}">
|
||||
<view class="detail-icon">
|
||||
<t-icon name="{{item.iconName || 'info-circle' }}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<text class="detail-label">{{item.title}}</text>
|
||||
<view class="detail-items">
|
||||
<text class="detail-item" wx:for="{{item.items}}" wx:key="index">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.variant !== 'incorrect' && item.variant !== 'info'}}" class="detail-row {{item.variant}}">
|
||||
<view class="detail-icon">
|
||||
<t-icon name="{{item.iconName || 'info-circle' }}" size="40rpx" color="#fff" />
|
||||
</view>
|
||||
<view class="detail-content">
|
||||
<text class="detail-label">{{item.title}}</text>
|
||||
<view class="detail-items">
|
||||
<text class="detail-item" wx:for="{{item.items}}" wx:key="index">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="completion-popup-mask" wx:if="{{showCompletionPopup}}">
|
||||
@@ -467,5 +466,5 @@
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<vx-confetti id="confetti" class="confetti-canvas" width="{{canvasWidth}}" height="{{canvasHeight}}"></vx-confetti>
|
||||
<vx-confetti id="confetti" class="confetti-canvas {{showConfetti ? 'show' : ''}}" width="{{canvasWidth}}" height="{{canvasHeight}}"></vx-confetti>
|
||||
</view>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* padding-bottom: calc(110rpx + env(safe-area-inset-bottom)); */
|
||||
/* transition: padding-bottom 0.3s ease; */
|
||||
transition: margin-bottom 0.3s ease;
|
||||
}
|
||||
.inner-scroll {
|
||||
@@ -38,8 +37,7 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
/* height: 100%; */
|
||||
height: 500rpx;
|
||||
height: 100%;
|
||||
}
|
||||
.chat-mode-scroll {
|
||||
/* padding-bottom: calc(110rpx + env(safe-area-inset-bottom)); */
|
||||
@@ -681,6 +679,7 @@
|
||||
}
|
||||
|
||||
.confetti-canvas {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@@ -690,6 +689,10 @@
|
||||
pointer-events: none; /* 确保canvas不会阻挡点击事件 */
|
||||
}
|
||||
|
||||
.confetti-canvas.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.type-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -701,7 +704,7 @@
|
||||
position: relative;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 100;
|
||||
z-index: 99;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user