feat: 优化产品点击和申购处理函数,增强类型安全和事件管理
This commit is contained in:
@@ -33,13 +33,12 @@ async function handleInfinite(event: InfiniteScrollCustomEvent) {
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function handleProductClick(product: any) {
|
||||
function handleProductClick(product: Product) {
|
||||
console.log("查看产品:", product.name);
|
||||
// TODO: 跳转到产品详情
|
||||
}
|
||||
|
||||
function handleSubscribe(product: any, event: Event) {
|
||||
event.stopPropagation();
|
||||
function handleSubscribe(product: Product) {
|
||||
console.log("申购产品:", product.name);
|
||||
// TODO: 实现申购功能
|
||||
}
|
||||
@@ -124,7 +123,7 @@ onMounted(() => {
|
||||
<ion-button
|
||||
expand="block"
|
||||
class="subscribe-btn"
|
||||
@click="handleSubscribe(product, $event)"
|
||||
@click.stop="handleSubscribe(product)"
|
||||
>
|
||||
<ion-icon slot="start" :icon="cardOutline" />
|
||||
我要申购
|
||||
|
||||
Reference in New Issue
Block a user