From a9d82ee818e96249634927847060177aa7dafe6a Mon Sep 17 00:00:00 2001
From: yuanhao <yuanhao_2024>
Date: 星期三, 04 六月 2025 10:14:38 +0800
Subject: [PATCH] fix: 根据后端修改验证

---
 pages/aiQuestions/aiQuestions.vue |   76 +++++++++++++++++++++-----------------
 1 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/pages/aiQuestions/aiQuestions.vue b/pages/aiQuestions/aiQuestions.vue
index 662c028..c3e4c7e 100644
--- a/pages/aiQuestions/aiQuestions.vue
+++ b/pages/aiQuestions/aiQuestions.vue
@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="head" :class="{'isOn':showSet||showHistory}">
 			<view class="box">
-				<image class="back-img" @click='toBack' src="/static/back.png" mode=""></image>
+				<!--  <image class="back-img" @click='toBack' src="/static/back.png" mode=""></image> -->
 				<image v-if='details.appImg' class="logo" :src="baseUrl+details.appImg" mode="aspectFill" alt="">
 				</image>
 				<image v-else class="logo" src="/static/question/logo.png" mode="aspectFill" alt=""></image>
@@ -11,18 +11,19 @@
 						{{ details.appName }}
 					</view>
 					<view class="f">
-						闂瓟
+						璐㈡斂AI鍔╂墜
 					</view>
 				</view>
 			</view>
 			<view class="box-right">
-				<image src="/static/question/mute.png" mode=""></image>
-				<image style="width:40rpx;height:40rpx;" @click="showHistory=!showHistory;showSet=false"
+				<!--  <image src="/static/question/mute.png" mode=""></image> -->
+				<image style="width:40rpx;height:40rpx;" @click="getTalkList();showHistory=!showHistory;showSet=false; "
 					src="/static/time.png" mode=""></image>
-				<image @click="showSet=!showSet;showHistory=false" src="/static/question/set.png" mode=""></image>
+					<!-- <image @click="" src="/static/icons/add.svg" mode=""></image> -->
+				<!-- <image @click="showSet=!showSet;showHistory=false" src="/static/question/set.png" mode=""></image>-->
 			</view>
 		</view>
-		<scroll-view class="ltbox" scroll-y="true" :scroll-into-view="intoView" v-if="msgList">
+		<scroll-view class="ltbox" scroll-y="true" :scroll-into-view="intoView" v-if="msgList.length">
 			<block v-if="details.appId">
 				<view v-if="msgList&&msgList.length===0" class="wbox">
 					<image src="/static/exam/bg02.png" mode="widthFix" class="bg2" alt=""></image>
@@ -72,16 +73,9 @@
 								<view class="copy" @click='clickCopy(item.aiLog)'>
 									<image src="/static/question/copy.png" mode=""></image>
 								</view>
-								<view class="copy" @click="clickPlay(item)">
-									<image src="/static/question/sount1.png" v-if="item.isPlay==0"></image>
-									<u-loading v-if="item.isPlay==1" mode="flower" size="34"></u-loading>
-									<image src="/static/question/sount2.png" v-if="item.isPlay==2"></image>
-									<!-- <u-icon v-if="item.isPlay==0" name="volume" size="34"></u-icon>
-									<u-loading v-if="item.isPlay==1" mode="flower" size="34"></u-loading>
-									<u-icon v-if="item.isPlay==2" name="pause-circle" size="34"></u-icon> -->
-								</view>
 							</view>
-							<view class="function-right">
+							<!-- 
+								<view class="function-right">
 								<u-icon name="thumb-up-fill" @click='clickLikes(item)' v-if="item.isLike"
 									color="#2468F2" size="40"></u-icon>
 								<u-icon name="thumb-up" @click='clickLikes(item)' v-else color="#98a1b2"
@@ -90,7 +84,8 @@
 									color="#2468F2" size="40"></u-icon>
 								<u-icon name="thumb-down" @click="clickDislikes(item)" v-else color="#98a1b2"
 									size="40"></u-icon>
-							</view>
+							</view>	
+							-->
 						</view>
 					</view>
 				</view>
@@ -102,6 +97,10 @@
 			</view>
 			<view id="bot"></view>
 		</scroll-view>
+		<view v-else class="tips">
+			鎴戞槸璐㈡斂AI鍔╂墜锛屽緢楂樺叴瑙佸埌浣狅紒鎴戝彲浠ュ洖绛旈」鐩枃妗d腑鐨勫悇绉嶉棶棰橈紝杈撳叆闂蹇潵浣撻獙鍚э紒
+		</view>
+			
 		<audio id="audio" src=""></audio>
 		<view class="btmbox" :class="{'isOn':showKnow}">
 			<view v-if="!voiceFlg" class="know-btn" :class="{'active-btn':showKnow}" @click="showKnow=true">
