update
This commit is contained in:
parent
2f16c2f07f
commit
a593a8b22f
@ -579,8 +579,8 @@ html, body {
|
|||||||
box-shadow: 0 0 0 1px var(--accent);
|
box-shadow: 0 0 0 1px var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Author Info */
|
/* Footer Info */
|
||||||
.author-info {
|
.footer-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -591,25 +591,23 @@ html, body {
|
|||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-label {
|
.copyright {
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-divider {
|
.footer-divider {
|
||||||
color: var(--border-bright);
|
color: var(--border-bright);
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-contact {
|
.contact-link {
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
font-family: 'Monaco', 'Courier New', monospace;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
border-radius: 2px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-contact:hover {
|
.contact-link:hover {
|
||||||
background: var(--accent-dim);
|
background: var(--accent-dim);
|
||||||
box-shadow: 0 0 8px var(--accent-dim);
|
box-shadow: 0 0 8px var(--accent-dim);
|
||||||
}
|
}
|
||||||
@ -818,3 +816,127 @@ html, body {
|
|||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Contact Modal */
|
||||||
|
.contact-modal {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.8);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 10000;
|
||||||
|
padding: 20px;
|
||||||
|
animation: fadeIn 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-modal-content {
|
||||||
|
position: relative;
|
||||||
|
background: var(--bg-primary);
|
||||||
|
border: 1px solid var(--border-bright);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 32px;
|
||||||
|
max-width: 400px;
|
||||||
|
width: 100%;
|
||||||
|
box-shadow: 0 8px 32px rgba(0, 255, 65, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-modal-content .modal-close-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 16px;
|
||||||
|
right: 16px;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
background: transparent;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-modal-content .modal-close-btn:hover {
|
||||||
|
background: var(--accent-dim);
|
||||||
|
border-color: var(--accent);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-title {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-primary);
|
||||||
|
margin: 0 0 24px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-item svg {
|
||||||
|
color: var(--accent);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-item strong {
|
||||||
|
color: var(--accent);
|
||||||
|
font-family: 'Monaco', 'Courier New', monospace;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
background: var(--accent-dim);
|
||||||
|
border: 1px solid var(--accent);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: var(--accent);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn:hover {
|
||||||
|
background: var(--accent);
|
||||||
|
color: var(--bg-primary);
|
||||||
|
box-shadow: 0 0 12px var(--accent-dim);
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn svg {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-hint {
|
||||||
|
text-align: center;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
font-size: 12px;
|
||||||
|
margin: 0;
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|||||||
@ -140,11 +140,9 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Author Info -->
|
<!-- Footer Info -->
|
||||||
<div class="author-info">
|
<div class="footer-info">
|
||||||
<span class="author-label">联系龙哥</span>
|
<span class="contact-link" @click="showContactModal = true">联系作者</span>
|
||||||
<span class="author-divider">|</span>
|
|
||||||
<span class="author-contact" @click="copyWechat" title="点击复制微信号">微信:aaronlzhou</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -162,6 +160,35 @@
|
|||||||
<p class="modal-hint">长按图片可保存到相册</p>
|
<p class="modal-hint">长按图片可保存到相册</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Contact Modal -->
|
||||||
|
<div v-if="showContactModal" class="contact-modal" @click="showContactModal = false">
|
||||||
|
<div class="contact-modal-content" @click.stop>
|
||||||
|
<button class="modal-close-btn" @click="showContactModal = false" title="关闭">
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
||||||
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<h3 class="contact-title">联系作者</h3>
|
||||||
|
<div class="contact-info">
|
||||||
|
<div class="contact-item">
|
||||||
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||||
|
</svg>
|
||||||
|
<span>微信号:<strong>aaronlzhou</strong></span>
|
||||||
|
</div>
|
||||||
|
<button class="copy-btn" @click="copyWechat">
|
||||||
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
||||||
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
||||||
|
</svg>
|
||||||
|
复制微信号
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p class="contact-hint">欢迎交流讨论股票分析和AI技术</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Vue 3 -->
|
<!-- Vue 3 -->
|
||||||
|
|||||||
@ -11,6 +11,7 @@ createApp({
|
|||||||
charts: {},
|
charts: {},
|
||||||
showImageModal: false,
|
showImageModal: false,
|
||||||
modalImageUrl: '',
|
modalImageUrl: '',
|
||||||
|
showContactModal: false,
|
||||||
availableModels: [],
|
availableModels: [],
|
||||||
currentModel: null,
|
currentModel: null,
|
||||||
selectedModel: null
|
selectedModel: null
|
||||||
@ -81,12 +82,12 @@ createApp({
|
|||||||
while (true) {
|
while (true) {
|
||||||
const { done, value } = await reader.read();
|
const { done, value } = await reader.read();
|
||||||
if (done) {
|
if (done) {
|
||||||
console.log(`流式接收完成,共 ${chunkCount} 个数据块`);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
chunkCount++;
|
chunkCount++;
|
||||||
console.log(`接收数据块 ${chunkCount}: ${value ? value.length : 0} 字节`);
|
|
||||||
|
|
||||||
// 解码数据
|
// 解码数据
|
||||||
buffer += decoder.decode(value, { stream: true });
|
buffer += decoder.decode(value, { stream: true });
|
||||||
@ -99,7 +100,7 @@ createApp({
|
|||||||
if (line.startsWith('data: ')) {
|
if (line.startsWith('data: ')) {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(line.slice(6));
|
const data = JSON.parse(line.slice(6));
|
||||||
console.log('接收到数据:', data);
|
|
||||||
|
|
||||||
if (data.type === 'session_id') {
|
if (data.type === 'session_id') {
|
||||||
this.sessionId = data.session_id;
|
this.sessionId = data.session_id;
|
||||||
@ -113,12 +114,12 @@ createApp({
|
|||||||
} else if (data.type === 'done') {
|
} else if (data.type === 'done') {
|
||||||
// 完成 - 标记流式输出结束
|
// 完成 - 标记流式输出结束
|
||||||
this.messages[messageIndex].streaming = false;
|
this.messages[messageIndex].streaming = false;
|
||||||
console.log('流式输出完成');
|
|
||||||
} else if (data.type === 'error') {
|
} else if (data.type === 'error') {
|
||||||
throw new Error(data.error);
|
throw new Error(data.error);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析SSE数据失败:', e, line);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,7 +129,7 @@ createApp({
|
|||||||
this.messages[messageIndex].streaming = false;
|
this.messages[messageIndex].streaming = false;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('发送消息失败:', error);
|
|
||||||
this.messages[messageIndex].content = '抱歉,发送消息失败,请稍后重试。';
|
this.messages[messageIndex].content = '抱歉,发送消息失败,请稍后重试。';
|
||||||
this.messages[messageIndex].streaming = false;
|
this.messages[messageIndex].streaming = false;
|
||||||
} finally {
|
} finally {
|
||||||
@ -259,7 +260,7 @@ createApp({
|
|||||||
navigator.clipboard.writeText(wechatId).then(() => {
|
navigator.clipboard.writeText(wechatId).then(() => {
|
||||||
this.showCopyNotification();
|
this.showCopyNotification();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('复制失败:', err);
|
|
||||||
this.fallbackCopy(wechatId);
|
this.fallbackCopy(wechatId);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -280,7 +281,7 @@ createApp({
|
|||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
this.showCopyNotification();
|
this.showCopyNotification();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('复制失败:', err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.removeChild(textarea);
|
document.body.removeChild(textarea);
|
||||||
@ -322,7 +323,7 @@ createApp({
|
|||||||
navigator.clipboard.writeText(plainText).then(() => {
|
navigator.clipboard.writeText(plainText).then(() => {
|
||||||
this.showNotification('已复制内容');
|
this.showNotification('已复制内容');
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('复制失败:', err);
|
|
||||||
this.fallbackCopy(plainText);
|
this.fallbackCopy(plainText);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -376,7 +377,7 @@ createApp({
|
|||||||
this.showNotification('长按图片可保存');
|
this.showNotification('长按图片可保存');
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('生成分享图失败:', error);
|
|
||||||
this.showNotification('生成失败,请重试');
|
this.showNotification('生成失败,请重试');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -424,7 +425,7 @@ createApp({
|
|||||||
this.selectedModel = data.current ? data.current.provider : null;
|
this.selectedModel = data.current ? data.current.provider : null;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载模型列表失败:', error);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -451,7 +452,7 @@ createApp({
|
|||||||
this.showNotification('切换失败');
|
this.showNotification('切换失败');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('切换模型失败:', error);
|
|
||||||
this.showNotification('切换失败');
|
this.showNotification('切换失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user