+ @click="router.push(item.link_url)">
![]()
{{ item.title }}
@@ -179,39 +179,39 @@ const fetchBannerList = async () => {
};
// 请求轮播
const getOneList = async () => {
- try {
- const res: any = await getApiOneList();
- // 处理返回的数据
- if (res && Array.isArray(res) && res.length > 0) {
- oneList.value = res;
- } else {
- // API返回空数据或无效数据,使用默认图片
- oneList.value = [{ id: 0, image_url: defaultBanner }];
- }
- } catch (error: any) {
- console.error('轮播图请求失败:', error);
+ // try {
+ // const res: any = await getApiOneList();
+ // // 处理返回的数据
+ // if (res && Array.isArray(res) && res.length > 0) {
+ // oneList.value = res;
+ // } else {
+ // // API返回空数据或无效数据,使用默认图片
+ // oneList.value = [{ id: 0, image_url: defaultBanner }];
+ // }
+ // } catch (error: any) {
+ // console.error('轮播图请求失败:', error);
// 请求失败时使用默认图片
oneList.value = [
{
img: youhuiquan,
title: '算力免费领',
description: '完成认证/问卷获得算力券',
- path: '/active/newUser'
+ link_url: '/active/newUser'
},
{
img: yaoqinghaoyou,
title: '邀约优算友',
description: '邀请好友可获得算力券',
- path: '/active/invite'
+ link_url: '/active/invite'
},
{
img: goumaijilu,
title: '开业重磅福利',
description: '购算力,享豪礼',
- path: '/active/newUser'
+ link_url: '/active/newUser'
}
]
- }
+ // }
};
// 请求GPU列表
const getGPUList = async () => {
@@ -231,17 +231,17 @@ const getAdvantageList = async () => {
const res: any = await getAdvantage();
const list = res || [];
// 给每个 item 添加 img 字段
- // list.forEach((item: any, index: number) => {
- // if (index === 0) {
- // item.img = one;
- // } else if (index === 1) {
- // item.img = two;
- // } else if (index === 2) {
- // item.img = three;
- // } else {
- // item.img = firth;
- // }
- // });
+ list.forEach((item: any, index: number) => {
+ if (index === 0) {
+ item.img = one;
+ } else if (index === 1) {
+ item.img = two;
+ } else if (index === 2) {
+ item.img = three;
+ } else {
+ item.img = firth;
+ }
+ });
advantageList.value = list;
} catch (error: any) {
diff --git a/src/views/instanceCreate/index.vue b/src/views/instanceCreate/index.vue
index 7f4a0c0..61f9ffd 100644
--- a/src/views/instanceCreate/index.vue
+++ b/src/views/instanceCreate/index.vue
@@ -23,7 +23,15 @@