CommonDialog.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <Dialog
  3. v-bind="props"
  4. mask
  5. closeable
  6. closeIcon=""
  7. backgroundColor="transparent"
  8. @update:show="emit('update:show', $event)"
  9. >
  10. <BackgroundBox
  11. backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxDialog.png"
  12. :backgroundCutBorder="48"
  13. :backgroundCutBorderSize="48"
  14. :padding="24"
  15. direction="column"
  16. gap="gap.md"
  17. >
  18. <template v-if="props.title">
  19. <Height :size="24" />
  20. <slot name="titlePre"></slot>
  21. <FlexCol center gap="gap.lg">
  22. <H3 fontConfig="primaryTitle">{{ props.title }}</H3>
  23. <CommonDivider v-if="props.showDivider" />
  24. </FlexCol>
  25. </template>
  26. <slot></slot>
  27. <Height :size="24" />
  28. </BackgroundBox>
  29. <Height :size="24" />
  30. <ImageButton v-if="props.showCloseButton"
  31. src="https://xy.wenlvti.net/app_static/images/ButtonClose.png"
  32. :width="80"
  33. :height="80"
  34. @click="emit('update:show', false)"
  35. />
  36. </Dialog>
  37. </template>
  38. <script setup lang="ts">
  39. import Dialog, { type DialogProps } from '@/components/dialog/Dialog.vue';
  40. import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
  41. import FlexCol from '@/components/layout/FlexCol.vue';
  42. import Height from '@/components/layout/space/Height.vue';
  43. import H3 from '@/components/typography/H3.vue';
  44. import CommonDivider from './CommonDivider.vue';
  45. import ImageButton from '@/components/basic/ImageButton.vue';
  46. const props = withDefaults(defineProps<DialogProps & {
  47. title?: string;
  48. showCloseButton?: boolean;
  49. showDivider?: boolean;
  50. }>(), {
  51. showCloseButton: true,
  52. showDivider: true,
  53. });
  54. const emit = defineEmits<{
  55. (e: 'update:show', value: boolean): void;
  56. }>();
  57. </script>