| | |
| | | <template> |
| | | <ContentScrollView> |
| | | <SelectPayTypeView style="margin-top: 40px" /> |
| | | <SelectPayTypeView |
| | | style="margin-top: 40px" |
| | | :orderNo="orderNo" |
| | | :lifePayOrderType="lifePayOrderType" |
| | | @paySuccess="handePaySuccess" |
| | | /> |
| | | </ContentScrollView> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { SelectPayTypeView } from '@life-payment/components'; |
| | | import { LifeRechargeConstants } from '@life-payment/core-vue'; |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | defineOptions({ |
| | | name: 'selectPayType', |
| | | }); |
| | | |
| | | const router = Taro.useRouter(); |
| | | const orderNo = router.params?.orderNo ?? ''; |
| | | const lifePayOrderType = Number(router.params?.lifePayOrderType ?? ''); |
| | | |
| | | function handePaySuccess( |
| | | orderNo: string, |
| | | lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum |
| | | ) { |
| | | if (lifePayOrderType === LifeRechargeConstants.LifePayOrderTypeEnum.话费订单) { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.rechargeResult}?orderNo=${orderNo}&lifePayOrderType=${lifePayOrderType}`, |
| | | }); |
| | | } else if (lifePayOrderType === LifeRechargeConstants.LifePayOrderTypeEnum.电费订单) { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.rechargeElectricResult}?orderNo=${orderNo}&lifePayOrderType=${lifePayOrderType}`, |
| | | }); |
| | | } |
| | | } |
| | | </script> |