This commit is contained in:
@@ -97,6 +97,7 @@
|
||||
modelValue: boolean
|
||||
initialOrderId?: number
|
||||
initialOrderNo?: string
|
||||
initialPackageUsageId?: number
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
@@ -119,6 +120,7 @@
|
||||
|
||||
const formData = reactive<{
|
||||
order_id: number | null
|
||||
package_usage_id?: number
|
||||
requested_refund_amount?: number
|
||||
actual_received_amount: number
|
||||
refund_reason: string
|
||||
@@ -127,6 +129,7 @@
|
||||
attachments: RefundAttachment[]
|
||||
}>({
|
||||
order_id: null,
|
||||
package_usage_id: undefined,
|
||||
requested_refund_amount: undefined,
|
||||
actual_received_amount: 0,
|
||||
refund_reason: '',
|
||||
@@ -213,6 +216,7 @@
|
||||
formRef.value?.resetFields()
|
||||
voucherUploading.value = false
|
||||
formData.order_id = null
|
||||
formData.package_usage_id = undefined
|
||||
formData.requested_refund_amount = undefined
|
||||
formData.actual_received_amount = 0
|
||||
formData.refund_reason = ''
|
||||
@@ -239,6 +243,7 @@
|
||||
requested_refund_amount: yuanToFen(formData.requested_refund_amount) ?? 0,
|
||||
actual_received_amount: formData.actual_received_amount,
|
||||
attachments: formData.attachments,
|
||||
package_usage_id: formData.package_usage_id,
|
||||
refund_reason: formData.refund_reason || undefined,
|
||||
remark: formData.remark || undefined
|
||||
}
|
||||
@@ -261,6 +266,7 @@
|
||||
if (hasInitialOrder.value && props.initialOrderId) {
|
||||
formData.order_id = props.initialOrderId
|
||||
}
|
||||
formData.package_usage_id = props.initialPackageUsageId
|
||||
if (hasInitialOrder.value && props.initialOrderNo) {
|
||||
searchOrders(props.initialOrderNo)
|
||||
} else {
|
||||
|
||||
@@ -85,13 +85,22 @@
|
||||
}
|
||||
)
|
||||
|
||||
const getNormalizedQuery = () => {
|
||||
const query: Record<string, unknown> = {}
|
||||
const getNormalizedQuery = (): Record<string, string> => {
|
||||
const query: Record<string, string> = {}
|
||||
|
||||
Object.entries(props.query || {}).forEach(([key, value]) => {
|
||||
if (value === undefined || value === null || value === '') return
|
||||
if (Array.isArray(value) && value.length === 0) return
|
||||
query[key] = value
|
||||
|
||||
if (typeof value === 'string') {
|
||||
query[key] = value
|
||||
} else if (typeof value === 'number' || typeof value === 'boolean') {
|
||||
query[key] = String(value)
|
||||
} else if (Array.isArray(value)) {
|
||||
query[key] = value.join(',')
|
||||
} else {
|
||||
query[key] = JSON.stringify(value)
|
||||
}
|
||||
})
|
||||
|
||||
return query
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<span class="text">
|
||||
<strong>{{ item.title }}</strong>
|
||||
<small>{{ item.body }}</small>
|
||||
<time>{{ item.created_at || '-' }}</time>
|
||||
<time>{{ formatDateTime(item.created_at) }}</time>
|
||||
</span>
|
||||
<span v-if="!isRead(item)" class="unread-dot" />
|
||||
</button>
|
||||
@@ -50,9 +50,6 @@
|
||||
<p>暂无通知</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-wrapper">
|
||||
<ElButton class="view-all" @click="handleViewAll">进入通知中心</ElButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,6 +65,7 @@
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { NOTIFICATION_PERMISSIONS } from '@/config/constants/notification'
|
||||
import { navigateNotificationTarget } from '@/utils/business/notificationNavigation'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
|
||||
const props = defineProps<{ modelValue: boolean }>()
|
||||
const emit = defineEmits<{ 'update:modelValue': [value: boolean] }>()
|
||||
@@ -108,11 +106,6 @@
|
||||
|
||||
const close = () => emit('update:modelValue', false)
|
||||
|
||||
const handleViewAll = () => {
|
||||
close()
|
||||
void router.push('/notifications')
|
||||
}
|
||||
|
||||
const handleMarkAllRead = async () => {
|
||||
try {
|
||||
const response = await notificationStore.markAllRead()
|
||||
|
||||
@@ -158,15 +158,6 @@
|
||||
font-size: 42px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-wrapper {
|
||||
padding: 12px 16px 16px;
|
||||
border-top: 1px solid var(--art-border-color);
|
||||
|
||||
.view-all {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: $device-phone) {
|
||||
|
||||
Reference in New Issue
Block a user