feat: 添加空状态组件,优化数据为空时的展示效果
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang='ts' setup>
|
||||
import type { RwaData } from "@/api/types";
|
||||
import CryptocurrencyColorNuls from "~icons/cryptocurrency-color/nuls";
|
||||
import ui from "@/ui";
|
||||
|
||||
defineProps<{
|
||||
data: RwaData[];
|
||||
@@ -38,47 +39,52 @@ function gotoTradeRwa(id: string) {
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
<div v-for="item in data" :key="item.id" @click="gotoTradeRwa(item.id)">
|
||||
<ion-grid>
|
||||
<ion-row class="ion-align-items-center my-5">
|
||||
<ion-col size="6" class="flex items-center">
|
||||
<div class="mr-3">
|
||||
<CryptocurrencyColorNuls class="text-3xl" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-sm font-semibold mb-1 truncate">
|
||||
{{ item.product?.name }}
|
||||
<template v-if="data.length === 0">
|
||||
<ui-empty />
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-for="item in data" :key="item.id" @click="gotoTradeRwa(item.id)">
|
||||
<ion-grid>
|
||||
<ion-row class="ion-align-items-center my-5">
|
||||
<ion-col size="6" class="flex items-center">
|
||||
<div class="mr-3">
|
||||
<CryptocurrencyColorNuls class="text-3xl" />
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<div class="text-xs text-text-500">
|
||||
{{ item.product?.code }}
|
||||
<div>
|
||||
<div class="text-sm font-semibold mb-1 truncate">
|
||||
{{ item.product?.name }}
|
||||
</div>
|
||||
<div class="text-xs rounded-md px-1 py-0.5 bg-text-800">
|
||||
{{ item.product.category?.name }}
|
||||
<div class="flex items-center space-x-2">
|
||||
<div class="text-xs text-text-500">
|
||||
{{ item.product?.code }}
|
||||
</div>
|
||||
<div class="text-xs rounded-md px-1 py-0.5 bg-text-800">
|
||||
{{ item.product.category?.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
{{ item.editionName }}
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
{{ useDateFormat(item.launchDate!, 'MM/DD') }}
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div v-if="item.unitPrice" class="text-right">
|
||||
<div class="text-lg font-bold text-primary">
|
||||
${{ Number(item.unitPrice) }}
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
{{ item.editionName }}
|
||||
</div>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
{{ useDateFormat(item.launchDate!, 'MM/DD') }}
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div v-if="item.unitPrice" class="text-right">
|
||||
<div class="text-lg font-bold text-primary">
|
||||
${{ Number(item.unitPrice) }}
|
||||
</div>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -58,11 +58,9 @@ onMounted(() => {
|
||||
<ion-spinner />
|
||||
</div>
|
||||
|
||||
<div v-else-if="holdingsData.length === 0" class="flex flex-col justify-center items-center h-64">
|
||||
<div class="text-text-500">
|
||||
{{ t('holdings.empty') }}
|
||||
</div>
|
||||
</div>
|
||||
<template v-else-if="holdingsData.length === 0">
|
||||
<ui-empty />
|
||||
</template>
|
||||
|
||||
<div v-else class="space-y-3">
|
||||
<div
|
||||
|
||||
@@ -32,41 +32,46 @@ function gotoTokenized(id: string) {
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
<div v-for="item in data" :key="item.id" @click="gotoTokenized(item.id)">
|
||||
<ion-grid>
|
||||
<ion-row class="ion-align-items-center my-5">
|
||||
<ion-col size="6" class="flex items-center">
|
||||
<div class="mr-3">
|
||||
<CryptocurrencyColorNuls class="text-3xl" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-sm font-semibold mb-1 truncate">
|
||||
{{ item.product?.name }}
|
||||
<template v-if="data.length === 0">
|
||||
<ui-empty />
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-for="item in data" :key="item.id" @click="gotoTokenized(item.id)">
|
||||
<ion-grid>
|
||||
<ion-row class="ion-align-items-center my-5">
|
||||
<ion-col size="6" class="flex items-center">
|
||||
<div class="mr-3">
|
||||
<CryptocurrencyColorNuls class="text-3xl" />
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<div class="text-xs text-text-500">
|
||||
{{ item.product?.code }}
|
||||
<div>
|
||||
<div class="text-sm font-semibold mb-1 truncate">
|
||||
{{ item.product?.name }}
|
||||
</div>
|
||||
<div class="text-xs rounded-md px-1 py-0.5 bg-text-800">
|
||||
{{ item.product?.category?.name }}
|
||||
<div class="flex items-center space-x-2">
|
||||
<div class="text-xs text-text-500">
|
||||
{{ item.product?.code }}
|
||||
</div>
|
||||
<div class="text-xs rounded-md px-1 py-0.5 bg-text-800">
|
||||
{{ item.product?.category?.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-col>
|
||||
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
+12.6%
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
连涨3天
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
+12.6%
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
连涨3天
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -21,7 +21,11 @@ function openNewsDetail(item: NewData) {
|
||||
动态新闻
|
||||
</div>
|
||||
|
||||
<div class="space-y-3">
|
||||
<template v-if="data?.data.length === 0">
|
||||
<ui-empty />
|
||||
</template>
|
||||
|
||||
<div v-else class="space-y-3">
|
||||
<div
|
||||
v-for="item in data?.data"
|
||||
:key="item.id"
|
||||
|
||||
Reference in New Issue
Block a user