| | |
| | | <template> |
| | | <div class="select-pay-type-view"> |
| | | <div class="select-pay-type-view-item" @click="handleAliPay"> |
| | | <div class="select-pay-type-view-item" v-if="showAliPay" @click="handleAliPay"> |
| | | <img class="select-pay-type-view-item-icon" :src="IconAliPay" /> |
| | | <div class="select-pay-type-view-item-text">支付宝支付</div> |
| | | </div> |
| | | <div class="select-pay-type-view-item"> |
| | | <div class="select-pay-type-view-item" v-if="showWeixinPay" @click="handleWeixinPay"> |
| | | <img class="select-pay-type-view-item-icon" :src="IconWeixin" /> |
| | | <div class="select-pay-type-view-item-text">微信支付</div> |
| | | </div> |
| | |
| | | useLifeRechargeContext, |
| | | SetLifePayOrderPayTypeInput, |
| | | LifeRechargeConstants, |
| | | } from '../../utils'; |
| | | } from '@life-payment/core-vue'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | |
| | | defineOptions({ |
| | |
| | | type Props = { |
| | | orderNo?: string; |
| | | lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum; |
| | | showAliPay?: boolean; |
| | | showWeixinPay?: boolean; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | showAliPay: true, |
| | | showWeixinPay: true, |
| | | }); |
| | | |
| | | const emit = defineEmits<{ |
| | | ( |
| | |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleWeixinPay() { |
| | | try { |
| | | let res = await setLifePayOrderPayType(blLifeRecharge.constants.LifePayTypeEnum.WxPay); |
| | | if (res) { |
| | | location.href = res; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function setLifePayOrderPayType(lifePayType: LifeRechargeConstants.LifePayTypeEnum) { |
| | | try { |
| | | let params: SetLifePayOrderPayTypeInput = { |