fix style

This commit is contained in:
Timi
2026-10-30 11:43:53 +08:00
parent 764e77bd60
commit 98e14f318b
2 changed files with 85 additions and 100 deletions
+5 -1
View File
@@ -64,9 +64,13 @@ html.theme-dark body {
} }
&.column { &.column {
gap: .5rem; gap: 1rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
&.scroll > * {
flex-shrink: 0;
}
} }
.pull-refresh { .pull-refresh {
+80 -99
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="page-layout navbar"> <div v-can="permissionCodes.eventRecord.read" class="page-layout navbar event-record-detail">
<t-navbar <t-navbar
fixed fixed
:z-index="20" :z-index="20"
@@ -19,72 +19,71 @@
</template> </template>
</t-navbar> </t-navbar>
<main class="page-content scroll column"> <main class="page-content scroll column">
<div v-can="permissionCodes.eventRecord.read" class="event-record-detail"> <customer-profile-card
<customer-profile-card v-entrance-transition
v-entrance-transition v-if="record?.customer"
v-if="record?.customer" class="customer-profile"
class="customer-profile" :customer="record.customer"
:customer="record.customer" @click="toCustomerDetail"
@click="toCustomerDetail" />
<t-cell-group v-entrance-transition v-if="record" title="登记信息" theme="card">
<t-cell
title="登记事件"
:note="record.event?.name || '未知事件'"
:arrow="canReadEvent && !!(record.event?.id || record.eventId)"
:hover="canReadEvent && !!(record.event?.id || record.eventId)"
@click="toEventDetail"
/> />
<t-cell-group v-entrance-transition v-if="record" title="登记信息" theme="card"> <t-cell title="业务类型" :note="getEventBizTypeText(record.event?.bizType)" />
<t-cell <t-cell v-if="record.numberValue !== undefined && record.numberValue !== null" title="事件数值" :note="getNumberValueText(record)" />
title="登记事件" <t-cell v-if="record.pointValue !== undefined && record.pointValue !== null" title="提交积分值" :note="getPointValueText(record.pointValue, pointLedgerChangeType)" />
:note="record.event?.name || '未知事件'" <t-cell v-if="record.earnedPointValue !== undefined && record.earnedPointValue !== null" title="本次积分变化" :note="getPointValueText(record.earnedPointValue, pointLedgerChangeType)" />
:arrow="canReadEvent && !!(record.event?.id || record.eventId)" <t-cell title="登记时间">
:hover="canReadEvent && !!(record.event?.id || record.eventId)" <template #note>
@click="toEventDetail" <time-label :timestamp="record.registeredAt" underline />
/> </template>
<t-cell title="业务类型" :note="getEventBizTypeText(record.event?.bizType)" /> </t-cell>
<t-cell v-if="record.numberValue !== undefined && record.numberValue !== null" title="事件数值" :note="getNumberValueText(record)" /> <t-cell title="登记人" :note="Text.display(record.operator?.nick || record.operator?.name)" />
<t-cell v-if="record.pointValue !== undefined && record.pointValue !== null" title="提交积分值" :note="getPointValueText(record.pointValue, pointLedgerChangeType)" /> <t-cell title="备注" :note="Text.display(record.remark)" />
<t-cell v-if="record.earnedPointValue !== undefined && record.earnedPointValue !== null" title="本次积分变化" :note="getPointValueText(record.earnedPointValue, pointLedgerChangeType)" /> </t-cell-group>
<t-cell title="登记时间"> <t-cell-group
<template #note> v-if="record?.verificationStatus && record.verificationStatus !== 'NOT_REQUIRED'"
<time-label :timestamp="record.registeredAt" underline /> title="核销信息"
</template> theme="card"
</t-cell> v-entrance-transition
<t-cell title="登记人" :note="Text.display(record.operator?.nick || record.operator?.name)" /> >
<t-cell title="备注" :note="Text.display(record.remark)" /> <t-cell title="核销状态" :note="getVerificationStatusText(record.verificationStatus)" />
</t-cell-group> <t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销人" :note="Text.display(record.verifier?.nick || record.verifier?.name)" />
<t-cell-group <t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销时间">
v-if="record?.verificationStatus && record.verificationStatus !== 'NOT_REQUIRED'" <template #note>
title="核销信息" <time-label :timestamp="record.verifiedAt" underline />
theme="card" </template>
v-entrance-transition </t-cell>
> </t-cell-group>
<t-cell title="核销状态" :note="getVerificationStatusText(record.verificationStatus)" /> <card-container
<t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销人" :note="Text.display(record.verifier?.nick || record.verifier?.name)" /> v-if="recordOptionEvent"
<t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销时间"> description="登记选项"
<template #note> v-entrance-transition
<time-label :timestamp="record.verifiedAt" underline /> >
</template> <event-option-selector
</t-cell> class="option-selector"
</t-cell-group> :model-value="recordOptionSelectionMap"
<card-container :event-list="[recordOptionEvent]"
v-if="recordOptionEvent" :selected-event-id-list="recordOptionEventIdList"
description="登记选项" readonly
v-entrance-transition />
> </card-container>
<event-option-selector <t-button
class="option-selector" v-if="canVerifyRecord && record?.verificationStatus === 'PENDING'"
:model-value="recordOptionSelectionMap" class="cell-button bg-orange white"
:event-list="[recordOptionEvent]" variant="text"
:selected-event-id-list="recordOptionEventIdList" :loading="isVerifying"
readonly @click="confirmVerifyRecord"
/> >
</card-container> 核销登记记录
<t-button </t-button>
v-if="canVerifyRecord && record?.verificationStatus === 'PENDING'" <card-container v-if="record" v-entrance-transition>
class="verify-button cell-button bg-orange white" <div class="attachment">
variant="text"
:loading="isVerifying"
@click="confirmVerifyRecord"
v-entrance-transition
>
核销登记记录
</t-button>
<div v-if="record" class="photo-wrapper" v-entrance-transition>
<attachment-selector :items="recordPhotoItemList" title="登记照片" readonly> <attachment-selector :items="recordPhotoItemList" title="登记照片" readonly>
<template #viewer-actions="{ item, index, close }"> <template #viewer-actions="{ item, index, close }">
<attachment-viewer-actions <attachment-viewer-actions
@@ -97,18 +96,18 @@
</template> </template>
</attachment-selector> </attachment-selector>
</div> </div>
<t-button </card-container>
v-if="record && canDeleteRecord" <t-button
class="delete-button cell-button" v-if="record && canDeleteRecord"
theme="danger" class="cell-button"
:loading="isDeleting" theme="danger"
:disabled="isDeleting" :loading="isDeleting"
@click="confirmRemoveRecord" :disabled="isDeleting"
v-entrance-transition content="删除登记记录"
content="删除登记记录" v-entrance-transition
/> @click="confirmRemoveRecord"
<t-empty v-if="!record" :description="isLoading ? '正在加载登记事件记录' : '登记事件记录不存在'" /> />
</div> <t-empty v-if="!record" :description="isLoading ? '正在加载登记事件记录' : '登记事件记录不存在'" />
</main> </main>
<event-record-verify-dialog <event-record-verify-dialog
v-model:visible="verifyDialogVisible" v-model:visible="verifyDialogVisible"
@@ -122,8 +121,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { DialogPlugin } from "tdesign-mobile-vue"; import { DialogPlugin } from "tdesign-mobile-vue";
import { TimeLabel, Text } from "timi-web"; import { Text, TimeLabel } from "timi-web";
import { useUserStore, type Attachment } from "timi-web-api"; import { type Attachment, useUserStore } from "timi-web-api";
import EventRecordAPI from "@/api/EventRecordAPI"; import EventRecordAPI from "@/api/EventRecordAPI";
import CustomerProfileCard from "@/components/CustomerProfileCard.vue"; import CustomerProfileCard from "@/components/CustomerProfileCard.vue";
import EventOptionSelector from "@/components/EventOptionSelector.vue"; import EventOptionSelector from "@/components/EventOptionSelector.vue";
@@ -141,9 +140,6 @@ import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission"; import { permissionCodes } from "@/utils/permission";
import type { EventRecord } from "@/types/EventRecord"; import type { EventRecord } from "@/types/EventRecord";
defineOptions({ defineOptions({
@@ -448,28 +444,13 @@ watch(() => route.params.id, async () => {
<style scoped lang="less"> <style scoped lang="less">
.event-record-detail { .event-record-detail {
gap: 1rem;
min-height: 100vh;
padding: 0 0 1rem 0;
display: flex;
flex-direction: column;
.customer-profile { .customer-profile {
margin: 0 1rem; margin: 0 1rem;
} }
.photo-wrapper { .attachment {
width: calc(100% - 2rem);
margin: 0 1rem;
padding: 1rem; padding: 1rem;
background: rgba(255, 255, 255, .92);
box-shadow: var(--td-shadow-1);
border-radius: 1.4rem;
}
.verify-button {
width: calc(100% - 2rem);
margin: 0 1rem;
} }
.option-selector { .option-selector {