From c0fc989c8f1f7fe19c36db9f0c37089c0916e2b7 Mon Sep 17 00:00:00 2001
From: 18278715334 <18278715334@163.com>
Date: Fri, 26 Dec 2025 14:26:54 +0800
Subject: [PATCH] =?UTF-8?q?add=E5=BC=B9=E7=AA=97=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/InquireForm.vue | 20 +-
src/components/LoginDialog.vue | 321 +++++++++++++++++++++++++++++++++
src/stores/dialogStore.js | 12 ++
src/views/PromotionInquire.vue | 4 +
4 files changed, 352 insertions(+), 5 deletions(-)
create mode 100644 src/components/LoginDialog.vue
diff --git a/src/components/InquireForm.vue b/src/components/InquireForm.vue
index 5e1b5a1..95c5232 100644
--- a/src/components/InquireForm.vue
+++ b/src/components/InquireForm.vue
@@ -265,6 +265,7 @@
+
{
if (!isLoggedIn.value) {
- // 非微信浏览器环境:未登录用户提示跳转到登录页
+ // 非微信浏览器环境:未登录用户提示打开登录弹窗
if (!isWeChat.value) {
try {
await showConfirmDialog({
title: '提示',
- message: '您需要登录后才能进行查询,是否前往登录?',
- confirmButtonText: '前往登录',
+ message: '您需要登录后才能进行查询,是否立即登录?',
+ confirmButtonText: '立即登录',
cancelButtonText: '取消',
});
- router.push('/login');
+ dialogStore.openLogin();
} catch {
// 用户点击取消,什么都不做
}
@@ -532,7 +542,7 @@ const handleInputClick = async () => {
function handleSubmit() {
// 非微信浏览器环境:检查登录状态
if (!isWeChat.value && !isLoggedIn.value) {
- router.push('/login');
+ dialogStore.openLogin();
return;
}
diff --git a/src/components/LoginDialog.vue b/src/components/LoginDialog.vue
new file mode 100644
index 0000000..59cbbe1
--- /dev/null
+++ b/src/components/LoginDialog.vue
@@ -0,0 +1,321 @@
+
+
+
+
+
+
+
+
+
+

+
+ 天远数据
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ isPasswordLogin ? '验证码登录' : '密码登录' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/stores/dialogStore.js b/src/stores/dialogStore.js
index 3f90016..c12908f 100644
--- a/src/stores/dialogStore.js
+++ b/src/stores/dialogStore.js
@@ -4,6 +4,7 @@ import { ref } from 'vue'
export const useDialogStore = defineStore('dialog', () => {
const showBindPhone = ref(false)
const showRealNameAuth = ref(false)
+ const showLogin = ref(false)
function openBindPhone() {
showBindPhone.value = true
@@ -21,6 +22,14 @@ export const useDialogStore = defineStore('dialog', () => {
showRealNameAuth.value = false
}
+ function openLogin() {
+ showLogin.value = true
+ }
+
+ function closeLogin() {
+ showLogin.value = false
+ }
+
return {
showBindPhone,
openBindPhone,
@@ -28,5 +37,8 @@ export const useDialogStore = defineStore('dialog', () => {
showRealNameAuth,
openRealNameAuth,
closeRealNameAuth,
+ showLogin,
+ openLogin,
+ closeLogin,
}
})
diff --git a/src/views/PromotionInquire.vue b/src/views/PromotionInquire.vue
index 733968e..5843e8f 100644
--- a/src/views/PromotionInquire.vue
+++ b/src/views/PromotionInquire.vue
@@ -3,11 +3,14 @@ import { ref, onMounted, onBeforeMount } from "vue";
import { useRoute } from "vue-router";
import { storeToRefs } from 'pinia';
import { useUserStore } from '@/stores/userStore';
+import { useDialogStore } from '@/stores/dialogStore';
import InquireForm from "@/components/InquireForm.vue";
+import LoginDialog from "@/components/LoginDialog.vue";
const route = useRoute();
const router = useRouter();
const userStore = useUserStore();
+const dialogStore = useDialogStore();
const { mobile: userStoreMobile } = storeToRefs(userStore);
const linkIdentifier = ref("");
@@ -59,4 +62,5 @@ async function getProduct() {
+
\ No newline at end of file