feat: 更新交易 RWA 路由,添加编辑功能和相关视图
This commit is contained in:
23
src/views/trade-rwa/edit.vue
Normal file
23
src/views/trade-rwa/edit.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang='ts' setup>
|
||||
import type { RwaData } from "@/api/types";
|
||||
|
||||
defineProps<{
|
||||
data: RwaData;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ion-page>
|
||||
<ion-header>
|
||||
<ion-toolbar class="ui-toolbar">
|
||||
<ion-back-button slot="start" text="" />
|
||||
<ion-title />
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content :fullscreen="true" class="ion-padding">
|
||||
{{ data }}
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped></style>
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang='ts' setup>
|
||||
import type { RwaData } from "@/api/types";
|
||||
import { toastController } from "@ionic/vue";
|
||||
import CryptocurrencyColorNuls from "~icons/cryptocurrency-color/nuls";
|
||||
import IcSharpEditNote from "~icons/ic/sharp-edit-note";
|
||||
@@ -7,17 +8,17 @@ import RwaAbout from "./components/about.vue";
|
||||
import RwaBase from "./components/base.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
id: string;
|
||||
data: RwaData;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
const { data } = safeClient(client.api.rwa.subscription.available_editions({ editionId: props.id }).get());
|
||||
const model = useTemplateRef<ModalInstance>("model");
|
||||
|
||||
async function handleSubscribe(val: number) {
|
||||
await safeClient(client.api.rwa.subscription.apply.post({
|
||||
editionId: props.id,
|
||||
editionId: props.data.id,
|
||||
quantity: String(val),
|
||||
}));
|
||||
const toast = await toastController.create({
|
||||
@@ -30,6 +31,9 @@ async function handleSubscribe(val: number) {
|
||||
await toast.present();
|
||||
model.value?.$el.dismiss();
|
||||
}
|
||||
function gotoEdit() {
|
||||
router.push({ name: "trade-rwa-edit" });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -56,7 +60,7 @@ async function handleSubscribe(val: number) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center my-3">
|
||||
<div class="flex items-center my-3" @click="gotoEdit">
|
||||
<IcSharpEditNote class="inline-block text-xl mr-1 text-text-500" />
|
||||
<div class="text-xs">
|
||||
编辑资产
|
||||
|
||||
27
src/views/trade-rwa/outlet.vue
Normal file
27
src/views/trade-rwa/outlet.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<script lang='ts' setup>
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
const props = defineProps<{
|
||||
id: string;
|
||||
}>();
|
||||
|
||||
const { data } = safeClient(client.api.rwa.subscription.available_editions({ editionId: props.id }).get());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ion-page>
|
||||
<ion-header>
|
||||
<ion-toolbar class="ui-toolbar">
|
||||
<ion-back-button slot="start" text="" />
|
||||
<ion-title>
|
||||
{{ data?.product.code }}
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content :fullscreen="true" class="ion-padding">
|
||||
<RouterView :data="data" />
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user