From a12818479aac56a0c08206ce4dcf4ede092e9376 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期四, 14 十一月 2024 16:20:52 +0800
Subject: [PATCH] 判断是否是新老用户

---
 src/views/project/ch/home/Home.vue |  112 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 82 insertions(+), 30 deletions(-)

diff --git a/src/views/project/ch/home/Home.vue b/src/views/project/ch/home/Home.vue
index a791732..521b04c 100644
--- a/src/views/project/ch/home/Home.vue
+++ b/src/views/project/ch/home/Home.vue
@@ -1,26 +1,31 @@
 <template>
-	<div class="pc-chat_room">
+	<div class="pc-chat_room h-full">
 		<div class="flex h100 w100">
 			<div class="pc-chat_right">
-				<div class="w100 h100 overflow-auto">
+				<div class="w100 h100 overflow-hidden">
 					<div class="pc-chatRoom w100 h100">
-						<div class="homeBox w100">
-							<div class="flex items-center flex-column mt-20">
-								<div class="flex items-center flex-column" v-if="!isShowChat">
-									<waterTop @sendClick="sendClick" />
-									<waterCenter />
-									<waterBottom />
+						<div class="homeBox w100 h-full">
+							<div class="flex items-center h-full">
+								<div class="flex items-center flex-column" style="overflow: unset !important">
+									<waterTop ref="topRef" />
+									<waterCenter
+										@advanceExampleClick="advanceExampleClick"
+										:isShowAdvanceExample="state.isShowAdvanceExample"
+										ref="waterCenterRef"
+										@updateChatInput="updateChatInput"
+										:exampleList="exampleList"
+									/>
+									<waterBottom @tagListClick="tagListClick" />
 								</div>
-								<div v-if="isShowChat">
-									<Chat />
-								</div>
+
+								<CustomDrawer v-model:isShow="state.isShowAdvanceExample" ref="customDrawerRef" @updateChatInput="updateChatInput" />
 							</div>
 						</div>
-						<p class="declare">
+						<!-- <p class="declare">
 							<span
 								>澹版槑锛氭湰骞冲彴浠呮彁渚涙按鍔℃櫤鑳藉寲鏈嶅姟锛屼笉鎻愪緵浠讳綍褰㈠紡鐨勬硶寰嬫垨娉曡寤鸿锛岃鐢ㄦ埛鑷鍒ゆ柇浣跨敤椋庨櫓锛屽苟鑷鎵挎媴鍥犱娇鐢ㄦ湰骞冲彴鑰屼骇鐢熺殑娉曞緥璐d换銆�</span
 							>
-						</p>
+						</p> -->
 					</div>
 				</div>
 			</div>
@@ -29,29 +34,79 @@
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
+import { driver } from 'driver.js';
+import 'driver.js/dist/driver.css';
+import { nextTick, onMounted, reactive, ref } from 'vue';
 import waterBottom from './component/waterRight/bottom.vue';
 import waterCenter from './component/waterRight/center.vue';
 import waterTop from './component/waterRight/top.vue';
-import Chat from '/@/components/chat/Chat.vue';
+import CustomDrawer from '/@/components/drawer/CustomDrawer.vue';
+import { exampleSceneList, hadShowFirstGuide, isNewOldUser } from '/@/stores/chatRoom';
+import { accessSessionKey } from '/@/utils/request';
+import { Local } from '/@/utils/storage';
+let state = reactive({
+	isShowAdvanceExample: false,
+});
+// 寮曞姝ラ
 
-const isShowChat = ref(false);
-
-const sendClick = () => {
-	isShowChat.value = true;
+const driverObj = driver({
+	showProgress: true,
+	allowClose: true,
+	disableActiveInteraction: true,
+	nextBtnText: '涓嬩竴姝�',
+	prevBtnText: '涓婁竴姝�',
+	doneBtnText: '瀹屾垚',
+	steps: [
+		{ element: '.set-next-group-type', popover: { title: '1.璇烽�夋嫨涓诲満鏅�', description: '榛樿涓轰笟鍔″満鏅�' } },
+		{ element: '.pc-scenes', popover: { title: '2.璇烽�夋嫨娆″満鏅�', description: '榛樿涓哄畼缃戝伐鍗�', side: 'left' } },
+		{ element: '.pc-prompts', popover: { title: '3.璇烽�夋嫨鎻愰棶绀轰緥', description: '閫夊叾涓竴涓渚�' } },
+		{ element: '.playInput', popover: { title: '4.杈撳叆鎻愰棶鍐呭', description: '鐐瑰嚮鍙戦�佸紑濮嬪璇�' } },
+	],
+	onCloseClick: () => {
+		driverObj.destroy();
+		hadShowFirstGuide.value = false;
+	},
+});
+const topRef = ref(null);
+const waterCenterRef = ref(null);
+const customDrawerRef = ref(null);
+const exampleList = ref([]);
+const updateChatInput = (val) => {
+	topRef.value.updateChatInput(val);
 };
+const advanceExampleClick = (status: boolean) => {
+	state.isShowAdvanceExample = status;
+	if (status) {
+		customDrawerRef.value.getTableData();
+	}
+};
+//鑾峰彇妯$増鍒楄〃
+const getSelectListSample = async () => {
+	exampleList.value = exampleSceneList.value;
+};
+const tagListClick = (tag) => {
+	isFinishPromise?.then(() => {
+		waterCenterRef.value.tagListClick(tag);
+	});
+};
+let isFinishPromise = null;
+onMounted(() => {
+	isFinishPromise = new Promise(async (resolve) => {
+		await getSelectListSample();
+		if (!!Local.get(accessSessionKey) && !hadShowFirstGuide.value && !isNewOldUser.value) {
+			nextTick(() => {
+				driverObj.drive();
+				hadShowFirstGuide.value = true;
+			});
+		}
+		resolve(true);
+	});
+});
 </script>
 <style scoped lang="scss">
 .pc-chat_room {
-	width: 100vw;
-	height: 100vh;
 	margin: 0;
 	padding: 0;
-	// overflow: hidden;
-	// -webkit-box-sizing: border-box;
-	// box-sizing: border-box;
-	// background-color: #1c1e1d;
-	// font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
 }
 .pc-chat_aside {
 	width: 252px !important;
@@ -72,6 +127,7 @@
 	width: 100%;
 	padding: 18px;
 }
+
 .layout-logo-medium-img {
 	width: 28px;
 	margin-right: 7px;
@@ -115,12 +171,8 @@
 		background-color: #f2f4f8;
 		transition: padding-right 0.25s;
 		.homeBox {
-			height: calc(100% - 40px);
-			padding: 42px 40px 40px;
-			margin-bottom: 40px;
 			font-size: 14px;
 			line-height: 18px;
-			overflow-y: auto;
 		}
 		.declare {
 			position: absolute;

--
Gitblit v1.9.3