bugfix: 从dressfor跳转对话自动发送消息

This commit is contained in:
zhangyahui
2025-11-20 14:29:41 +08:00
parent 8a34b8049e
commit 5d0de60498
3 changed files with 21 additions and 16 deletions

View File

@@ -83,10 +83,10 @@ const sendPrefilledMessage = () => {
onMounted(() => {
sessionId.value = Math.floor(Date.now() / 1000).toString()
generateStore.setSessionId(sessionId.value)
sendPrefilledMessage()
})
onActivated(() => {
sendPrefilledMessage()
noticeListRef.value?.scrollToBottom()
})

View File

@@ -13,7 +13,7 @@
<template v-else>
<div class="form-container">
<div class="back-container flex flex-center" @click="handleChangeMode('entry')">
<van-icon name="arrow-left" color="#fff" />
<van-icon name="arrow-left" color="#fff" />
</div>
<div class="text">
<div class="form-title">Entry ID</div>
@@ -26,9 +26,14 @@
<div class="glass-form">
<div class="form-field">
<label class="field-label">VIP ID</label>
<input v-model="customerData.name" type="text" placeholder="Enter your ID" class="form-input" />
<input
v-model="customerData.name"
type="text"
placeholder="Enter your ID"
class="form-input"
/>
</div>
<div class="form-field email">
<!-- <div class="form-field email">
<label class="field-label">Email Address</label>
<input
v-model="customerData.email"
@@ -36,7 +41,7 @@
placeholder="Enter your email"
class="form-input"
/>
</div>
</div> -->
<button class="confirm-btn" @click="handleConfirm">Confirm</button>
</div>
<div class="copyright">Powered by AiDLab for Lane Crawford</div>
@@ -45,7 +50,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useGenerateStore, useUserInfoStore } from '@/stores'
import { showToast } from 'vant'
@@ -66,12 +71,12 @@ const handleChangeMode = (mode: PageMode) => {
}
const customerData = ref({
name: '',
email: ''
name: ''
// email: ''
})
const handleConfirm = async () => {
if (customerData.value.name === '' || customerData.value.email === '') {
if (customerData.value.name === '') {
showToast({
message: 'please input name and email',
position: 'top'
@@ -124,7 +129,7 @@ const handleConfirm = async () => {
font-size: 5.6rem;
width: 32.5rem;
height: 8.1rem;
border: .2rem solid #fff;
border: 0.2rem solid #fff;
display: flex;
align-items: center;
justify-content: center;
@@ -133,7 +138,7 @@ const handleConfirm = async () => {
}
.entry-btn {
position: absolute;
border: .2rem solid #fff;
border: 0.2rem solid #fff;
bottom: 10.3rem;
right: 5.5rem;
height: 9rem;
@@ -146,7 +151,7 @@ const handleConfirm = async () => {
.back-container {
width: 7.3rem;
height: 7.3rem;
border: .2rem solid #fff;
border: 0.2rem solid #fff;
border-radius: 1.8rem;
font-size: 4.3rem;
background: rgba(0, 0, 0, 0.2);
@@ -184,7 +189,7 @@ const handleConfirm = async () => {
.glass-form {
height: 84.8rem;
border: .2rem solid #ffffff;
border: 0.2rem solid #ffffff;
border-radius: 4.7rem;
margin: 0 14.2rem;
padding: 8.2rem 7.9rem;
@@ -215,7 +220,7 @@ const handleConfirm = async () => {
width: 100%;
height: 10rem;
line-height: 10rem;
border: .2rem solid #fff;
border: 0.2rem solid #fff;
border-radius: 7rem;
padding: 0 5.5rem;
color: #fff;
@@ -240,7 +245,7 @@ const handleConfirm = async () => {
font-size: 4rem;
font-family: 'satoshiRegular';
cursor: pointer;
box-shadow: 0 .2rem 8px rgba(0, 0, 0, 0.2);
box-shadow: 0 0.2rem 8px rgba(0, 0, 0, 0.2);
}
}
.copyright {