feat: 更新 @riwa/api-types 依赖至 0.0.133,修复锁仓组件的提交逻辑,调整订单组件的模态框初始断点
This commit is contained in:
@@ -97,7 +97,7 @@ export function useAppUpdate() {
|
||||
// 模拟后端返回数据(开发阶段)
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
const versionInfo: VersionInfo = {
|
||||
version: "0.0.2", // 模拟有新版本
|
||||
version: "0.0.1", // 模拟有新版本
|
||||
forceUpdate: false,
|
||||
updateMessage: "修复了一些问题并优化了性能",
|
||||
updateUrl: updateUrls[platform] || "",
|
||||
|
||||
@@ -1,13 +1,76 @@
|
||||
<script lang='ts' setup>
|
||||
import { toastController } from "@ionic/vue";
|
||||
import { client, safeClient } from "@/api";
|
||||
|
||||
const props = defineProps<{ id: string }>();
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
}>();
|
||||
|
||||
const { data } = safeClient(client.api.rwa.tokenization.lock_options.get({ query: { productId: props.id } }));
|
||||
|
||||
const selectedOption = ref<{ months: number; rewardRate: string } | null>(null);
|
||||
|
||||
async function handleSubmit() {
|
||||
await safeClient(client.api.rwa.tokenization.locked.post({
|
||||
lockMonths: selectedOption.value!.months,
|
||||
productId: props.id,
|
||||
}));
|
||||
emit("close");
|
||||
const toast = await toastController.create({
|
||||
message: "锁仓成功",
|
||||
duration: 2000,
|
||||
position: "bottom",
|
||||
color: "success",
|
||||
});
|
||||
await toast.present();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="ion-padding">
|
||||
<ion-button expand="block" color="primary">
|
||||
<div class="mb-4">
|
||||
<h3 class="text-lg font-semibold mb-2">
|
||||
选择锁仓期限
|
||||
</h3>
|
||||
<p class="text-sm text-text-500">
|
||||
选择锁仓月数,锁仓期间可获得相应奖励
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div v-if="data?.lockOptions">
|
||||
<ion-list lines="none">
|
||||
<ion-radio-group v-model="selectedOption">
|
||||
<ion-item
|
||||
v-for="option in data.lockOptions"
|
||||
:key="option.months"
|
||||
class="bg-faint rounded-md mb-3"
|
||||
>
|
||||
<ion-radio :value="option" justify="space-between" color="primary">
|
||||
<div>{{ option.months }} 个月 - {{ (Number(option.rewardRate) * 100).toFixed(2) }}% 收益</div>
|
||||
</ion-radio>
|
||||
</ion-item>
|
||||
</ion-radio-group>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
<ui-empty v-else-if="!data || data.lockOptions.length === 0" description="暂无锁仓选项" />
|
||||
|
||||
<ion-button
|
||||
expand="block"
|
||||
color="primary"
|
||||
:disabled="!selectedOption"
|
||||
shape="round"
|
||||
class="mt-6 h-12"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
确定
|
||||
</ion-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang='css' scoped></style>
|
||||
<style lang='css' scoped>
|
||||
ion-item {
|
||||
--background: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -75,8 +75,8 @@ async function handleLocked(item: HoldingItem) {
|
||||
componentProps: {
|
||||
id: item.productId,
|
||||
},
|
||||
initialBreakpoint: 0.35,
|
||||
breakpoints: [0, 0.35],
|
||||
initialBreakpoint: 0.5,
|
||||
breakpoints: [0, 0.5],
|
||||
handle: true,
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
Reference in New Issue
Block a user