feat: 修改页面bug
This commit is contained in:
parent
f0b650de26
commit
f768613509
@ -97,39 +97,41 @@ export default {
|
||||
this.applyType(val);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
currentCardList() {
|
||||
const categoryName = this.categoryList[this.selectedCategoryIndex].name
|
||||
return this.cardListMap[categoryName] || this.cardList
|
||||
}
|
||||
const categoryName = this.categoryList[this.selectedCategoryIndex].name;
|
||||
return this.cardListMap[categoryName] || this.cardList;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 选择大分类
|
||||
selectCategory(index) {
|
||||
this.selectedCategoryIndex = index
|
||||
this.selectedIndex = 0 // 重置子选项选中
|
||||
this.selectedCategoryIndex = index;
|
||||
this.selectedIndex = 0; // 重置子选项选中
|
||||
},
|
||||
// 触摸开始
|
||||
onTouchStart(e) {
|
||||
this.touchStartY = e.touches[0].clientY
|
||||
this.touchStartY = e.touches[0].clientY;
|
||||
},
|
||||
// 触摸结束 - 滑动切换工艺卡片
|
||||
onTouchEnd(e) {
|
||||
const touchEndY = e.changedTouches[0].clientY
|
||||
const diff = this.touchStartY - touchEndY
|
||||
const threshold = 50 // 滑动阈值
|
||||
const touchEndY = e.changedTouches[0].clientY;
|
||||
const diff = this.touchStartY - touchEndY;
|
||||
const threshold = 50; // 滑动阈值
|
||||
|
||||
if (diff > threshold) {
|
||||
// 向上滑动 → 下一个工艺卡片
|
||||
let newIndex = this.selectedIndex + 1
|
||||
let newIndex = this.selectedIndex + 1;
|
||||
if (newIndex < this.currentCardList.length) {
|
||||
this.selectCard(newIndex)
|
||||
this.selectCard(newIndex);
|
||||
}
|
||||
} else if (diff < -threshold) {
|
||||
// 向下滑动 → 上一个工艺卡片
|
||||
let newIndex = this.selectedIndex - 1
|
||||
let newIndex = this.selectedIndex - 1;
|
||||
if (newIndex >= 0) {
|
||||
this.selectCard(newIndex)
|
||||
this.selectCard(newIndex);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -142,7 +144,7 @@ export default {
|
||||
{ left: 3.75 * 32, top: 9 * 32, rotate: 12, scale: 0.95 }, // 位置1 - 中上
|
||||
{ left: 60, top: 580, rotate: 0, scale: 1 }, // 位置2 - 中间
|
||||
{ left: 3.75 * 32, top: 27.75 * 32, rotate: -12, scale: 0.95 }, // 位置3 - 中下
|
||||
{ left: 7 * 32, top: 34.25 * 32, rotate: -25, scale: 0.75 } // 位置4 - 最下
|
||||
{ left: 7 * 32, top: 34.25 * 32, rotate: -25, scale: 0.75 }, // 位置4 - 最下
|
||||
];
|
||||
|
||||
// 计算当前卡片应该显示在哪个位置
|
||||
@ -156,7 +158,7 @@ export default {
|
||||
left: `${pos.left}rpx`,
|
||||
top: `${pos.top}rpx`,
|
||||
transform: `scale(${pos.scale * 1.15}) rotate(0deg)`,
|
||||
zIndex: 100
|
||||
zIndex: 100,
|
||||
};
|
||||
}
|
||||
|
||||
@ -164,7 +166,7 @@ export default {
|
||||
left: `${pos.left}rpx`,
|
||||
top: `${pos.top}rpx`,
|
||||
transform: `scale(${pos.scale}) rotate(${pos.rotate}deg)`,
|
||||
zIndex: 30 - Math.abs(cardPos - 2) * 10
|
||||
zIndex: 30 - Math.abs(cardPos - 2) * 10,
|
||||
};
|
||||
},
|
||||
// 选择卡片
|
||||
@ -190,7 +192,7 @@ export default {
|
||||
// 只有中间位置的卡片点击才会进入创建页
|
||||
// 其他位置点击只是切换选中(把卡片移到中间),再次点击中间卡片才进入
|
||||
if (pos === 2) {
|
||||
if (card.name === '光栅卡' || card.name === '镭射卡') {
|
||||
if (card.name === "光栅卡" || card.name === "镭射卡") {
|
||||
const route = this.cardRoutes[card.name];
|
||||
if (route) {
|
||||
uni.navigateTo({
|
||||
@ -199,8 +201,8 @@ export default {
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '激情开发中',
|
||||
icon: 'none',
|
||||
title: "激情开发中",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
return;
|
||||
@ -208,7 +210,7 @@ export default {
|
||||
this.selectCard(index);
|
||||
},
|
||||
handleBack() {
|
||||
uni.navigateBack()
|
||||
uni.navigateBack();
|
||||
},
|
||||
scrollUp() {
|
||||
let newIndex = this.selectedCategoryIndex - 1;
|
||||
@ -223,23 +225,21 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSkip() {
|
||||
const card = this.cardList[this.selectedIndex]
|
||||
if (card.name === '光栅卡' || card.name === '镭射卡') {
|
||||
const route = this.cardRoutes[card.name]
|
||||
const card = this.cardList[this.selectedIndex];
|
||||
if (card.name === "光栅卡" || card.name === "镭射卡") {
|
||||
const route = this.cardRoutes[card.name];
|
||||
if (route) {
|
||||
uni.navigateTo({
|
||||
url: `${route}?name=${encodeURIComponent(card.name)}`
|
||||
})
|
||||
url: `${route}?name=${encodeURIComponent(card.name)}`,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '激情开发中',
|
||||
icon: 'none',
|
||||
title: "激情开发中",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
try {
|
||||
@ -564,6 +564,13 @@ export default {
|
||||
"?name=" +
|
||||
encodeURIComponent(card.name),
|
||||
});
|
||||
} else if (card.name === "镭射卡") {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
this.cardRoutes["镭射卡"] +
|
||||
"?name=" +
|
||||
encodeURIComponent(card.name),
|
||||
});
|
||||
} else {
|
||||
uni.showToast({ title: "激情开发中", icon: "none" });
|
||||
}
|
||||
|
||||
@ -502,13 +502,14 @@ defineExpose({
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.star-activity-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
width: 68rpx;
|
||||
/* width: 68rpx; */
|
||||
/* 控制整体宽度,根据图标大小调整 */
|
||||
height: 156rpx;
|
||||
/* 预估高度,包含图标和文字块 */
|
||||
@ -521,7 +522,7 @@ defineExpose({
|
||||
/* 控制整体宽度,根据图标大小调整 */
|
||||
height: 156rpx;
|
||||
/* 预估高度,包含图标和文字块 */
|
||||
margin-right: 24rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/* --- 上层图标样式 --- */
|
||||
@ -532,7 +533,7 @@ defineExpose({
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
/* 水平居中 */
|
||||
width: 34rpx;
|
||||
width: 42.6rpx;
|
||||
/* 图标宽度 */
|
||||
height: 48rpx;
|
||||
/* 图标高度 */
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="recent-upgrades">
|
||||
<text class="card-title">即将升级藏品</text>
|
||||
<text class="card-title">最近升级藏品</text>
|
||||
<view v-if="!items || items.length === 0" class="empty-row">
|
||||
<text class="empty-text">暂无数据</text>
|
||||
</view>
|
||||
|
||||
@ -137,7 +137,9 @@ defineProps({
|
||||
}
|
||||
|
||||
.legend-text {
|
||||
font-size: 8rpx;
|
||||
font-size: 32rpx;
|
||||
white-space: nowrap;
|
||||
transform: scale(0.3);
|
||||
color: rgba(255, 241, 163, 1);
|
||||
text-shadow: -1px 1px 4px rgba(206, 9, 9, 0.84);
|
||||
}
|
||||
|
||||
@ -525,7 +525,7 @@ onUnmounted(() => {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
/* margin-top: 160rpx; */
|
||||
padding: 208rpx 24rpx 0;
|
||||
padding: 208rpx 16rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ const progressPercent = computed(() => {
|
||||
width: 98%;
|
||||
height: 328rpx;
|
||||
position: relative;
|
||||
top: 240rpx;
|
||||
top: 208rpx;
|
||||
overflow: hidden;
|
||||
/* 性能优化:启用硬件加速 */
|
||||
transform: translateZ(0);
|
||||
|
||||
@ -35,7 +35,7 @@ const props = defineProps({
|
||||
current: { type: Number, default: 0 },
|
||||
target: { type: Number, default: 100 },
|
||||
barHeight: { type: String, default: '200rpx' },
|
||||
barWidth: { type: String, default: '16rpx' },
|
||||
barWidth: { type: String, default: '24rpx' },
|
||||
circleSize: { type: String, default: '60rpx' },
|
||||
fillColor: {
|
||||
type: String,
|
||||
|
||||
@ -1,27 +1,16 @@
|
||||
// API 基础配置
|
||||
// 自动检测后端环境:探测开发服务器是否可用,能连通则用开发地址,否则用生产地址
|
||||
|
||||
// 团队开发机(Gateway + 团队数据库;注册/登录/余额/铸造)
|
||||
// const DEV_BASE = 'http://192.168.110.60:8080'
|
||||
const DEV_BASE = 'http://localhost:8081'
|
||||
const SEGMENT_BASE = 'http://localhost:8081'
|
||||
const LASER_BASE = 'http://localhost:8081' // 镭射 AI 生成 + compositor 走本地 Gateway
|
||||
const DEV_BASE = 'http://192.168.110.60:8080' // 开发环境
|
||||
const PROD_BASE = 'http://101.132.250.62:8080' // 生产环境
|
||||
const HEALTH_URL = DEV_BASE + '/health'
|
||||
|
||||
// 默认生产;H5 本地开发先走 DEV,避免 health 探测完成前请求打到生产(生产暂无 /segment)
|
||||
// 是否使用模拟数据(开发调试时设为 true,后端API准备好后改为 false)
|
||||
const USE_MOCK_API = true
|
||||
|
||||
// 环境检测状态:0=检测中, 1=开发环境, 2=生产环境
|
||||
let envStatus = 0
|
||||
let baseURL = PROD_BASE
|
||||
// #ifdef H5
|
||||
if (import.meta.env.DEV) {
|
||||
baseURL = DEV_BASE
|
||||
console.log('[API] H5 开发模式,默认地址:', DEV_BASE)
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 环境检测 Promise,确保 getApiBaseUrl / getWebSocketBaseUrl 等待检测完成
|
||||
const envReadyPromise = new Promise((resolve) => {
|
||||
@ -74,12 +63,12 @@ export function getApiBaseUrlSync() {
|
||||
|
||||
/** 抠图专用 Gateway(可与 DEV_BASE 不同:业务走团队库,segment 走本机) */
|
||||
export function getSegmentApiBaseUrl() {
|
||||
return String(SEGMENT_BASE).replace(/\/+$/, '')
|
||||
return String(baseURL).replace(/\/+$/, '')
|
||||
}
|
||||
|
||||
/** 镭射专用 Gateway(AI 生成 + compositor 走本地,其他业务走远程) */
|
||||
export function getLaserApiBaseUrl() {
|
||||
return String(LASER_BASE).replace(/\/+$/, '')
|
||||
return String(baseURL).replace(/\/+$/, '')
|
||||
}
|
||||
|
||||
// 模拟网络延迟
|
||||
|
||||
@ -58,7 +58,7 @@ export async function mockExhibitionSummary({ star_id }) {
|
||||
{ asset_id: 1, asset_name: '璀璨星河', asset_thumb: '/static/sucai/image-07.png', duration_7d: '144:13:56', earnings_7d: 2173, avg_earnings: 15 },
|
||||
{ asset_id: 2, asset_name: '夏日微风', asset_thumb: '/static/sucai/image-19.png', duration_7d: '77:13:56', earnings_7d: 1332, avg_earnings: 15 },
|
||||
{ asset_id: 3, asset_name: '夜色霓虹', asset_thumb: '/static/sucai/image-23.png', duration_7d: '64:15:37', earnings_7d: 1201, avg_earnings: 12 },
|
||||
{ asset_id: 4, asset_name: '黎明序曲', asset_thumb: '/static/sucai/image-38.png', duration_7d: '51:22:12', earnings_7d: 783, avg_earnings: 12 },
|
||||
{ asset_id: 4, asset_name: '黎明序曲', asset_thumb: '/static/sucai/image-35.png', duration_7d: '51:22:12', earnings_7d: 783, avg_earnings: 12 },
|
||||
{ asset_id: 5, asset_name: '深海回响', asset_thumb: '/static/sucai/image-46.png', duration_7d: '51:22:12', earnings_7d: 783, avg_earnings: 12 },
|
||||
],
|
||||
},
|
||||
@ -76,7 +76,7 @@ export async function mockLikeIncomeByLevel({ star_id }) {
|
||||
levels: [
|
||||
{ level: 'UR', asset_count: 1, total_income: 723, thumb: '/static/sucai/image-03.png' },
|
||||
{ level: 'SSR', asset_count: 2, total_income: 381, thumb: '/static/sucai/image-14.png' },
|
||||
{ level: 'SR', asset_count: 5, total_income: 233, thumb: '/static/sucai/image-27.png' },
|
||||
{ level: 'SR', asset_count: 5, total_income: 233, thumb: '/static/sucai/image-23.png' },
|
||||
{ level: 'SR', asset_count: 4, total_income: 169, thumb: '/static/sucai/image-35.png' },
|
||||
{ level: 'R', asset_count: 6, total_income: 57, thumb: '/static/sucai/image-49.png' },
|
||||
],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user