| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <script setup lang="ts">
- const props = defineProps<{
- show: boolean
- title: string
- confirmText: string
- cancelText: string
- }>()
- const emit = defineEmits<{
- (e: 'update:show', value: boolean): void
- (e: 'confirm' | 'cancel'): void
- }>()
- const handleClose = () => {
- emit('update:show', false)
- emit('cancel')
- }
- const handleConfirm = () => {
- emit('confirm')
- emit('update:show', false)
- }
- const handleCancel = () => {
- emit('cancel')
- emit('update:show', false)
- }
- </script>
- <template>
- <van-popup
- :show="props.show"
- position="center"
- class="order-popup-confirm"
- @update:show="val => emit('update:show', val)"
- >
- <div class="order-popup-confirm__container">
- <div
- class="order-popup-confirm__close"
- @click="handleClose"
- >
- <van-icon
- name="cross"
- :size="20"
- color="#CDCFD9"
- />
- </div>
- <div class="order-popup-confirm__title">
- {{ props.title }}
- </div>
- <div class="order-popup-confirm__content">
- <div
- class="order-popup-btn-confirm"
- @click="handleConfirm"
- >
- {{ props.confirmText }}
- </div>
- <div
- class="order-popup-btn-cancel"
- @click="handleCancel"
- >
- {{ props.cancelText }}
- </div>
- </div>
- </div>
- </van-popup>
- </template>
- <style scoped lang="scss">
- .order-popup-confirm {
- background-color: transparent;
- &__container {
- width: 300px;
- padding: 30px 24px;
- border-radius: 20px;
- background-color: #fff;
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- gap: 16px;
- }
- &__close {
- position: absolute;
- top: 12px;
- right: 12px;
- }
- &__content {
- display: flex;
- flex-direction: column;
- gap: 16px;
- .order-popup-btn-confirm {
- @include size(200px, 36px);
- border-radius: 999px;
- background-image: linear-gradient(90deg, #2f95ff 0%, #50ffd8 100%);
- color: #fff;
- font-size: 14px;
- font-weight: 600;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- -webkit-tap-highlight-color: transparent;
- }
- .order-popup-btn-cancel {
- @include size(200px, 36px);
- border-radius: 999px;
- border: 1px solid #86909C;
- color: #4E5969;
- font-size: 14px;
- font-weight: 400;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- -webkit-tap-highlight-color: transparent;
- }
- }
- &__title {
- font-family: var(--font-title);
- font-size: 16px;
- font-weight: 600;
- color: #4E5969;
- text-align: center;
- }
- }
- </style>
|