| | |
| | | v-else-if="current === 'step2'" |
| | | v-bind="props" |
| | | @go-pay="emit('goPay', $event)" |
| | | @paySuccess="emit('paySuccess', $event)" |
| | | @missName="emit('missName', $event)" |
| | | @editUserAccount="emit('editUserAccount', $event)" |
| | | /> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { computed, provide } from 'vue'; |
| | | import { computed, provide, useAttrs, watch } from 'vue'; |
| | | import { useStepper } from 'senin-mini/hooks'; |
| | | import { PhoneBillRechargeContextKey } from './context'; |
| | | import PhoneBillRechargeStep1 from './PhoneBillRechargeStep1.vue'; |
| | | import PhoneBillRechargeStep2 from './PhoneBillRechargeStep2.vue'; |
| | | import { RechargeProps } from './types'; |
| | | |
| | | defineOptions({ |
| | | name: 'PhoneBillRecharge', |
| | | }); |
| | | |
| | | type Props = { |
| | | isDev?: boolean; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | const props = withDefaults(defineProps<RechargeProps>(), { |
| | | isDev: false, |
| | | }); |
| | | |
| | |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goPay', orderNo: string): void; |
| | | (e: 'paySuccess', orderNo: string): void; |
| | | (e: 'missName', userAccountId: string): void; |
| | | (e: 'editUserAccount', userAccountId: string): void; |
| | | (e: 'currentChange', current: 'step1' | 'step2'): void; |
| | | }>(); |
| | | |
| | | watch( |
| | | current, |
| | | (newVal) => { |
| | | emit('currentChange', newVal); |
| | | }, |
| | | { |
| | | immediate: true, |
| | | } |
| | | ); |
| | | |
| | | provide(PhoneBillRechargeContextKey, { |
| | | ...stepperInfo, |
| | | }); |