Browse Source

style:修改标题居中和聊天框宽度

xianna.liang 8 months ago
parent
commit
ef0fb09753
6 changed files with 44 additions and 37 deletions
  1. 1 1
      App.vue
  2. 8 8
      pages/index15/index15.vue
  3. 9 9
      pages/index32/index32.vue
  4. 13 8
      theme/chat15.css
  5. 11 10
      theme/chat32.css
  6. 2 1
      until/request.js

+ 1 - 1
App.vue

@@ -14,7 +14,7 @@
 					console.log(screenHeight, screenWidth)
 				}
 			})
-			if (screenHeight == 720 && screenWidth == 1280) {
+			if (screenHeight == 768 && screenWidth == 1024) {
 				uni.redirectTo({
 					url: '/pages/index15/index15'
 				})

+ 8 - 8
pages/index15/index15.vue

@@ -1,11 +1,11 @@
 <template>
 	<view id='app'>
+		<view class="head">
+			<text>睿宝AI</text>
+		</view>
 		<view class="pageView">
 			<view class="sidebar-left"></view>
 			<view class="body">
-				<view class="head">
-					<text>睿宝AI</text>
-				</view>
 				<view class="list-wrap">
 					<scroll-view id="content-box" scroll-y="true" class="scrollview" :scroll-top="msgList.scrollTop">
 						<!-- 聊天主体 -->
@@ -107,7 +107,7 @@
 			msgList.chatList.push(obj)
 
 			obj.otherContent = await GetNewsList(data)
-			await sleep(16000);
+			// await sleep(16000);
 			getChatContent(obj.otherContent, msgList.len)
 		}
 		
@@ -145,9 +145,9 @@
 
 	// ------- 聊天逐字输出 -----------
 	// 延时函数
-	const sleep = ((delaytime = 10000) => {
-		return new Promise(resolve => setTimeout(resolve, delaytime));
-	})
+	// const sleep = ((delaytime = 10000) => {
+	// 	return new Promise(resolve => setTimeout(resolve, delaytime));
+	// })
 
 	// 逐字显示内容
 	const getChatContent = ((text, index) => {
@@ -162,7 +162,7 @@
 				msgList.otherChatList[index - 1] = nowStr;
 			}
 
-		}, 200);
+		}, 50);
 		msgList.textCount = 0
 		msgList.isloading[index - 1] = false
 		msgList.isClick = !msgList.isClick

+ 9 - 9
pages/index32/index32.vue

@@ -1,12 +1,12 @@
 <template>
 	<view id='app'>
 		<view class="placeholder"></view>
+		<view class="head">
+			<text>睿宝AI</text>
+		</view>
 		<view class="pageView">
 			<view class="sidebar-left"></view>
 			<view class="body">
-				<view class="head">
-					<text>睿宝AI</text>
-				</view>
 				<view class="list-wrap">
 					<scroll-view id="content-box" scroll-y="true" class="scrollview" :scroll-top="msgList.scrollTop">
 						<!-- 聊天主体 -->
@@ -40,7 +40,7 @@
 								confirm-type="send" @confirm="handleSend" maxlength="300" />
 						</view>
 						<view class="uni-button">
-							<button class="send-btn" @click="handleSend" type="primary">发送</button>
+							<button class="send-btn" @click="handleSend" type="primary" :disabled="msgList.isClick">发送</button>
 						</view>
 					</view>
 				</view>
@@ -105,7 +105,7 @@
 
 			obj.otherContent = await GetNewsList(data)
 
-			await sleep(16000);
+			// await sleep(16000);
 			getChatContent(obj.otherContent, msgList.len)
 
 
@@ -146,9 +146,9 @@
 	
 	// ------- 聊天逐字输出 -----------
 	// 延时函数
-	const sleep = ((delaytime = 10000) => {
-		return new Promise(resolve => setTimeout(resolve, delaytime));
-	})
+	// const sleep = ((delaytime = 10000) => {
+	// 	return new Promise(resolve => setTimeout(resolve, delaytime));
+	// })
 	
 	// 逐字显示内容
 	const getChatContent = ((text, index) => {
@@ -164,7 +164,7 @@
 				msgList.otherChatList[index - 1] = nowStr;
 			}
 	
-		}, 200);
+		}, 50);
 		console.log(msgList.timer)
 		msgList.textCount = 0
 		msgList.isloading[index - 1] = false

+ 13 - 8
theme/chat15.css

@@ -1,7 +1,16 @@
 /* 15寸 大屏样式 */
 
+/* --- 标题 --- */
+.head {
+	height: 5vh;
+	text-align: center;
+	line-height: 5vh;
+	background-color: #f5f5f5;
+	font-size: 18px;
+}
 
 .pageView {
+	height: 95%;
 	display: flex;
 	background-color: #f5f5f5;
 }
@@ -9,16 +18,11 @@
 .body {
 	display: flex;
 	flex-direction: column;
-	height: 100vh;
+	height: 95vh;
 	width: 75%;
 }
 
-/* --- 头部 --- */
-.head {
-	height: 100rpx;
-	text-align: center;
-	line-height: 100rpx;
-}
+
 
 /* --- 主内容区 --- */
 .list-wrap {
@@ -51,7 +55,7 @@
 
 .list-wrap .scrollview .scrollview-item .item .content {
 	position: relative;
-	max-width: 750rpx;
+	max-width: 850rpx;
 	background-color: #fff;
 	margin: 40rpx 24rpx 0;
 	border-radius: 5px;
@@ -59,6 +63,7 @@
 	line-height: 42rpx;
 	padding: 24rpx;
 	word-wrap: break-word;
+	
 }
 
 .list-wrap .scrollview .scrollview-item .other {

+ 11 - 10
theme/chat32.css

@@ -6,6 +6,14 @@
 
 }
 
+/* --- 标题 --- */
+.head {
+	height: 5vh;
+	background-color: #f5f5f5;
+	text-align: center;
+	line-height: 5vh;
+}
+
 .pageView {
 	display: flex;
 	background-color: #f5f5f5;
@@ -14,18 +22,11 @@
 .body {
 	display: flex;
 	flex-direction: column;
-	height: 60vh;
+	height: 55vh;
 	width: 70%;
 	/* background-color: #f5f5f5; */
 }
 
-/* --- 头部 --- */
-.head {
-	height: 100rpx;
-	/* background-color: #f5f5f5; */
-	text-align: center;
-	line-height: 100rpx;
-}
 
 /* --- 主内容区 --- */
 .list-wrap {
@@ -58,7 +59,7 @@
 
 .list-wrap .scrollview .scrollview-item .item .content {
 	position: relative;
-	max-width: 750rpx;
+	max-width: 850rpx;
 	background-color: #fff;
 	margin: 40rpx 24rpx 0;
 	border-radius: 5px;
@@ -122,7 +123,7 @@
 
 .sidebar-right {
 	width: 25%;
-	height: 60vh;
+	height: 55vh;
 	position: relative;
 }
 

+ 2 - 1
until/request.js

@@ -7,7 +7,8 @@ const axios = Axios.create({
 		'Content-Type': 'application/json'
 	},
 	timeout: 600000, // 超时
-	baseURL: 'http://192.168.0.166:5000' ,
+	// baseURL: 'http://192.168.0.166:5000' ,
+	baseURL: 'http://192.168.1.105:5000' ,
 	adapter: axiosAdapterUniapp
 })