接口对接
This commit is contained in:
parent
da3ffcb355
commit
95ebb443e7
2
.env.dev
2
.env.dev
@ -2,5 +2,5 @@
|
||||
NODE_ENV=development
|
||||
|
||||
# api
|
||||
VITE_API_BASIC="http://10.10.1.20:8888"
|
||||
VITE_API_BASIC="http://10.10.1.35:8888"
|
||||
|
||||
|
||||
@ -13,3 +13,12 @@ export const getHotProduct = () => request.get('/v1/product/host_info')
|
||||
|
||||
// 获取首页One列表
|
||||
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 })
|
||||
@ -64,7 +64,7 @@ const menuItems: MenuItem[] = [
|
||||
{ path: '/controlPanel/publicData', name: '公开数据', icon: LaptopOutlined },
|
||||
{
|
||||
path: '/contract',
|
||||
name: '费用',
|
||||
name: '费用中心',
|
||||
icon: MoneyCollectOutlined,
|
||||
children: [
|
||||
{ path: '/contract', name: '合同' },
|
||||
@ -73,7 +73,7 @@ const menuItems: MenuItem[] = [
|
||||
},
|
||||
{
|
||||
path: '/controlPanel/account',
|
||||
name: '账号',
|
||||
name: '我的账号',
|
||||
icon: TeamOutlined,
|
||||
children: [
|
||||
{ path: '/accountSecurity', name: '账号安全' },
|
||||
|
||||
@ -247,14 +247,16 @@
|
||||
</template>
|
||||
|
||||
<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 { 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 imageUrl = ref<string | null>("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');
|
||||
|
||||
@ -817,6 +819,23 @@ const resetPasswordStates = () => {
|
||||
newPasswordError.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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<a-card title="我的消息">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="全部"></a-tab-pane>
|
||||
<a-tab-pane key="2" tab="资金消息" force-render></a-tab-pane>
|
||||
<a-tab-pane key="3" tab="安全消息"></a-tab-pane>
|
||||
<a-tab-pane key="4" tab="活动消息"></a-tab-pane>
|
||||
<a-tab-pane key="all" tab="全部"></a-tab-pane>
|
||||
<a-tab-pane key="money" tab="资金消息" force-render></a-tab-pane>
|
||||
<a-tab-pane key="secure" tab="安全消息"></a-tab-pane>
|
||||
<a-tab-pane key="active" tab="活动消息"></a-tab-pane>
|
||||
</a-tabs>
|
||||
<a-table :columns="columns" :data-source="billData" :pagination="pagination" @change="handleTableChange"
|
||||
:loading="loading" class="bill-table" :scroll="{ x: 1200 }" bordered>
|
||||
@ -12,7 +12,8 @@
|
||||
</a-card>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref,onBeforeMount } from 'vue';
|
||||
import { getMessageList } from '@/apis/home';
|
||||
const activeKey = ref('1');
|
||||
const loading = ref(false);
|
||||
const billData = ref([])
|
||||
@ -42,6 +43,7 @@ const columns = [
|
||||
width: 100,
|
||||
},
|
||||
];
|
||||
const messageType=ref("")
|
||||
const pagination = ref({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
@ -52,4 +54,24 @@ const pagination = ref({
|
||||
})
|
||||
// 表格变化处理
|
||||
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>
|
||||
@ -4,51 +4,61 @@
|
||||
<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;">
|
||||
可用算力券</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 style="margin-top: 20px;">
|
||||
<a-table :columns="columns" :data-source="billData" :pagination="pagination" @change="handleTableChange"
|
||||
: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>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
<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 billData = ref([])
|
||||
const couponTotal = ref(0);
|
||||
const columns = [
|
||||
{
|
||||
title: '算力券名称',
|
||||
dataIndex: 'couponId',
|
||||
key: 'couponId',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '适用范围',
|
||||
dataIndex: 'value',
|
||||
key: 'value',
|
||||
width: 100,
|
||||
title: '金额',
|
||||
dataIndex: 'amount',
|
||||
key: 'amount',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '生效时间',
|
||||
dataIndex: 'acquisitionMethod',
|
||||
key: 'acquisitionMethod',
|
||||
dataIndex: 'StartAt',
|
||||
key: 'StartAt',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '失效时间',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'EndAt',
|
||||
key: 'EndAt',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '余额',
|
||||
dataIndex: 'validityPeriod',
|
||||
key: 'validityPeriod',
|
||||
width: 200,
|
||||
},
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
width: 100,
|
||||
}
|
||||
|
||||
];
|
||||
const pagination = ref({
|
||||
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>
|
||||
@ -140,13 +140,13 @@ const getCertificationInfo = async () => {
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
// const userInfoStr = localStorage.getItem('userInfo');
|
||||
// if (userInfoStr) {
|
||||
// userInfo.value=JSON.parse(userInfoStr);
|
||||
// if(userInfo.value.certificationStatus==='CERTIFICATION_PASSED'){
|
||||
// getCertificationInfo();
|
||||
// }
|
||||
// }
|
||||
const userInfoStr = localStorage.getItem('userInfo');
|
||||
if (userInfoStr) {
|
||||
userInfo.value=JSON.parse(userInfoStr);
|
||||
if(userInfo.value.certificationStatus==='CERTIFICATION_PASSED'){
|
||||
getCertificationInfo();
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ const menuItems: MenuItem[] = [
|
||||
{ path: '/layout/admin/image', name: '镜像', icon: GlobalOutlined, visible: true },
|
||||
{
|
||||
path: '',
|
||||
name: '费用',
|
||||
name: '费用中心',
|
||||
icon: MoneyCollectOutlined,
|
||||
visible: true,
|
||||
children: [
|
||||
@ -79,12 +79,12 @@ const menuItems: MenuItem[] = [
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
name: '账号',
|
||||
name: '我的账号',
|
||||
icon: TeamOutlined,
|
||||
visible: true,
|
||||
children: [
|
||||
{ path: '/layout/admin/security', name: '账号安全', visible: true },
|
||||
{ path: '/layout/admin/history', name: '访问记录', visible: true },
|
||||
// { path: '/layout/admin/security', name: '账号安全', visible: true },
|
||||
// { path: '/layout/admin/history', name: '访问记录', visible: true },
|
||||
{ path: '/layout/admin/accountSet', name: '账户设置', visible: true },
|
||||
{ path: '/layout/admin/realnameAuth', name: '实名认证', visible: true },
|
||||
{ path: '/layout/admin/myCertificate', name: '我的算力券', visible: true },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user