From e2b2d9175832558abc80a5a0d4cc2278d0665cf9 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期四, 14 十一月 2024 13:08:37 +0800
Subject: [PATCH] 修改新手指导

---
 src/layout/component/sidebar/components/MenuList.vue |   66 +++++++++++++++++++--------------
 1 files changed, 38 insertions(+), 28 deletions(-)

diff --git a/src/layout/component/sidebar/components/MenuList.vue b/src/layout/component/sidebar/components/MenuList.vue
index 55d26fd..579cdb5 100644
--- a/src/layout/component/sidebar/components/MenuList.vue
+++ b/src/layout/component/sidebar/components/MenuList.vue
@@ -37,7 +37,7 @@
 			</div>
 		</div>
 	</div>
-	<div class="pc-login items-center justify-center" style="display: flex" v-show="state.isShowLogin">
+	<div class="pc-login items-center justify-center" style="display: flex" v-show="isShowLogin">
 		<div class="login_box">
 			<div class="sign_in">
 				<i class="ywifont ywicon-guanbi closes" @click="handleClose"></i>
@@ -75,9 +75,7 @@
 							<el-form-item prop="verifyCode" label="楠岃瘉鐮�">
 								<el-input v-model="state.loginPhoneForm.verifyCode" placeholder="璇疯緭鍏ュ洓浣嶉獙璇佺爜" maxlength="6" clearable>
 									<template #append>
-										<el-button type="primary" @click="handleSendVerifyCode" :disabled="countdown > 0">{{
-											countdown > 0 ? `${countdown}绉掑悗閲嶈瘯` : '鑾峰彇楠岃瘉鐮�'
-										}}</el-button>
+										<el-button type="primary" @click="handleSendVerifyCode" :disabled="hasSended">{{ sendCodeMsg }}</el-button>
 									</template>
 								</el-input>
 							</el-form-item>
@@ -98,6 +96,7 @@
 import { computed, onMounted, reactive, ref, watchEffect } from 'vue';
 import { PostLogin, loginMessageUser, loginVerifyMessage } from '/@/api/ai/user';
 import router from '/@/router';
+import { isSharePage, isShowLogin } from '/@/stores/chatRoom';
 import emitter from '/@/utils/mitt';
 import { accessSessionKey, userNameKey } from '/@/utils/request';
 import { gotoRoute } from '/@/utils/route';
@@ -106,7 +105,7 @@
 const formPhoneRef = ref(); //鎵嬫満鍙风櫥褰�
 const isLoginStatus = ref(!!Local.get(accessSessionKey));
 const userName = ref('');
-const countdown = ref(0);
+const countdown = ref(null);
 const firstUserCharacter = computed(() => userName.value?.[0]?.toUpperCase());
 watchEffect(() => {
 	if (!isLoginStatus.value) return;
@@ -114,23 +113,23 @@
 });
 let state = reactive({
 	asideTitleList: [
-		{
-			id: 1,
-			icon: '/static/images/wave/AsideIcon.png',
-			title: '搴旂敤鍦烘櫙',
-			routerName: 'AllScenario',
-		},
-		{
-			id: 2,
-			icon: '/static/images/wave/AsideIcon.png',
-			title: '甯姪涓績',
-			// routerName:'Scenario',
-		},
-		{
-			id: 3,
-			icon: '/static/images/wave/AsideIcon.png',
-			title: '涓汉璁剧疆',
-		},
+		// {
+		// 	id: 1,
+		// 	icon: '/static/images/wave/AsideIcon.png',
+		// 	title: '搴旂敤鍦烘櫙',
+		// 	routerName: 'AllScenario',
+		// },
+		// {
+		// 	id: 2,
+		// 	icon: '/static/images/wave/AsideIcon.png',
+		// 	title: '甯姪涓績',
+		// 	// routerName:'Scenario',
+		// },
+		// {
+		// 	id: 3,
+		// 	icon: '/static/images/wave/AsideIcon.png',
+		// 	title: '涓汉璁剧疆',
+		// },
 		{
 			id: 4,
 			icon: '/static/images/wave/AsideIcon.png',
@@ -138,7 +137,6 @@
 			routerName: 'AboutUs',
 		},
 	],
-	isShowLogin: false,
 	isShowExitLogin: false,
 	loginForm: {
 		account: '',
@@ -162,16 +160,26 @@
 	verifyCode: [{ required: true, message: '璇疯緭鍏ラ獙璇佺爜', trigger: 'blur' }],
 };
 const handleClick = (item) => {
-	if(!item.routerName) return;
+	if (!item.routerName) return;
 	gotoRoute({ name: item.routerName });
 };
+const LOGIN_CLIENT = 'Web绔�';
+
 //鐧诲綍
 const openLoginDlg = async () => {
-	state.isShowLogin = true;
+	// 鍒嗕韩椤典笉闇�瑕�
+	if (isSharePage.value) return;
+	isShowLogin.value = true;
 };
 const handleClose = () => {
-	state.isShowLogin = false;
+	isShowLogin.value = false;
 };
+const hasSended = computed(() => {
+	return countdown.value !== null;
+});
+const sendCodeMsg = computed(() => {
+	return !hasSended.value ? '鑾峰彇楠岃瘉鐮�' : `${countdown.value} 绉掑悗閲嶈瘯`;
+});
 //鐧诲綍
 const onSubmit = async () => {
 	if (state.activeLoginName === 'accountUser') {
@@ -181,6 +189,7 @@
 		const res = await PostLogin({
 			user: state.loginForm.account,
 			pass: state.loginForm.pwd,
+			client: LOGIN_CLIENT,
 		});
 		if (!res.json_ok) {
 			return ElMessage.error(res.json_msg);
@@ -194,6 +203,7 @@
 		const res = await loginMessageUser({
 			phone: state.loginPhoneForm.phoneUser,
 			code: state.loginPhoneForm.verifyCode,
+			client: LOGIN_CLIENT,
 		});
 		if (!res.json_ok) {
 			return ElMessage.error(res.json_msg);
@@ -201,7 +211,7 @@
 		LoginInfo.set(res.hswatersession, state.loginPhoneForm.phoneUser);
 	}
 
-	state.isShowLogin = false;
+	isShowLogin.value = false;
 	isLoginStatus.value = true;
 	window.location.reload();
 };
@@ -254,7 +264,7 @@
 };
 onMounted(() => {
 	emitter.on('openLoginDlg', () => {
-		if (state.isShowLogin || isLoginStatus.value) return;
+		if (isShowLogin.value || isLoginStatus.value) return;
 		openLoginDlg();
 	});
 

--
Gitblit v1.9.3