feat: support badge gifting in props send
This commit is contained in:
parent
5102e086aa
commit
5260a674ae
@ -86,7 +86,7 @@ const propsResourceOptions = computed(() =>
|
||||
);
|
||||
const badgeResourceOptions = computed(() =>
|
||||
badgeSourceOptions.value.map((item) => ({
|
||||
label: `${item.badgeConfigId} / ${item.name}`,
|
||||
label: `${item.badgeConfigId} / ${item.badgeName || item.name || '-'}`,
|
||||
value: item.badgeConfigId as any,
|
||||
})),
|
||||
);
|
||||
@ -96,6 +96,19 @@ const ticketResourceOptions = computed(() =>
|
||||
value: item.id as any,
|
||||
})),
|
||||
);
|
||||
const badgePreviewItem = computed(() => {
|
||||
const item = badgeSelectedResource.value;
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
cover: item.selectUrl || item.cover,
|
||||
id: item.badgeConfigId || item.id,
|
||||
name: item.badgeName || item.name,
|
||||
type: 'BADGE',
|
||||
};
|
||||
});
|
||||
|
||||
const propsForm = reactive({
|
||||
content: '',
|
||||
@ -132,7 +145,7 @@ function hasPermission(code: string) {
|
||||
}
|
||||
|
||||
const canSendProps = computed(() => hasPermission('send:props'));
|
||||
const canSendBadge = computed(() => hasPermission('send:props:badge'));
|
||||
const canSendBadge = computed(() => canSendProps.value || hasPermission('send:props:badge'));
|
||||
const canSendTicket = computed(() => hasPermission('send:props:coupon'));
|
||||
|
||||
function normalizeAccounts(value: string) {
|
||||
@ -480,12 +493,12 @@ async function handleSendTicket() {
|
||||
show-search
|
||||
@change="handleBadgeResourceChange"
|
||||
/>
|
||||
<div v-if="badgeSelectedResource" class="resource-preview">
|
||||
<RewardIcon :item="badgeSelectedResource" :size="64" />
|
||||
<div v-if="badgePreviewItem" class="resource-preview">
|
||||
<RewardIcon :item="badgePreviewItem" :size="64" />
|
||||
<div class="resource-preview__meta">
|
||||
<div>{{ badgeSelectedResource.name }}</div>
|
||||
<div>{{ badgePreviewItem.name }}</div>
|
||||
<div class="resource-preview__id">
|
||||
ID: {{ badgeSelectedResource.badgeConfigId }}
|
||||
ID: {{ badgePreviewItem.id }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user