修改前端
This commit is contained in:
@@ -4,13 +4,13 @@ import axios from 'axios';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
// 输入框数据
|
||||
const input1 = ref('');
|
||||
const input2 = ref('');
|
||||
const betAmount = ref('');
|
||||
|
||||
// 登录模态框数据
|
||||
const loginDialogVisible = ref(false);
|
||||
const isLoggedIn = ref(false);
|
||||
const username = ref('未记录');
|
||||
const balance = ref('0'); // 余额
|
||||
const loginForm = ref({
|
||||
username: '',
|
||||
password: '',
|
||||
@@ -237,20 +237,20 @@ async function fetchUserSettings() {
|
||||
username.value = response.data.username;
|
||||
isLoggedIn.value = true;
|
||||
}
|
||||
// 更新止盈点
|
||||
if (response.data.winNum) {
|
||||
input1.value = response.data.winNum;
|
||||
// 更新投注金额
|
||||
if (response.data.betAmount) {
|
||||
betAmount.value = response.data.betAmount;
|
||||
}
|
||||
// 更新止亏点
|
||||
if (response.data.loseNum) {
|
||||
input2.value = response.data.loseNum;
|
||||
// 更新余额
|
||||
if (response.data.balance) {
|
||||
balance.value = response.data.balance;
|
||||
}
|
||||
}
|
||||
|
||||
console.log('用户设置数据获取完成');
|
||||
console.log('username.value:', username.value);
|
||||
console.log('input1.value:', input1.value);
|
||||
console.log('input2.value:', input2.value);
|
||||
console.log('betAmount.value:', betAmount.value);
|
||||
console.log('balance.value:', balance.value);
|
||||
} catch (err) {
|
||||
console.error('获取用户设置数据失败:', err);
|
||||
// 失败时不显示错误,使用默认值
|
||||
@@ -343,19 +343,18 @@ function handleLogout() {
|
||||
|
||||
// 处理确认按钮点击
|
||||
async function handleConfirm() {
|
||||
console.log('确认按钮点击,止盈点:', input1.value, '止亏点:', input2.value);
|
||||
console.log('确认按钮点击,投注金额:', betAmount.value);
|
||||
|
||||
// 验证输入
|
||||
if (!input1.value || !input2.value) {
|
||||
alert('请填写完整的止盈止亏点');
|
||||
if (!betAmount.value) {
|
||||
alert('请填写投注金额');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 构建提交数据
|
||||
const submitData = {
|
||||
winNum: input1.value,
|
||||
loseNum: input2.value
|
||||
betAmount: betAmount.value
|
||||
};
|
||||
|
||||
console.log('提交数据:', submitData);
|
||||
@@ -446,6 +445,7 @@ onUnmounted(() => {
|
||||
<div class="account-avatar">👤</div>
|
||||
<div class="account-details">
|
||||
<div class="account-name">{{ username }}</div>
|
||||
<div class="account-balance">余额: {{ balance }}</div>
|
||||
</div>
|
||||
<div class="account-actions">
|
||||
<button type="button" class="login-button" @click="loginDialogVisible = true">账号信息</button>
|
||||
@@ -493,15 +493,9 @@ onUnmounted(() => {
|
||||
<!-- 顶部输入框区域 -->
|
||||
<div class="top-inputs">
|
||||
<div class="input-group">
|
||||
<label for="input1">止盈点:</label>
|
||||
<label for="betAmount">投注金额:</label>
|
||||
<div class="input-with-button">
|
||||
<input type="text" id="input1" v-model="input1" placeholder="请输入止盈点">
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label for="input2">止亏点:</label>
|
||||
<div class="input-with-button">
|
||||
<input type="text" id="input2" v-model="input2" placeholder="请输入止亏点">
|
||||
<input type="text" id="betAmount" v-model="betAmount" placeholder="请输入投注金额">
|
||||
<div class="button-group">
|
||||
<button type="button" class="confirm-button" @click="handleConfirm">确认</button>
|
||||
</div>
|
||||
@@ -612,6 +606,11 @@ onUnmounted(() => {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.account-balance {
|
||||
font-size: 0.85rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.account-role {
|
||||
font-size: 0.85rem;
|
||||
color: #666;
|
||||
@@ -683,14 +682,15 @@ onUnmounted(() => {
|
||||
.input-group {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.input-with-button {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.input-with-button input {
|
||||
|
||||
Reference in New Issue
Block a user