Compare commits

..

2 Commits

Author SHA1 Message Date
Leo_Ding
bc094f968c Merge branch 'main' of https://gitlab.guxuan.icu/Leo_Ding/GPU_Web 2026-01-12 09:19:56 +08:00
Leo_Ding
95ebb443e7 接口对接 2026-01-12 09:19:50 +08:00
8 changed files with 129 additions and 39 deletions

View File

@ -2,5 +2,5 @@
NODE_ENV=development NODE_ENV=development
# api # api
VITE_API_BASIC="http://10.10.1.20:8888" VITE_API_BASIC="http://10.10.1.35:8888"

View File

@ -13,3 +13,12 @@ export const getHotProduct = () => request.get('/v1/product/host_info')
// 获取首页One列表 // 获取首页One列表
export const getApiOneList = () => request.get('/v1/home/home_top_labels') export const getApiOneList = () => request.get('/v1/home/home_top_labels')
// 获取我的算力券总额
export const getMyCouponTotal = () => request.get('/v1/voucher/voucher_value')
// 获取算力券列表
export const getRecommendList = () => request.get('/v1/voucher/voucher_list')
//获取消息列表
export const getMessageList = (params:any) => request.get('/v1/message/message_list', { params })

View File

@ -64,7 +64,7 @@ const menuItems: MenuItem[] = [
{ path: '/controlPanel/publicData', name: '公开数据', icon: LaptopOutlined }, { path: '/controlPanel/publicData', name: '公开数据', icon: LaptopOutlined },
{ {
path: '/contract', path: '/contract',
name: '费用', name: '费用中心',
icon: MoneyCollectOutlined, icon: MoneyCollectOutlined,
children: [ children: [
{ path: '/contract', name: '合同' }, { path: '/contract', name: '合同' },
@ -73,7 +73,7 @@ const menuItems: MenuItem[] = [
}, },
{ {
path: '/controlPanel/account', path: '/controlPanel/account',
name: '账号', name: '我的账号',
icon: TeamOutlined, icon: TeamOutlined,
children: [ children: [
{ path: '/accountSecurity', name: '账号安全' }, { path: '/accountSecurity', name: '账号安全' },

View File

@ -247,14 +247,16 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onUnmounted, watch } from 'vue'; import { ref, computed, onUnmounted, watch,onBeforeMount } from 'vue';
import { LoadingOutlined, PlusOutlined } from '@ant-design/icons-vue'; import { LoadingOutlined, PlusOutlined } from '@ant-design/icons-vue';
import { message, Modal as AModal, Input as AInput, InputPassword as AInputPassword, Button as AButton } from 'ant-design-vue'; import { message, Modal as AModal, Input as AInput, InputPassword as AInputPassword, Button as AButton } from 'ant-design-vue';
import{certificationInfoApi} from '@/apis/certification';
const loading = ref(false); const loading = ref(false);
const imageUrl = ref<string | null>("https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"); const imageUrl = ref<string | null>("https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png");
const fileList = ref<any[]>([{ url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' }]); const fileList = ref<any[]>([{ url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' }]);
const userInfo=ref<any>({})
const certificationInfo=ref<any>({})
// //
const operationType = ref<'phone' | 'password'>('phone'); const operationType = ref<'phone' | 'password'>('phone');
@ -817,6 +819,23 @@ const resetPasswordStates = () => {
newPasswordError.value = ''; newPasswordError.value = '';
confirmPasswordError.value = ''; confirmPasswordError.value = '';
}; };
const getCertificationInfo = async () => {
try {
const res=await certificationInfoApi();
certificationInfo.value=res;
} catch (error) {
message.error('获取认证信息失败');
}
};
onBeforeMount(()=>{
const userInfoStr = localStorage.getItem('userInfo');
if (userInfoStr) {
userInfo.value=JSON.parse(userInfoStr);
if(userInfo.value.certificationStatus==='CERTIFICATION_PASSED'){
getCertificationInfo();
}
}
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -1,10 +1,10 @@
<template> <template>
<a-card title="我的消息"> <a-card title="我的消息">
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="全部"></a-tab-pane> <a-tab-pane key="all" tab="全部"></a-tab-pane>
<a-tab-pane key="2" tab="资金消息" force-render></a-tab-pane> <a-tab-pane key="money" tab="资金消息" force-render></a-tab-pane>
<a-tab-pane key="3" tab="安全消息"></a-tab-pane> <a-tab-pane key="secure" tab="安全消息"></a-tab-pane>
<a-tab-pane key="4" tab="活动消息"></a-tab-pane> <a-tab-pane key="active" tab="活动消息"></a-tab-pane>
</a-tabs> </a-tabs>
<a-table :columns="columns" :data-source="billData" :pagination="pagination" @change="handleTableChange" <a-table :columns="columns" :data-source="billData" :pagination="pagination" @change="handleTableChange"
:loading="loading" class="bill-table" :scroll="{ x: 1200 }" bordered> :loading="loading" class="bill-table" :scroll="{ x: 1200 }" bordered>
@ -12,7 +12,8 @@
</a-card> </a-card>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref,onBeforeMount } from 'vue';
import { getMessageList } from '@/apis/home';
const activeKey = ref('1'); const activeKey = ref('1');
const loading = ref(false); const loading = ref(false);
const billData = ref([]) const billData = ref([])
@ -42,6 +43,7 @@ const columns = [
width: 100, width: 100,
}, },
]; ];
const messageType=ref("")
const pagination = ref({ const pagination = ref({
current: 1, current: 1,
pageSize: 10, pageSize: 10,
@ -52,4 +54,24 @@ const pagination = ref({
}) })
// //
const handleTableChange = () => {} const handleTableChange = () => {}
const getDataList=async()=>{
loading.value = true
try {
//
const response:any = await getMessageList({
page_num: pagination.value.current,
page_size: pagination.value.pageSize,
Message:messageType.value
});
billData.value = response.data; // response.data.messages
pagination.value.total = response.total; // response.data.total
} catch (error) {
console.error('获取消息列表失败:', error);
} finally {
loading.value = false
}
}
onBeforeMount(() => {
getDataList()
})
</script> </script>

View File

@ -4,51 +4,61 @@
<div <div
style="background: linear-gradient(90deg, rgba(240, 245, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);height: 45px;line-height: 45px;padding: 0 10px;"> style="background: linear-gradient(90deg, rgba(240, 245, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);height: 45px;line-height: 45px;padding: 0 10px;">
可用算力券</div> 可用算力券</div>
<div style="font-size:18px;font-weight: bold;padding: 0 10px;">0.00</div> <div style="font-size:18px;font-weight: bold;padding: 0 10px;">{{ couponTotal }}</div>
</div> </div>
<!-- 账单表格 --> <!-- 账单表格 -->
<div style="margin-top: 20px;"> <div style="margin-top: 20px;">
<a-table :columns="columns" :data-source="billData" :pagination="pagination" @change="handleTableChange" <a-table :columns="columns" :data-source="billData" :pagination="pagination" @change="handleTableChange"
:loading="loading" class="bill-table" :scroll="{ x: 1200 }" bordered> :loading="loading" class="bill-table" :scroll="{ x: 1200 }" bordered>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 'enabled'" color="green">有效</a-tag>
<a-tag v-else color="red">失效</a-tag>
</template>
</template>
</a-table> </a-table>
</div> </div>
</a-card> </a-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref, onBeforeMount, h } from 'vue';
import { getMyCouponTotal, getRecommendList } from '@/apis/home';
import { message } from 'ant-design-vue';
const loading = ref(false); const loading = ref(false);
const billData = ref([]) const billData = ref([])
const couponTotal = ref(0);
const columns = [ const columns = [
{ {
title: '算力券名称', title: '算力券名称',
dataIndex: 'couponId', dataIndex: 'name',
key: 'couponId', key: 'name',
width: 200, width: 200,
}, },
{ {
title: '适用范围', title: '金额',
dataIndex: 'value', dataIndex: 'amount',
key: 'value', key: 'amount',
width: 100, width: 200,
}, },
{ {
title: '生效时间', title: '生效时间',
dataIndex: 'acquisitionMethod', dataIndex: 'StartAt',
key: 'acquisitionMethod', key: 'StartAt',
width: 150, width: 150,
}, },
{ {
title: '失效时间', title: '失效时间',
dataIndex: 'status', dataIndex: 'EndAt',
key: 'status', key: 'EndAt',
width: 100, width: 100,
}, },
{ {
title: '余额', title: '状态',
dataIndex: 'validityPeriod', dataIndex: 'status',
key: 'validityPeriod', key: 'status',
width: 200, width: 100,
}, }
]; ];
const pagination = ref({ const pagination = ref({
current: 1, current: 1,
@ -63,4 +73,34 @@ const handleTableChange = () => {
} }
const getBillData = () => {
loading.value = true;
try {
getRecommendList().then((res: any) => {
console.log('res', res);
billData.value = res.data;
pagination.value.total = res.total;
loading.value = false;
})
} catch (error) {
loading.value = false;
message.error('获取算力券列表失败');
}
};
const getValue = () => {
//
try {
getMyCouponTotal().then((res: any) => {
console.log('res', res);
couponTotal.value = res;
})
} catch (error) {
message.error('获取算力券总额失败');
}
};
onBeforeMount(() => {
//
getValue()
getBillData()
})
</script> </script>

View File

@ -140,13 +140,13 @@ const getCertificationInfo = async () => {
} }
}; };
onMounted(() => { onMounted(() => {
// const userInfoStr = localStorage.getItem('userInfo'); const userInfoStr = localStorage.getItem('userInfo');
// if (userInfoStr) { if (userInfoStr) {
// userInfo.value=JSON.parse(userInfoStr); userInfo.value=JSON.parse(userInfoStr);
// if(userInfo.value.certificationStatus==='CERTIFICATION_PASSED'){ if(userInfo.value.certificationStatus==='CERTIFICATION_PASSED'){
// getCertificationInfo(); getCertificationInfo();
// } }
// } }
}) })
</script> </script>

View File

@ -58,7 +58,7 @@ const menuItems: MenuItem[] = [
{ path: '/layout/admin/image', name: '镜像', icon: GlobalOutlined, visible: true }, { path: '/layout/admin/image', name: '镜像', icon: GlobalOutlined, visible: true },
{ {
path: '', path: '',
name: '费用', name: '费用中心',
icon: MoneyCollectOutlined, icon: MoneyCollectOutlined,
visible: true, visible: true,
children: [ children: [
@ -79,12 +79,12 @@ const menuItems: MenuItem[] = [
}, },
{ {
path: '', path: '',
name: '账号', name: '我的账号',
icon: TeamOutlined, icon: TeamOutlined,
visible: true, visible: true,
children: [ children: [
{ path: '/layout/admin/security', name: '账号安全', visible: true }, // { path: '/layout/admin/security', name: '', visible: true },
{ path: '/layout/admin/history', name: '访问记录', visible: true }, // { path: '/layout/admin/history', name: '访', visible: true },
{ path: '/layout/admin/accountSet', name: '账户设置', visible: true }, { path: '/layout/admin/accountSet', name: '账户设置', visible: true },
{ path: '/layout/admin/realnameAuth', name: '实名认证', visible: true }, { path: '/layout/admin/realnameAuth', name: '实名认证', visible: true },
{ path: '/layout/admin/myCertificate', name: '我的算力券', visible: true }, { path: '/layout/admin/myCertificate', name: '我的算力券', visible: true },