feat: 放开金种子接口

This commit is contained in:
2026-06-25 16:14:35 +08:00
parent a7f80af1de
commit 8f76387cc7
4 changed files with 246 additions and 180 deletions
+13 -174
View File
@@ -39,13 +39,7 @@
<image class="search-icon-white" src="/static/icon/search.svg" mode="aspectFit" />
</view>
</view>
<view class="bar-rank-card" v-if="index === 0">
<scroll-view class="bar-scroll" scroll-x :show-scrollbar="false" enhanced>
<view class="bar-scroll__inner" :style="{ width: barChartWidth }">
<card_echart :options="barChartOptions" />
</view>
</scroll-view>
</view>
<aistore_bar_chart v-if="index === 0" :list="barRankList" :colors="barColors" />
<!-- <view class="m-t-16 m-b-8" v-if="timeRound.length && index === 0">
<scroll-view scroll-x class="time-scroll">
<view class="flex">
@@ -140,13 +134,13 @@
</template>
<script setup>
import { ref, watch, computed, nextTick } from 'vue';
import { onLoad, onShow, onHide, onUnload } from '@dcloudio/uni-app';
import { ref, watch, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import sheep from '@/sheep';
import * as api from '@/sheep/api/ai/index';
import card_echart from '@/components/card_echart/card_echart.vue';
import card_pages from '@/components/card_pages/card_pages';
import card_payment from '@/components/card_payment/card_payment';
import aistore_bar_chart from './components/aistore_bar_chart.vue';
import aistore_tab1 from './components/aistore_tab1.vue';
import aistore_tab2 from './components/aistore_tab2.vue';
@@ -188,121 +182,17 @@
const timeRound = ref([]);
const selectedTimeId = ref(null);
const navName = ref('');
const barColors = ref(['#FF6B6B', '#FFB020', '#2ED573', '#1E90FF', '#A66BFF']);
const barRankList = ref([
{ id: 1, value: 88, avatar: '/static/head_null.png', color: '#FF6B6B' },
{ id: 2, value: 52, avatar: '/static/head_null.png', color: '#FFB020' },
{ id: 3, value: 120, avatar: '/static/head_null.png', color: '#2ED573' },
{ id: 4, value: 76, avatar: '/static/head_null.png', color: '#1E90FF' },
{ id: 5, value: 76, avatar: '/static/head_null.png', color: '#A66BFF' },
{ id: 6, value: 66, avatar: '/static/head_null.png', color: '#A66BFF' },
{ id: 7, value: 16, avatar: '/static/head_null.png', color: '#A66BFF' },
{ id: 8, value: 86, avatar: '/static/head_null.png', color: '#A66BFF' },
{ id: 1, value: 88, avatar: '/static/head_null.png' },
{ id: 2, value: 52, avatar: '/static/head_null.png' },
{ id: 3, value: 120, avatar: '/static/head_null.png' },
{ id: 4, value: 76, avatar: '/static/head_null.png' },
{ id: 5, value: 76, avatar: '/static/head_null.png' },
{ id: 6, value: 66, avatar: '/static/head_null.png' },
{ id: 7, value: 16, avatar: '/static/head_null.png' },
{ id: 8, value: 86, avatar: '/static/head_null.png' },
]);
const barRankDisplayList = ref(barRankList.value.map((it) => ({ ...it })));
const barChartAnimatedOnce = ref(false);
let barIntroTimer = null;
const barChartWidth = computed(() => {
const list = Array.isArray(barRankList.value) ? barRankList.value : [];
if (list.length <= 6) return '100%';
return `${list.length * 120}rpx`;
});
const resetBarDisplay = () => {
barRankDisplayList.value = barRankList.value.map((it) => ({ ...it }));
};
const startBarIntroAnimation = async () => {
if (barChartAnimatedOnce.value) return;
if (barIntroTimer) {
clearTimeout(barIntroTimer);
barIntroTimer = null;
}
barRankDisplayList.value = barRankList.value.map((it) => ({ ...it, value: 0 }));
await nextTick();
barIntroTimer = setTimeout(() => {
resetBarDisplay();
barChartAnimatedOnce.value = true;
barIntroTimer = null;
}, 80);
};
const barChartOptions = computed(() => {
const list = Array.isArray(barRankDisplayList.value) ? barRankDisplayList.value : [];
const xData = list.map((_, i) => `Top${i + 1}`);
const barData = list.map((it) => ({
name: String(it?.id ?? ''),
value: Number(it?.value) || 0,
itemStyle: {
color: it?.color || '#3d5efb',
borderRadius: [0, 0, 0, 0],
},
}));
const avatarData = list.map((it) => ({
name: String(it?.id ?? ''),
value: Number(it?.value) || 0,
symbol: `image://${it?.avatar || '/static/head_null.png'}`,
}));
return {
animation: true,
animationDuration: 900,
animationEasing: 'cubicOut',
animationDurationUpdate: 900,
animationEasingUpdate: 'cubicOut',
grid: { left: 0, right: 0, top: 46, bottom: 22, containLabel: false },
xAxis: {
type: 'category',
data: xData,
axisLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,0.45)',
width: 1,
},
},
axisTick: { show: false },
axisLabel: {
show: true,
color: 'rgba(255,255,255,0.85)',
fontSize: 10,
margin: 10,
},
},
yAxis: { type: 'value', show: false, min: 0 },
series: [
{
id: 'bars',
type: 'bar',
data: barData,
barWidth: '42%',
barCategoryGap: '42%',
universalTransition: true,
label: {
show: true,
position: 'inside',
color: '#ffffff',
fontSize: 12,
fontWeight: 700,
formatter: (p) => {
const v = Number(p?.value) || 0;
return v ? String(v) : '';
},
},
animationDelay: (idx) => idx * 140,
animationDelayUpdate: (idx) => idx * 140,
},
{
id: 'avatars',
type: 'pictorialBar',
data: avatarData,
symbolSize: [28, 28],
symbolPosition: 'end',
symbolOffset: [0, -34],
z: 10,
universalTransition: true,
animationDelay: (idx) => idx * 140,
animationDelayUpdate: (idx) => idx * 140,
},
],
};
});
function changeTimeRound(e) {
navName.value = e.name;
@@ -400,27 +290,6 @@
}
getSpuTimeList();
getCartList();
if (index.value === 0) {
startBarIntroAnimation();
} else {
resetBarDisplay();
}
});
onHide(() => {
if (barIntroTimer) {
clearTimeout(barIntroTimer);
barIntroTimer = null;
}
resetBarDisplay();
});
onUnload(() => {
if (barIntroTimer) {
clearTimeout(barIntroTimer);
barIntroTimer = null;
}
resetBarDisplay();
});
const update = () => {
@@ -442,21 +311,6 @@
const height = ref(`${baseHeight}px`);
const hasPaymentBar = ref(false);
watch(
() => index.value,
(val) => {
if (val === 0) {
startBarIntroAnimation();
return;
}
if (barIntroTimer) {
clearTimeout(barIntroTimer);
barIntroTimer = null;
}
resetBarDisplay();
},
);
watch(
() => hasPaymentBar.value,
() => {
@@ -666,21 +520,6 @@
filter: brightness(0) invert(1);
}
.bar-rank-card {
margin-top: 18rpx;
padding: 18rpx 24rpx 22rpx;
height: 300rpx;
}
.bar-scroll {
width: 100%;
height: 100%;
}
.bar-scroll__inner {
height: 100%;
}
.time-scroll {
width: 100%;
white-space: nowrap;