update
This commit is contained in:
parent
38c8cc8d87
commit
9f70d8ace7
@ -5,7 +5,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
image: tradus-web:1.3.5
|
image: tradus-web:1.3.6
|
||||||
container_name: tradus-web
|
container_name: tradus-web
|
||||||
ports:
|
ports:
|
||||||
- '6000:80'
|
- '6000:80'
|
||||||
|
|||||||
@ -25,6 +25,16 @@ const currentThought = ref('')
|
|||||||
const showInitialView = ref(true)
|
const showInitialView = ref(true)
|
||||||
const copySuccess = ref(false)
|
const copySuccess = ref(false)
|
||||||
|
|
||||||
|
// 时间周期选项和选择值(加密货币模式下使用)
|
||||||
|
const timeframeOptions = [
|
||||||
|
{ value: '15m', label: '15分钟' },
|
||||||
|
{ value: '1h', label: '1小时' },
|
||||||
|
{ value: '4h', label: '4小时' },
|
||||||
|
{ value: '1d', label: '1天' },
|
||||||
|
{ value: '1w', label: '1周' },
|
||||||
|
]
|
||||||
|
const selectedTimeframe = ref('1d') // 默认为1天
|
||||||
|
|
||||||
// 根据环境选择API基础URL
|
// 根据环境选择API基础URL
|
||||||
const apiBaseUrl =
|
const apiBaseUrl =
|
||||||
import.meta.env.MODE === 'development' ? 'http://127.0.0.1:8000' : 'https://api.ibtc.work'
|
import.meta.env.MODE === 'development' ? 'http://127.0.0.1:8000' : 'https://api.ibtc.work'
|
||||||
@ -146,6 +156,7 @@ const handleAnalysis = async () => {
|
|||||||
// 调用加密货币分析接口
|
// 调用加密货币分析接口
|
||||||
const requestData = {
|
const requestData = {
|
||||||
symbol: code.toUpperCase(),
|
symbol: code.toUpperCase(),
|
||||||
|
timeframe: selectedTimeframe.value,
|
||||||
}
|
}
|
||||||
response = await http.post(`${apiBaseUrl}/crypto/analysis_v2`, requestData)
|
response = await http.post(`${apiBaseUrl}/crypto/analysis_v2`, requestData)
|
||||||
}
|
}
|
||||||
@ -247,6 +258,8 @@ const resetView = () => {
|
|||||||
analysisContent.value = ''
|
analysisContent.value = ''
|
||||||
currentThought.value = ''
|
currentThought.value = ''
|
||||||
isAnalyzing.value = false
|
isAnalyzing.value = false
|
||||||
|
// 重置为默认时间周期
|
||||||
|
selectedTimeframe.value = '1d'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除输入
|
// 清除输入
|
||||||
@ -345,6 +358,24 @@ const parsedContent = computed(() => {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 加密货币模式下的时间周期选择 -->
|
||||||
|
<div v-if="!isStockMode" class="timeframe-selector">
|
||||||
|
<label class="timeframe-label">选择时间周期:</label>
|
||||||
|
<div class="timeframe-options">
|
||||||
|
<button
|
||||||
|
v-for="option in timeframeOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="timeframe-option"
|
||||||
|
:class="{ active: selectedTimeframe === option.value }"
|
||||||
|
@click="selectedTimeframe = option.value"
|
||||||
|
:disabled="isAnalyzing"
|
||||||
|
>
|
||||||
|
{{ option.label }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="analyze-button"
|
class="analyze-button"
|
||||||
@click="handleAnalysis"
|
@click="handleAnalysis"
|
||||||
@ -384,6 +415,8 @@ const parsedContent = computed(() => {
|
|||||||
<div class="target-info">
|
<div class="target-info">
|
||||||
<span class="label">正在分析:</span>
|
<span class="label">正在分析:</span>
|
||||||
<span class="value">{{ symbolCode.toUpperCase() }}</span>
|
<span class="value">{{ symbolCode.toUpperCase() }}</span>
|
||||||
|
<span v-if="!isStockMode" class="label timeframe-info">周期:</span>
|
||||||
|
<span v-if="!isStockMode" class="value">{{ selectedTimeframe }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-buttons" v-if="!isAnalyzing">
|
<div class="action-buttons" v-if="!isAnalyzing">
|
||||||
<button class="action-button" @click="resetView">
|
<button class="action-button" @click="resetView">
|
||||||
@ -1015,6 +1048,104 @@ const parsedContent = computed(() => {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.timeframe-selector {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-label {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--color-text-secondary);
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-options {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-option {
|
||||||
|
padding: 0.4rem 0.75rem;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
background-color: var(--color-bg-secondary);
|
||||||
|
border: 1px solid var(--color-border);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
color: var(--color-text-secondary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-option:hover:not(:disabled) {
|
||||||
|
border-color: var(--color-accent);
|
||||||
|
color: var(--color-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-option.active {
|
||||||
|
background-color: var(--color-accent);
|
||||||
|
color: white;
|
||||||
|
border-color: var(--color-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-option:disabled {
|
||||||
|
opacity: 0.6;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-info {
|
||||||
|
margin-left: 1rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.timeframe-options {
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-option {
|
||||||
|
padding: 0.35rem 0.6rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.timeframe-label {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-options {
|
||||||
|
gap: 0.3rem;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeframe-option {
|
||||||
|
padding: 0.3rem 0.5rem;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
flex: none;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-info {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-info .label,
|
||||||
|
.target-info .value {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user