forward to point account

This commit is contained in:
Timi
2026-08-28 22:58:10 +08:00
parent 551917a5de
commit b86e5a176c
+26 -4
View File
@@ -6,8 +6,15 @@
v-entrance-transition
@click="toCustomerDetail"
/>
<t-cell-group
v-if="ledger?.accountId && canReadPointAccount"
theme="card"
v-entrance-transition="70"
>
<t-cell title="积分账户" arrow @click="toPointAccount" />
</t-cell-group>
<template v-if="ledger">
<t-cell-group title="积分流水" theme="card" v-entrance-transition="70">
<t-cell-group title="积分流水" theme="card" v-entrance-transition="140">
<t-cell title="流水类型">
<template #note>
<t-tag
@@ -26,7 +33,7 @@
</t-cell>
<t-cell title="流水备注" :note="Text.display(ledger.remark)" />
</t-cell-group>
<t-cell-group title="触发事件" theme="card" v-entrance-transition="140">
<t-cell-group title="触发事件" theme="card" v-entrance-transition="210">
<template v-if="triggerEvent">
<t-cell title="事件名称" :note="triggerEvent.name || '未命名事件'" />
<t-cell title="事件类型" :note="getEventValueTypeText(triggerEvent)" />
@@ -35,7 +42,7 @@
</template>
<div v-else class="empty" v-text="getEventEmptyText()" />
</t-cell-group>
<t-cell-group title="事件记录" theme="card" v-entrance-transition="210">
<t-cell-group title="事件记录" theme="card" v-entrance-transition="280">
<template v-if="eventRecord">
<t-cell title="登记事件" :note="eventRecord.event?.name || triggerEvent?.name || '未知事件'" />
<t-cell title="登记时间">
@@ -52,7 +59,7 @@
</template>
<div v-else class="empty" v-text="getRecordEmptyText()" />
</t-cell-group>
<t-cell-group title="命中规则" theme="card" v-entrance-transition="280">
<t-cell-group title="命中规则" theme="card" v-entrance-transition="350">
<template v-if="hitRule">
<t-cell title="规则名称" :note="hitRule.name || '未命名规则'" />
<t-cell title="触发类型" :note="getTriggerTypeText(hitRule.triggerType)" />
@@ -100,6 +107,7 @@ const userStore = useUserStore();
const canReadCustomer = computed(() => userStore.hasPermissions(permissionCodes.customer.read));
const canReadEvent = computed(() => userStore.hasPermissions(permissionCodes.event.read));
const canReadEventRecord = computed(() => userStore.hasPermissions(permissionCodes.eventRecord.read));
const canReadPointAccount = computed(() => userStore.hasPermissions(permissionCodes.point.accountRead));
const canReadRule = computed(() => userStore.hasPermissions(permissionCodes.pointRule.read));
// ---------- 流水与关联数据 ----------
@@ -352,6 +360,20 @@ async function toCustomerDetail(): Promise<void> {
}
}
async function toPointAccount(): Promise<void> {
if (!canReadPointAccount.value || !ledger.value?.accountId) {
return;
}
await router.push({
name: "PointAccountDetail",
params: { id: ledger.value.accountId },
query: {
storeId: ledger.value.storeId || "",
transitionDepth: String(Number(route.meta.depth ?? 0) + 1)
}
});
}
async function toEventDetail(): Promise<void> {
if (!canReadEvent.value || !triggerEvent.value?.id) {
return;