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