Browse Source

合并张家豪代码

songtongtong/feature-20250717104937-众筹
宋杰 4 weeks ago
parent
commit
d355fba903
  1. 7
      src/api/API.js
  2. 6
      src/utils/request.js
  3. 75
      src/views/zhongchou/index.vue
  4. 2
      vite.config.js

7
src/api/API.js

@ -1,10 +1,11 @@
import request from "../utils/request";
const APIurl = import.meta.env.VITE_APP_API_BASE_URL;
// 开发环境使用代理,生产环境使用环境变量
// const APIurl = import.meta.env.DEV ? '/Api' : import.meta.env.VITE_APP_API_BASE_URL;
export function addRecordAPI(data) {
return request({
url: '/Api/api/funding/addRecord',
url: `Api/api/funding/addRecord`,
method: 'post',
data: data
})
@ -12,7 +13,7 @@ export function addRecordAPI(data) {
// 新增:获取活动信息接口
export function getActivity1API() {
return request({
url: '/Api/api/funding/getActivity1',
url: `Api/api/funding/getActivity1`,
method: 'post'
})
}

6
src/utils/request.js

@ -12,8 +12,12 @@ service.interceptors.request.use(config => {
// 添加token逻辑(如果存在)
const token = localStorage.getItem('token')
if (token) {
config.headers['Authorization'] = 'Bearer ' + +SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w
config.headers['Authorization'] = 'Bearer ' + token
}
// 添加固定的 token
config.headers['token'] = '+SsksARQgUHIbIG3rRnnbZi0+fEeMx8pywnIlrmTxo5EOPR/wjWDV7w7+ZUseiBtf9kFa/atmNx6QfSpv5w'
return config
})

75
src/views/zhongchou/index.vue

@ -131,18 +131,18 @@ import { addRecordAPI ,getActivity1API } from '../../api/API'
import { ref, computed, onMounted, nextTick, watch } from 'vue'
// 使
async function fetchActivity() {
try {
const response = await getActivity1API()
if (response.code === 200) {
console.log('活动数据:', response.data)
//
// response.data marketOne, marketTwo, startTime, endTime
} else {
console.error('获取活动失败:', response.message)
try {
const response = await getActivity1API()
if (response.code === 200) {
console.log('活动数据:', response.data)
//
// response.data marketOne, marketTwo, startTime, endTime
} else {
console.error('获取活动失败:', response.message)
}
} catch (error) {
console.error('请求错误:', error)
}
} catch (error) {
console.error('请求错误:', error)
}
}
const numberToChinese = (num) => {
const chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五']
@ -240,6 +240,8 @@ const updateProgressDisplay = () => {
//
onMounted(() => {
nextTick(() => {
//
fetchActivity()
updateProgressBarHeight()
updateProgressDisplay()
@ -279,7 +281,7 @@ const handleBoostClick = async (area) => {
"activityId": 1,
"marketSign": "usa"
});
if (response.code === 200) {
usBoostStatus.value = true
// 1
@ -299,7 +301,7 @@ const handleBoostClick = async (area) => {
"activityId": 1,
"marketSign": "hk"
});
if (response.code === 200) {
hkBoostStatus.value = true
// 1
@ -460,6 +462,7 @@ const hideRules = () => {
transform-style: preserve-3d;
transform-origin: center center;
}
/* 为所有图片添加渲染优化 */
/* .stock-card img,
.rocket-body img,
@ -522,10 +525,13 @@ const hideRules = () => {
position: absolute;
z-index: 10;
transform: translateZ(0);
/* 新增位置调整 */
top: 80%; /* 垂直居中,可调整为具体像素值如 100px */
left: 50%; /* 水平居中,可调整为具体像素值如 200px */
transform: translate(-50%, -50%) translateZ(0); /* 居中偏移 */
/* 新增位置调整 */
top: 80%;
/* 垂直居中,可调整为具体像素值如 100px */
left: 50%;
/* 水平居中,可调整为具体像素值如 200px */
transform: translate(-50%, -50%) translateZ(0);
/* 居中偏移 */
}
.rocket-area.hidden {
@ -650,23 +656,23 @@ const hideRules = () => {
position: relative;
overflow: visible;
}
/* 美股进度条容器 - 蓝色主题背景 */
.us-content .progress-bar {
background: linear-gradient(to top,
rgba(79, 195, 247, 0.2),
rgba(41, 182, 246, 0.3),
rgba(2, 136, 209, 0.4)
);
background: linear-gradient(to top,
rgba(79, 195, 247, 0.2),
rgba(41, 182, 246, 0.3),
rgba(2, 136, 209, 0.4));
border: 1px solid rgba(41, 182, 246, 0.5);
box-shadow: 0 0 10px rgba(41, 182, 246, 0.3);
}
/* 港股进度条容器 - 红色主题背景 */
.hk-content .progress-bar {
background: linear-gradient(to top,
rgba(255, 138, 128, 0.2),
rgba(255, 87, 34, 0.3),
rgba(211, 47, 47, 0.4)
);
background: linear-gradient(to top,
rgba(255, 138, 128, 0.2),
rgba(255, 87, 34, 0.3),
rgba(211, 47, 47, 0.4));
border: 1px solid rgba(255, 87, 34, 0.5);
box-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}
@ -750,14 +756,17 @@ const hideRules = () => {
border-radius: 10px;
transition: height 0.8s ease;
}
/* 美股进度条填充 - 蓝色系渐变 */
.us-content .progress-fill {
background: linear-gradient(to top, #4FC3F7, #29B6F6, #0288D1);
}
/* 港股进度条填充 - 红色系渐变 */
.hk-content .progress-fill {
background: linear-gradient(to top, #FF8A80, #FF5722, #D32F2F);
}
/* 在进度条填充部分顶部添加火箭gif */
.progress-fill::after {
content: '';
@ -776,7 +785,7 @@ const hideRules = () => {
}
.marker {
position: relative;
position: relative;
color: #FFD700;
/* 默认金色 */
font-size: 1.4rem;
@ -787,6 +796,7 @@ const hideRules = () => {
letter-spacing: 0.5px;
text-rendering: optimizeLegibility;
}
/* 为刻度数字添加连接线 */
.marker::before {
content: '';
@ -801,17 +811,20 @@ const hideRules = () => {
/* 美股刻度连接线 - 从右侧连接到进度条 */
.us-content .marker::before {
right: -20px;
background-color: #00BFFF; /* 蓝色 */
right: -20px;
background-color: #00BFFF;
/* 蓝色 */
box-shadow: 0 0 4px rgba(0, 191, 255, 0.5);
}
/* 港股刻度连接线 - 从左侧连接到进度条 */
.hk-content .marker::before {
left: -20px;
background-color: #FF4444; /* 红色 */
background-color: #FF4444;
/* 红色 */
box-shadow: 0 0 4px rgba(255, 68, 68, 0.5);
}
/* 美股激活刻度 */
.us-content .marker.reached {
color: #00BFFF !important;

2
vite.config.js

@ -15,7 +15,7 @@ export default defineConfig({
'/Api': {
target: 'https://dbqb.nfdxy.net/devLotApi', // 后端基础地址
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), // 移除 /api 前缀
rewrite: (path) => path.replace(/^\/Api/, ''), // 移除 /api 前缀
// 或者更精确的重写(根据后端路径调整):
// rewrite: (path) => path.replace(/^\/api\/admin/, '/admin'),
},

Loading…
Cancel
Save