@@ -114,8 +113,8 @@
 				<block v-if="!recording">
 					<image v-if="voiceFlg" src="/static/wd/i03.png" mode="widthFix" class="btnimg2" @click="clickType"
 						alt=""></image>
-					<image v-else src="/static/wd/i04.png" mode="widthFix" class="btnimg2" @click="clickType" alt="">
-					</image>
+					<!--  <image v-else src="/static/wd/i04.png" mode="widthFix" class="btnimg2" @click="clickType" alt="">
+					</image> -->
 				</block>
 				<view @touchstart="touchstartVoice" @touchmove.stop.prevent="touchmoveVoice" @touchend="touchendVoice"
 					@touchcancel="touchcancelVoice" class="u-flex-1 u-text-center tap-btn" v-if="voiceFlg">
@@ -199,12 +198,12 @@
 		<u-popup v-model="showKnow" mode='bottom' border-radius="20">
 			<view class="know-box">
 				<view class="title">
-					<view>閫夋嫨鐭ヨ瘑搴� </view>
+					<view>閫夋嫨椤圭洰 </view>
 					<image @click='showKnow=false;'  src="/static/wd/close.png"></image>
 				</view>
 				<view class="sbox">
 					<u-search @search="search" @custom="toSearch" height="80" bg-color="#F9FAFB" @clear="search"
-						v-model="keyword" :show-action="true" shape="round" placeholder="鎼滅储鐭ヨ瘑搴�">
+						v-model="keyword" :show-action="true" shape="round" placeholder="鎼滅储椤圭洰">
 					</u-search>
 				</view>
 				<view class='all-know'>
@@ -383,8 +382,12 @@
 			}
 		},
 		onLoad(options) {
-			this.appId = options.id
-			this.toCheck(this.appId)
+			this.appId = options.id || 1
+			this.userId = options.userId || 1
+			// this.toCheck(this.appId)
+			this.openRecord();
+			this.getDetails()
+			this.getTalkList();
 		},
 		onReady() {
 			this.con = document.getElementById('bot');
@@ -502,10 +505,11 @@
 				})
 			},
 			getDetails() {
-				getInfo(this.appId).then(val => {
-					this.details = val.data
-					this.knowIds = this.details.knowIds;
-					getAppKnowList(this.appId).then(res => {
+				// getInfo(this.appId).then(val => {
+				// 	this.details = val.data
+				// 	this.knowIds = this.details.knowIds;
+				// })
+				getAppKnowList(this.appId).then(res => {
 						this.knowList = res.data;
 						this.knowList.forEach(item => {
 							if (this.knowIds.some(e => e == item.knowId)) {
@@ -515,7 +519,6 @@
 							}
 						})
 					})
-				})
 			},
 			clickType() {
 				if (this.isDisabled) return
@@ -540,7 +543,7 @@
 					// 浼氳瘽 ID
 					sessionId: log.sessionId,
 					// 褰撳墠鐢ㄦ埛鐨� ID
-					userId: this.userInfo.userId
+					userId: this.userId || 1
 				}
 				// 璋冪敤 qaFeedBack 鎺ュ彛鎻愪氦鐐硅禐鍙嶉
 				updSessionLogFeedBack({
@@ -559,7 +562,7 @@
 					isOverall: 0,
 					sessionLogId: log.sessionLogId,
 					sessionId: log.sessionId,
-					userId: this.userInfo.userId
+					userId: this.userId
 				}
 				updSessionLogFeedBack({
 					sessionLogId: log.sessionLogId,
@@ -653,7 +656,7 @@
 					let addTalkInfor = await addTalk({
 						"appId": this.appId,
 						"sessionName": this.msg,
-						"userId": this.userInfo.userId
+						"userId": this.userId
 					})
 					this.sessionId = addTalkInfor.data.sessionId
 				}
@@ -662,7 +665,7 @@
 				let item = {
 					sessionLogId: '',
 					sessionId: this.sessionId,
-					userId: this.userInfo.userId,
+					userId: this.userId,
 					userLog: this.msg,
 					userSound: '',
 					docInfo: [],
@@ -701,7 +704,7 @@
 							"question": item.userLog,
 							"llm_name": this.chooseLlm.value,
 							"app_id": this.appId,
-							"user_id": this.userInfo.userId,
+							"user_id": this.userId,
 							"session_id": item.sessionId,
 							"session_log_id": item.sessionLogId,
 							"param_key": "know_id",
@@ -1494,14 +1497,19 @@
 		box-sizing: border-box;
 		padding: 20rpx 20rpx 0;
 	}
-
+	.tips{
+		padding: 48rpx;
+		background: #fff;
+		border-radius: 24rpx;
+		margin: 40rpx;
+	}
 	.msgbox1 {
 		margin-bottom: 20rpx;
 
 		.function-box {
 			display: flex;
 			align-items: center;
-			justify-content: space-between;
+			justify-content: flex-end;
 			margin-top: 24rpx;
 
 			.function-left {

--
Gitblit v1.9.1