feat: 添加我的发行申请页面及相关组件,更新路由和国际化支持
This commit is contained in:
23
src/views/trade-settings/my-issues/components/about.vue
Normal file
23
src/views/trade-settings/my-issues/components/about.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang='ts' setup>
|
||||
import type { MyIssueRwaData } from "@/api/types";
|
||||
|
||||
const props = defineProps<{
|
||||
data: MyIssueRwaData | null;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-2">
|
||||
<!-- document -->
|
||||
<div class="mt-5">
|
||||
<div class="font-semibold">
|
||||
相关文档
|
||||
</div>
|
||||
<div class="text-xs mt-2">
|
||||
{{ data?.proofDocuments }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped></style>
|
||||
60
src/views/trade-settings/my-issues/components/base.vue
Normal file
60
src/views/trade-settings/my-issues/components/base.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<script lang='ts' setup>
|
||||
import type { MyIssueRwaData } from "@/api/types";
|
||||
|
||||
const props = defineProps<{
|
||||
data: MyIssueRwaData | null;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-2">
|
||||
<!-- Rwa about -->
|
||||
<div class="mt-5">
|
||||
<div class="font-semibold">
|
||||
{{ t('market.tradeRwa.about') }}
|
||||
</div>
|
||||
<div class="text-xs mt-2">
|
||||
{{ data?.description || t('market.tradeRwa.noDescription') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rwa fields -->
|
||||
<ion-grid class="mt-5 text-sm space-y-5">
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<div class="label">
|
||||
{{ t('market.tradeRwa.fields.productCode') }}
|
||||
</div>
|
||||
<div>{{ data?.code }}</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="label">
|
||||
{{ t('market.tradeRwa.fields.valuation') }}
|
||||
</div>
|
||||
<div>${{ formatAmount(data?.estimatedValue) }}</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
<!-- Rwa status -->
|
||||
<div class="mt-5">
|
||||
<div class="font-semibold">
|
||||
资产状态
|
||||
</div>
|
||||
<div class="text-xs mt-2">
|
||||
{{ data?.status }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rwa status history -->
|
||||
<div class="mt-5">
|
||||
<div class="font-semibold">
|
||||
状态历史
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped></style>
|
||||
47
src/views/trade-settings/my-issues/components/category.vue
Normal file
47
src/views/trade-settings/my-issues/components/category.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<script lang='ts' setup>
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
const { t } = useI18n();
|
||||
const model = defineModel({ type: String, default: "" });
|
||||
|
||||
const { data: categories } = await safeClient(() => client.api.rwa.category.categories.get());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ion-content :scroll-x="true" :scroll-y="false" class="w-full h-6">
|
||||
<div class="flex items-center whitespace-nowrap space-x-4">
|
||||
<div class="item" :class="{ active: model === '' }" @click="model = ''">
|
||||
{{ t('market.category.all') }}
|
||||
</div>
|
||||
<div
|
||||
v-for="item in categories?.data"
|
||||
:key="item.id"
|
||||
class="item"
|
||||
:class="{ active: model === item.id }"
|
||||
@click="model = item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@reference "tailwindcss";
|
||||
|
||||
ion-content::part(scroll) {
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.item {
|
||||
@apply px-3 py-1 rounded-full text-xs transition-all;
|
||||
}
|
||||
.ion-palette-dark {
|
||||
.item {
|
||||
@apply bg-(--ion-color-step-800);
|
||||
}
|
||||
}
|
||||
.item.active {
|
||||
@apply bg-(--ion-color-success) text-white;
|
||||
}
|
||||
</style>
|
||||
73
src/views/trade-settings/my-issues/components/rwa-list.vue
Normal file
73
src/views/trade-settings/my-issues/components/rwa-list.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<script lang='ts' setup>
|
||||
import type { MyIssueRwaData } from "@/api/types";
|
||||
import CryptocurrencyColorNuls from "~icons/cryptocurrency-color/nuls";
|
||||
|
||||
defineProps<{
|
||||
data: MyIssueRwaData[];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
function gotoTradeRwa(id: string) {
|
||||
router.push(`/trade-settings/my-issues/${id}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-3 antialiased mt-5">
|
||||
<ion-grid>
|
||||
<ion-row class="ion-align-items-center text-xs text-text-500">
|
||||
<ion-col size="6">
|
||||
<div>{{ t('myIssues.list.nameCode') }}</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-right">
|
||||
{{ t('myIssues.list.createdAt') }}
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-right">
|
||||
{{ t('myIssues.list.status') }}
|
||||
</div>
|
||||
</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?.name }}
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<div class="text-xs text-text-500">
|
||||
{{ item?.code }}
|
||||
</div>
|
||||
<div class="text-xs rounded-md px-1 py-0.5 bg-text-800">
|
||||
{{ item.category?.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-xs text-right">
|
||||
{{ useDateFormat(item.createdAt!, 'MM/DD HH:mm').value }}
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div class="text-sm font-bold text-primary text-right">
|
||||
{{ item.status }}
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped></style>
|
||||
99
src/views/trade-settings/my-issues/detail.vue
Normal file
99
src/views/trade-settings/my-issues/detail.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<script lang='ts' setup>
|
||||
import type { MyIssueRwaData } from "@/api/types";
|
||||
import { toastController } from "@ionic/vue";
|
||||
import CryptocurrencyColorNuls from "~icons/cryptocurrency-color/nuls";
|
||||
import IcSharpEditNote from "~icons/ic/sharp-edit-note";
|
||||
import { client, safeClient } from "@/api";
|
||||
import RwaAbout from "./components/about.vue";
|
||||
import RwaBase from "./components/base.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
id: string;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
const model = useTemplateRef<ModalInstance>("model");
|
||||
const { data } = safeClient(client.api.rwa.issuance.products({ id: props.id }).get());
|
||||
|
||||
async function handleSubscribe(val: number) {
|
||||
await safeClient(client.api.rwa.subscription.apply.post({
|
||||
editionId: props.id,
|
||||
quantity: String(val),
|
||||
}));
|
||||
const toast = await toastController.create({
|
||||
message: t("market.tradeRwa.subscribeSuccess"),
|
||||
duration: 2000,
|
||||
position: "bottom",
|
||||
color: "success",
|
||||
});
|
||||
|
||||
await toast.present();
|
||||
model.value?.$el.dismiss();
|
||||
}
|
||||
function gotoEdit() {
|
||||
router.push({ name: "trade-rwa-edit" });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ion-page>
|
||||
<ion-header>
|
||||
<ion-toolbar class="ui-toolbar">
|
||||
<ion-back-button slot="start" text="" />
|
||||
<ion-title>
|
||||
{{ data?.code }}
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content :fullscreen="true" class="ion-padding">
|
||||
<div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<CryptocurrencyColorNuls class="text-3xl" />
|
||||
|
||||
<div class="mr-2">
|
||||
<div class="text-lg font-semibold">
|
||||
{{ data?.name }}
|
||||
</div>
|
||||
<div class="text-xs text-gray-500 font-semibold">
|
||||
{{ data?.category?.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center my-3" @click="gotoEdit">
|
||||
<IcSharpEditNote class="inline-block text-xl mr-1 text-text-500" />
|
||||
<div class="text-xs">
|
||||
编辑资产
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ui-tabs size="small">
|
||||
<ui-tab-pane name="overview" :title="t('market.tradeRwa.tabs.overview')">
|
||||
<RwaBase :data="data" />
|
||||
</ui-tab-pane>
|
||||
<ui-tab-pane name="about" title="相关文档">
|
||||
<RwaAbout :data="data" />
|
||||
</ui-tab-pane>
|
||||
</ui-tabs>
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@reference "tailwindcss";
|
||||
|
||||
.label {
|
||||
@apply text-gray-500 mb-1;
|
||||
}
|
||||
|
||||
ion-button {
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
ion-button::part(native) {
|
||||
min-height: 40px;
|
||||
}
|
||||
</style>
|
||||
93
src/views/trade-settings/my-issues/index.vue
Normal file
93
src/views/trade-settings/my-issues/index.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<script setup lang="ts">
|
||||
import type { InfiniteScrollCustomEvent, RefresherCustomEvent } from "@ionic/vue";
|
||||
import type { AvailableSubscriptionBody, MyIssueRwaData } from "@/api/types";
|
||||
import { client, safeClient } from "@/api";
|
||||
import Category from "./components/category.vue";
|
||||
import RwaList from "./components/rwa-list.vue";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const [query] = useResetRef<AvailableSubscriptionBody>({
|
||||
limit: 20,
|
||||
offset: 0,
|
||||
categoryId: "",
|
||||
});
|
||||
const rwaData = ref<MyIssueRwaData[]>([]);
|
||||
const isFinished = ref(false);
|
||||
|
||||
async function fetchRwaData() {
|
||||
const { data } = await safeClient(() => client.api.rwa.issuance.products.get({
|
||||
query: query.value,
|
||||
}));
|
||||
rwaData.value.push(...(data.value?.data || []));
|
||||
isFinished.value = (data.value?.data.length || 0) < query.value.limit!;
|
||||
}
|
||||
function resetRwaData() {
|
||||
query.value.offset = 0;
|
||||
rwaData.value = [];
|
||||
isFinished.value = false;
|
||||
}
|
||||
async function handleRefresh(event: RefresherCustomEvent) {
|
||||
resetRwaData();
|
||||
await fetchRwaData();
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
async function handleInfinite(event: InfiniteScrollCustomEvent) {
|
||||
if (isFinished.value) {
|
||||
event.target.complete();
|
||||
event.target.disabled = true;
|
||||
return;
|
||||
}
|
||||
query.value.offset! += query.value.limit!;
|
||||
await fetchRwaData();
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
watch(() => query.value.categoryId, async () => {
|
||||
resetRwaData();
|
||||
await fetchRwaData();
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
fetchRwaData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<IonPage>
|
||||
<IonHeader class="ion-no-border">
|
||||
<ion-toolbar class="ui-toolbar">
|
||||
<ion-title>{{ t('myIssues.title') }}</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar class="ui-toolbar px-3">
|
||||
<ion-searchbar :placeholder="t('myIssues.search')" />
|
||||
</ion-toolbar>
|
||||
</IonHeader>
|
||||
<IonContent :fullscreen="true" class="ion-padding">
|
||||
<ion-refresher slot="fixed" @ion-refresh="handleRefresh($event)">
|
||||
<ion-refresher-content />
|
||||
</ion-refresher>
|
||||
|
||||
<Category v-model="query!.categoryId" />
|
||||
<RwaList :data="rwaData" />
|
||||
|
||||
<ion-infinite-scroll threshold="100px" @ion-infinite="handleInfinite">
|
||||
<ion-infinite-scroll-content
|
||||
loading-spinner="bubbles"
|
||||
:loading-text="t('myIssues.loadMore')"
|
||||
/>
|
||||
</ion-infinite-scroll>
|
||||
</IonContent>
|
||||
</IonPage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
ion-searchbar {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
13
src/views/trade-settings/my-issues/outlet.vue
Normal file
13
src/views/trade-settings/my-issues/outlet.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<script lang='ts' setup>
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<IonPage>
|
||||
<IonContent :fullscreen="true" class="ion-padding">
|
||||
<ion-router-outlet />
|
||||
</IonContent>
|
||||
</IonPage>
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped></style>
|
||||
Reference in New Issue
Block a user