代码修改
This commit is contained in:
parent
36b85fedcd
commit
2f6664b46d
@ -62,3 +62,7 @@ export const exchangePoint = (params:any) => request.put('/v1/balance/exchange_p
|
|||||||
|
|
||||||
// 提现
|
// 提现
|
||||||
export const getWithdraw = (params:any) => request.put('/v1/balance/withdraw',params)
|
export const getWithdraw = (params:any) => request.put('/v1/balance/withdraw',params)
|
||||||
|
|
||||||
|
// 控制台总览界面
|
||||||
|
export const hostCaseCollection = () => request.get('/v1/user_home/host_case_collection')
|
||||||
|
|
||||||
|
|||||||
@ -13,16 +13,16 @@
|
|||||||
<div class="stats-row">
|
<div class="stats-row">
|
||||||
<div class="stat-item">
|
<div class="stat-item">
|
||||||
<div class="stat-label">进行中</div>
|
<div class="stat-label">进行中</div>
|
||||||
<div class="stat-value">0</div>
|
<div class="stat-value">{{ infoMessgae.runingCount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-item">
|
<div class="stat-item">
|
||||||
<div class="stat-label">即将到期</div>
|
<div class="stat-label">即将到期</div>
|
||||||
<div class="stat-value">0</div>
|
<div class="stat-value">{{ infoMessgae.wellCount }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="stat-item">
|
<div class="stat-item">
|
||||||
<div class="stat-label">自动续费</div>
|
<div class="stat-label">自动续费</div>
|
||||||
<div class="stat-value">0</div>
|
<div class="stat-value">{{ infoMessgae.autoPayCount }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -183,7 +183,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onBeforeMount } from 'vue'
|
import { ref, onBeforeMount, onMounted } from 'vue'
|
||||||
import {
|
import {
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
GiftOutlined,
|
GiftOutlined,
|
||||||
@ -200,17 +200,27 @@ import {
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
import { debounce } from '@/utils/debounce.js'
|
import { debounce } from '@/utils/debounce.js'
|
||||||
|
import { hostCaseCollection } from '@/apis/admin'
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
// 实例卡片的开关状态
|
// 实例卡片的开关状态
|
||||||
const switch1 = ref(true)
|
const switch1 = ref(true)
|
||||||
const switch2 = ref(false)
|
const switch2 = ref(false)
|
||||||
const userInfo = ref<any>({})
|
const userInfo = ref<any>({})
|
||||||
|
const infoMessgae = ref<any>({})
|
||||||
|
|
||||||
// 资产数据
|
// 资产数据
|
||||||
const balance = ref<number>(0) // 余额
|
const balance = ref<number>(0) // 余额
|
||||||
const computingPoints = ref<number>(5000) // 算力点
|
const computingPoints = ref<number>(5000) // 算力点
|
||||||
const availableCoupons = ref<number>(3) // 可用算力券数量
|
const availableCoupons = ref<number>(3) // 可用算力券数量
|
||||||
|
|
||||||
|
// onMounted(() => {
|
||||||
|
// userInfo.value = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
||||||
|
// // 模拟从API获取数据
|
||||||
|
// fetchUserAssets()
|
||||||
|
// })
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
userInfo.value = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
userInfo.value = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
||||||
// 模拟从API获取数据
|
// 模拟从API获取数据
|
||||||
@ -237,13 +247,19 @@ const formatComputingPoints = (points: number): string => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户资产信息
|
// 获取用户资产信息
|
||||||
const fetchUserAssets = () => {
|
const fetchUserAssets = async() => {
|
||||||
// 这里应该调用API获取真实数据
|
// 这里应该调用API获取真实数据
|
||||||
// 模拟数据
|
// 模拟数据
|
||||||
computingPoints.value = 5000 // 5,000算力点
|
computingPoints.value = 5000 // 5,000算力点
|
||||||
availableCoupons.value = 3 // 3张算力券
|
availableCoupons.value = 3 // 3张算力券
|
||||||
|
|
||||||
|
const res = await hostCaseCollection();
|
||||||
|
infoMessgae.value = {...res}
|
||||||
|
console.log("======????",res);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 生成邀请链接
|
// 生成邀请链接
|
||||||
const generateInviteLink = () => {
|
const generateInviteLink = () => {
|
||||||
// 这里应该是调用API生成邀请链接的逻辑
|
// 这里应该是调用API生成邀请链接的逻辑
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user