Browse Source

优化deepmate滚动动画

wangyi/feature-20251022162725-启动页登录注册
Ethereal 4 weeks ago
parent
commit
ae4799e702
  1. 7
      pages.json
  2. 56
      pages/deepMate/deepMate.vue
  3. 63
      pages/deepMate/scroll/scroll.vue

7
pages.json

@ -146,6 +146,13 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"titleNView": false "titleNView": false
} }
},
{
"path" : "pages/deepMate/scroll/scroll",
"style" :
{
"navigationBarTitleText" : ""
}
} }
], ],
"globalStyle": { "globalStyle": {

56
pages/deepMate/deepMate.vue

@ -116,6 +116,7 @@
class="chat-container" class="chat-container"
scroll-y="true" scroll-y="true"
:scroll-top="chatScrollTop" :scroll-top="chatScrollTop"
:scroll-with-animation="!isSending"
@scroll="onChatScroll" @scroll="onChatScroll"
v-if="messages.length > 0" v-if="messages.length > 0"
> >
@ -282,43 +283,7 @@ const renderMarkdown = (content) => {
if (!content) return ""; if (!content) return "";
return marked.parse(content); return marked.parse(content);
}; };
// Tesla Markdown
const FAKE_MARKDOWN = `# <font color="#1890ff">Tesla Inc.全景作战报告</font>
## 📊 股票分析报告
### 📈 股票基本信息
- **股票名称**: <font color="#52c41a">Tesla Inc.</font>
- **股票代码**: <font color="#1890ff">TSLA</font>
- **当前价格**: <font color="#ff4d4f">433.720</font>
- **更新时间**: 2025年10月24日
- **时间节点**: 今日无变盘点
### 🎯 核心价值评估
- **安全边际**: <font color="#13c2c2">419.978 ~ 445.364</font>
- **黄金价域**: <font color="#faad14">439.711 ~ 452.902</font>
- **核心证据链**:
- 🟢 **资金共识**: 当日多方资金<font color="#52c41a">流入</font>
- 🔥 **趋势动能**: 该股中长期处于<b><font color='#FF0000'>上升趋势</font></b>短期处于<b><font color='#FF0000'>强势状态</font></b>
### 🕵 主力作战分析
- **主力行为**:
1. 📊 该股庄家中长期筹码成本价格为 357.272短期资金成本价格为 408.076该股筹码分散当日筹码成本价格为 439.788
2. 🔍 近日没有出现主力集中吸筹
3. 📈 近期主力持仓比例大于散户持仓比例 当日主力持仓减少 当日散户持仓增加
### 📊 技术分析
- **空间维度**:
- 📉 预测低一值: <font color="#13c2c2">423.964</font>
- 📈 预测高一值: <font color="#ff4d4f">469.696</font>
- 📉 预测低二值: <font color="#13c2c2">433.213</font>
- 📈 预测高二值: <font color="#ff4d4f">458.396</font>
- **能量分析**: <font color="#722ed1">AI智能均线非多头排列当前卖盘大于买盘</font>
### 综合作战分析
- **触发条件**: <font color="#fa8c16">当前股票处于安全区牵牛绳为红色出现蓝色推进K线</font>
- **攻防指令**: <font color="#eb2f96">该股整体趋势相对较强个股正处于推进上涨的关键阶段若当前持有该股票建议继续持有进行持续跟踪若当前无该股票建议持续跟踪等待适当时机再进行介入</font>
---
<font color="#8c8c8c">*该内容由AI生成仅供参考投资有风险请注意甄别*</font>`;
const type = ref("member"); const type = ref("member");
const inputMessage = ref(""); const inputMessage = ref("");
const showThinking = ref(true); const showThinking = ref(true);
@ -352,10 +317,6 @@ const hotTopics = ref([
icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg", icon: "https://d31zlh4on95l9h.cloudfront.net/images/7ed58be0f4b81aeb398d9ba2534a624b.svg",
}, },
]); ]);
// raf/caf rAF
// const hasRAF = typeof requestAnimationFrame === 'function';
// const startFrame = (fn) => hasRAF ? requestAnimationFrame(fn) : setTimeout(fn, 16);
// const stopFrame = (id) => hasRAF ? cancelAnimationFrame(id) : clearTimeout(id);
// //
onMounted(() => { onMounted(() => {
@ -485,8 +446,6 @@ const sendMessage = () => {
// //
const simulateBotResponse = async (userMessage) => { const simulateBotResponse = async (userMessage) => {
isSending.value = true;
// //
const botMsg = { const botMsg = {
content: "", content: "",
@ -498,6 +457,8 @@ const simulateBotResponse = async (userMessage) => {
messages.value.push(botMsg); messages.value.push(botMsg);
await new Promise((resolve) => setTimeout(resolve, 2000)); await new Promise((resolve) => setTimeout(resolve, 2000));
isSending.value = true;
// //
const res = await postIntent({ const res = await postIntent({
content: "森那美", content: "森那美",
@ -592,9 +553,7 @@ const simulateBotResponse = async (userMessage) => {
// //
setTimeout(typeWriter, 500); setTimeout(typeWriter, 500);
console.log("messages", messages); console.log("messages", messages);
}; };
// //
@ -607,6 +566,13 @@ watch(messages, (arr) => {
} }
}); });
// isSending
watch(isSending, (newVal, oldVal) => {
console.log(`isSending changed from ${oldVal} to ${newVal}`);
// isSending
// UI
});
// //
const scrollToBottom = () => { const scrollToBottom = () => {
if (!shouldAutoScroll.value) return; if (!shouldAutoScroll.value) return;

63
pages/deepMate/scroll/scroll.vue

@ -0,0 +1,63 @@
<template>
<view class="container">
<scroll-view
class="scroll-view"
scroll-y="true"
@scrolltolower="onScrollToLower"
>
<button @click="scrollTo">点击滚动</button>
<view v-for="(item, index) in list" :key="index">
{{ item }}
</view>
</scroll-view>
<button @click="addItem">添加内容</button>
</view>
</template>
<script>
export default {
data() {
return {
list: Array.from({ length: 20 }, (_, i) => `Item ${i + 1}`),
};
},
methods: {
onScrollToLower() {
console.log("滚动到底部了");
//
},
addItem() {
this.list.push(`Item ${this.list.length + 1}`);
this.$nextTick(() => {
this.$refs.scrollView.scrollTo({
top: 99999,
duration: 300,
});
});
},
scrollTo() {
uni.pageScrollTo({
scrollTop: 100,
duration: 300,
});
},
},
};
</script>
<style>
.container {
height: 100%;
}
.scroll-view {
height: 80%;
}
button {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background-color: #007aff;
color: white;
}
</style>
Loading…
Cancel
Save