辩论结束跳转复盘,并传递数据到复盘

main
weidoudou7 2 months ago
parent ec278aab9b
commit af00d8c8e8

@ -76,6 +76,10 @@
<view class="progress-inner" :style="{ width: progressPercentage + '%' }"></view>
</view>
<view class="rounds-counter">{{ currentRound }}/{{ debateRounds }}</view>
<!-- 添加复盘按钮 -->
<view v-if="showReviewButton" class="review-button" @click="showReviewModal">
<image src="/static/icons/file-chart-line.png" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
@ -126,7 +130,23 @@
</view>
</view>
<button class="confirm-button" @click="confirmRounds"></button>
<button class="confirm-button-selectRounds" @click="confirmRounds"></button>
</view>
</view>
<!-- 复盘确认弹窗 -->
<view v-if="showReviewConfirm" class="review-confirm-mask" @click="showReviewConfirm = false">
<view class="review-confirm-popup" @click.stop>
<view class="popup-header">
<view class="popup-title">辩论完成</view>
</view>
<view class="popup-content">
<text>辩论已完成{{ debateRounds }}回合是否立即进行复盘分析</text>
</view>
<view class="popup-buttons">
<button class="cancel-button" @click="showReviewConfirm = false">稍后再说</button>
<button class="confirm-button-gotoReview" @click="startReview"></button>
</view>
</view>
</view>
@ -179,6 +199,9 @@ export default {
currentRound: 0, //
selectedOption: 0, //
showReviewConfirm: false,//
showReviewButton: false,//
scrollToView: "",
content: "",
debateTopics: [
@ -201,6 +224,18 @@ export default {
},
},
watch: {
//
currentRound(newVal) {
if (newVal >= this.debateRounds && this.debateRounds > 0) {
//
setTimeout(() => {
this.showReviewConfirm = true;
}, 1000);
}
}
},
methods: {
handleSheetClick() {
const pinia = this.$pinia;
@ -349,6 +384,11 @@ export default {
});
};
if (this.currentRound >= this.debateRounds) {
//
this.showReviewButton = true;
return;
}
},
@ -427,6 +467,8 @@ export default {
this.currentRound = 0;
this.roundsSelected = true;
this.showRoundsPopup = false;
this.showReviewButton = false;
this.showReviewConfirm = false;
//
this.message = [{
@ -435,6 +477,38 @@ export default {
}];
this.scrollToBottom();
},
//
startReview() {
// //
// let history = this.messages
// .filter((msg) => !msg.loading)
// .map((msg) => {
// if (msg.role === 'user') {
// return '${ msg.content}';
// } else if (msg.role === 'ai') {
// return 'AI ${ msg.content}';
// }
// return '';
// }).join('\n');
//
// //store
// const pinia = this.$pinia;
// const store = useDebateStore(pinia);
// store.setDebate(history);
// //
// this.$emit('tab-change', 3);
this.onLongPress();
//
this.showReviewConfirm = false;
},
//
showReviewModal() {
this.showReviewConfirm = true;
},
},
};
</script>
@ -700,7 +774,6 @@ export default {
opacity: 0;
transform: translateY(20rpx);
}
to {
opacity: 1;
transform: translateY(0);
@ -1188,7 +1261,7 @@ export default {
color: white;
}
.confirm-button {
.confirm-button-selectRounds {
background: #6839E0;
color: white;
border-radius: 0;
@ -1198,4 +1271,102 @@ export default {
font-weight: 600;
border: none;
}
/* 复盘确认弹窗样式 */
.review-confirm-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 2000;
animation: fadeIn 0.3s;
}
.review-confirm-popup {
width: 80%;
max-width: 600rpx;
background: white;
border-radius: 28rpx;
overflow: hidden;
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.3);
}
.popup-header {
padding: 30rpx;
background: #7C3AED;
text-align: center;
}
.popup-title {
font-size: 36rpx;
font-weight: 700;
color: white;
}
.popup-content {
padding: 40rpx 30rpx;
font-size: 30rpx;
color: #333;
text-align: center;
line-height: 1.6;
}
.popup-buttons {
display: flex;
padding: 20rpx;
border-top: 1rpx solid #eee;
}
.cancel-button {
flex: 1;
background: #f5f5f5;
color: #666;
border-radius: 12rpx;
margin-right: 15rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
}
.confirm-button-gotoReview {
flex: 1;
background: #6839E0;
color: white;
border-radius: 12rpx;
margin-left: 15rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
}
/* 复盘按钮样式 */
.review-button {
width: 50rpx;
height: 50rpx;
margin-left: 20rpx;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
padding: 8rpx;
}
.review-button image {
width: 100%;
height: 100%;
filter: brightness(0) invert(1);
}
/* 调整进度条容器布局 */
.progress-container {
flex: 1;
display: flex;
align-items: center;
}
</style>

Loading…
Cancel
Save