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 |   69 +++++++++++++++++++++++++++-------
 1 files changed, 55 insertions(+), 14 deletions(-)

diff --git a/src/views/project/ch/home/Home.vue b/src/views/project/ch/home/Home.vue
index fd28f26..521b04c 100644
--- a/src/views/project/ch/home/Home.vue
+++ b/src/views/project/ch/home/Home.vue
@@ -5,23 +5,20 @@
 				<div class="w100 h100 overflow-hidden">
 					<div class="pc-chatRoom w100 h100">
 						<div class="homeBox w100 h-full">
-							<div class="flex items-center h-full overflow-hidden">
-								<div class="flex items-center flex-column">
+							<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  />
+									<waterBottom @tagListClick="tagListClick" />
 								</div>
 
-								<CustomDrawer
-									v-model:isShow="state.isShowAdvanceExample"
-									ref="customDrawerrRef"
-									@updateChatInput="updateChatInput"
-								/>
+								<CustomDrawer v-model:isShow="state.isShowAdvanceExample" ref="customDrawerRef" @updateChatInput="updateChatInput" />
 							</div>
 						</div>
 						<!-- <p class="declare">
@@ -37,29 +34,74 @@
 </template>
 
 <script setup lang="ts">
-import { reactive, 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 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 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 customDrawerrRef = 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) {
-		customDrawerrRef.value.getTableData();
+		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 {
@@ -131,7 +173,6 @@
 		.homeBox {
 			font-size: 14px;
 			line-height: 18px;
-			overflow-y: auto;
 		}
 		.declare {
 			position: absolute;

--
Gitblit v1.9.3