perf: 清理无界缓存、合并收益走势查询、补齐组合索引并优化前端定时器/图片加载
- 移除只写不读的 verifyCodeCache(无界内存增长) - 大神收益走势由 20 次逐日/逐周/逐月查询改为 3 次 GROUP BY 聚合 - 派单池地理编码改为并行,避免串行等待外部接口 - 补齐 orders/activities/participants/user_notifications/finance/withdrawals/posts 组合索引;修复 withdrawals 使用不存在 created_at 的失效索引 - 数据库连接池支持 MYSQL_CONNECTION_LIMIT/MYSQL_QUEUE_LIMIT - 首页/弹窗定时器卸载清理,活动列表参与者按活动 id 查询,大厅组局按页取数,图片 lazy-load - 121 套件/792 用例全绿;已部署并验证新索引与 9ms 走势查询
这个提交包含在:
@@ -29,12 +29,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey } from '@/common/theme.js';
|
||||
import { getPlatformConfigs } from '@/common/api.js';
|
||||
|
||||
const visible = ref(false);
|
||||
let popupTimer = null;
|
||||
const config = ref({
|
||||
enabled: false,
|
||||
title: '',
|
||||
@@ -81,7 +82,8 @@ const checkAndDisplayPopup = async () => {
|
||||
}
|
||||
|
||||
// 延迟 600ms 展示,保证首屏骨架屏转场顺畅
|
||||
setTimeout(() => {
|
||||
if (popupTimer) clearTimeout(popupTimer);
|
||||
popupTimer = setTimeout(() => {
|
||||
visible.value = true;
|
||||
uni.setStorageSync(storageKey, String(now));
|
||||
}, 600);
|
||||
@@ -107,6 +109,13 @@ const handleAction = () => {
|
||||
onMounted(() => {
|
||||
checkAndDisplayPopup();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (popupTimer) {
|
||||
clearTimeout(popupTimer);
|
||||
popupTimer = null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
v-for="(img, idx) in post.images"
|
||||
:key="idx"
|
||||
class="post-img"
|
||||
lazy-load
|
||||
:src="img"
|
||||
mode="aspectFill"
|
||||
@click.stop="previewImage(post.images, idx)"
|
||||
|
||||
@@ -397,8 +397,9 @@ const loadHallData = async () => {
|
||||
}
|
||||
}).catch(() => {}),
|
||||
|
||||
getActivities().then((list) => {
|
||||
const arr = Array.isArray(list) ? list : [];
|
||||
getActivities({ page: 1, pageSize: 20 }).then((res) => {
|
||||
// 大厅只展示最近 5 个可报名组局,按页取数避免每 30 秒拉全量活动与参与者
|
||||
const arr = Array.isArray(res) ? res : (res && Array.isArray(res.list) ? res.list : []);
|
||||
nearbyActivities.value = arr
|
||||
.filter((a) => a && (a.status === 'RECRUITING' || a.status === '招募中'))
|
||||
.slice(0, 5);
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
>
|
||||
<!-- 封面图构图优化:高保真黄金比例与底部流光渐变 -->
|
||||
<view class="card-cover-wrap">
|
||||
<image class="card-cover" :src="expert.avatar" mode="aspectFill" />
|
||||
<image class="card-cover" :src="expert.avatar" mode="aspectFill" lazy-load />
|
||||
<view class="cover-gradient"></view>
|
||||
|
||||
<view class="status-tag" :class="expert.isOnline ? 'online' : 'offline'">
|
||||
@@ -489,6 +489,15 @@ onShow(() => {
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('theme-change', onThemeChanged);
|
||||
if (searchTimer) {
|
||||
clearTimeout(searchTimer);
|
||||
searchTimer = null;
|
||||
}
|
||||
if (matchTimer) {
|
||||
clearTimeout(matchTimer);
|
||||
matchTimer = null;
|
||||
}
|
||||
matchSeq += 1;
|
||||
try { if (homeVoiceAudio) { homeVoiceAudio.destroy(); homeVoiceAudio = null; } } catch (_) {}
|
||||
});
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户