| | |
| | | <template> |
| | | <div>çæ°å
å¼</div> |
| | | <ContentScrollView :paddingH="false" style="background-color: #fff"> |
| | | <GasBillRecharge @goPay="goPay" :isDev="isDev" /> |
| | | </ContentScrollView> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { GasBillRecharge } from '@life-payment/components'; |
| | | import { BlLifeRecharge } from '@life-payment/core-vue'; |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | defineOptions({ |
| | | name: 'InnerPage', |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import '@/styles/common.scss'; |
| | | </style> |
| | | const isDev = process.env.NODE_ENV === 'development'; |
| | | |
| | | function goPay(orderNo: string) { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.selectPayType}?orderNo=${orderNo}&lifePayOrderType=${BlLifeRecharge.constants.LifePayOrderTypeEnum.çæ°è®¢å}`, |
| | | }); |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div class="account-add-card"><Uploader /> æ°å¢ææºå·</div> |
| | | <div class="account-add-card"><Uploader /> {{ text }}</div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | |
| | | defineOptions({ |
| | | name: 'AccountAddCard', |
| | | }); |
| | | |
| | | type Props = { |
| | | text?: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | text: 'æ°å¢ææºå·', |
| | | }); |
| | | </script> |
| | |
| | | <div class="recharge-tips-title">å
å¼é¡»ç¥</div> |
| | | <div class="recharge-tips-content"> |
| | | <div class="recharge-tips-top"> |
| | | *åä¸å·ç å
弿é´ãåå¿å¤å¹³å°éå¤å
å¼ãï¼ï¼ï¼å¨ä¸ååï¼è¯·å¡å¿
ä»ç»é
读å
¬åå
容ï¼ï¼ï¼è¥æ¥å°éçæ¥çµï¼è¯·å¿è½»ä¿¡ï¼ï¼ï¼ |
| | | <slot name="tips-top"> |
| | | *åä¸å·ç å
弿é´ãåå¿å¤å¹³å°éå¤å
å¼ãï¼ï¼ï¼å¨ä¸ååï¼è¯·å¡å¿
ä»ç»é
读å
¬åå
容ï¼ï¼ï¼è¥æ¥å°éçæ¥çµï¼è¯·å¿è½»ä¿¡ï¼ï¼ï¼ |
| | | </slot> |
| | | </div> |
| | | <div class="recharge-tips-list"> |
| | | <div class="recharge-tips-item" v-for="(item, index) in props.tips" :key="index"> |
| | |
| | | LifeRechargeConstants, |
| | | ElectricParValueResponse, |
| | | ElectricSupportAreaResponse, |
| | | QueryUserAccountAllListInput, |
| | | UserAccountListOutput, |
| | | AddUpdateUserAccountInput, |
| | | GasParValueResponse, |
| | | } from '@life-payment/core-vue'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { useQuery, useQueryClient } from '@tanstack/vue-query'; |
| | | import { computed, MaybeRef, reactive, unref } from 'vue'; |
| | | import { useInfiniteLoading } from './infiniteLoading'; |
| | | import { OrderInputType } from '../constants'; |
| | |
| | | () => |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤è¯è´¹ææ£ |
| | | )?.rate ?? 1 |
| | | )?.rate ?? 100 |
| | | ); |
| | | |
| | | const lifePayElectricRate = computed( |
| | | () => |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤çµè´¹ææ£ |
| | | )?.rate ?? 1 |
| | | )?.rate ?? 100 |
| | | ); |
| | | |
| | | const lifePayGasRate = computed( |
| | | () => |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤çæ°ææ£ |
| | | )?.rate ?? 100 |
| | | ); |
| | | |
| | | return { |
| | | lifePayRateList, |
| | | lifePayPhoneRate, |
| | | lifePayElectricRate, |
| | | lifePayGasRate, |
| | | }; |
| | | } |
| | | |
| | |
| | | infiniteLoadingProps, |
| | | }; |
| | | } |
| | | |
| | | type UseUserAccountAllListOptions = { |
| | | lifePayOrderType: MaybeRef<LifeRechargeConstants.LifePayOrderTypeEnum>; |
| | | onSuccess?: (data: UserAccountListOutput[]) => any; |
| | | }; |
| | | |
| | | export function useUserAccountAllList({ |
| | | lifePayOrderType, |
| | | onSuccess, |
| | | }: UseUserAccountAllListOptions) { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { data: userAccountAllList, isLoading } = useQuery({ |
| | | queryKey: [ |
| | | 'blLifeRecharge/getUserAccountAllList', |
| | | blLifeRecharge.accountModel.userId, |
| | | lifePayOrderType, |
| | | ], |
| | | queryFn: async () => { |
| | | let params: QueryUserAccountAllListInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | lifePayOrderType: unref(lifePayOrderType), |
| | | }; |
| | | return await blLifeRecharge.services.getUserAccountAllList(params, { showLoading: false }); |
| | | }, |
| | | placeholderData: () => [] as UserAccountListOutput[], |
| | | onSuccess(data) { |
| | | onSuccess?.(data); |
| | | }, |
| | | }); |
| | | |
| | | const queryClient = useQueryClient(); |
| | | |
| | | function invalidateQueries() { |
| | | return queryClient.invalidateQueries({ |
| | | queryKey: [ |
| | | 'blLifeRecharge/getUserAccountAllList', |
| | | blLifeRecharge.accountModel.userId, |
| | | lifePayOrderType, |
| | | ], |
| | | }); |
| | | } |
| | | |
| | | return { |
| | | userAccountAllList, |
| | | isLoading, |
| | | invalidateQueries, |
| | | }; |
| | | } |
| | | |
| | | export function useAddUpdateUserAccount() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const queryClient = useQueryClient(); |
| | | |
| | | function invalidateQueries(lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum) { |
| | | return queryClient.invalidateQueries({ |
| | | queryKey: [ |
| | | 'blLifeRecharge/getUserAccountAllList', |
| | | blLifeRecharge.accountModel.userId, |
| | | lifePayOrderType, |
| | | ], |
| | | }); |
| | | } |
| | | |
| | | async function addUpdateUserAccount(params: AddUpdateUserAccountInput) { |
| | | let res = await blLifeRecharge.services.addUpdateUserAccount(params); |
| | | if (res) { |
| | | invalidateQueries(params.lifePayType); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | return { addUpdateUserAccount }; |
| | | } |
| | | |
| | | type UseSetUserAccountBySelectOptions = { |
| | | lifePayOrderType: MaybeRef<LifeRechargeConstants.LifePayOrderTypeEnum>; |
| | | onSetUserAccount: (currentUserAccount: UserAccountListOutput) => any; |
| | | }; |
| | | |
| | | export function useSetUserAccountBySelect({ |
| | | lifePayOrderType, |
| | | onSetUserAccount, |
| | | }: UseSetUserAccountBySelectOptions) { |
| | | const { userAccountAllList } = useUserAccountAllList({ |
| | | lifePayOrderType: lifePayOrderType, |
| | | onSuccess(data) { |
| | | if (data.length > 0) { |
| | | const currentUserAccount = data[0]; |
| | | onSetUserAccount?.(currentUserAccount); |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | function handleUserAccountChange(val: string) { |
| | | const currentUserAccount = userAccountAllList.value.find((x) => x.id === val); |
| | | onSetUserAccount?.(currentUserAccount); |
| | | } |
| | | |
| | | return { |
| | | handleUserAccountChange, |
| | | userAccountAllList, |
| | | }; |
| | | } |
| | | |
| | | export function useGetGasParValue() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { data: gasParValueList, isLoading } = useQuery({ |
| | | queryKey: ['blLifeRecharge/getGasParValue'], |
| | | queryFn: async () => { |
| | | return await blLifeRecharge.services.getGasParValue({ showLoading: false }); |
| | | }, |
| | | select(data) { |
| | | return data?.gasParValue ?? []; |
| | | }, |
| | | placeholderData: () => ({} as GasParValueResponse), |
| | | }); |
| | | |
| | | return { |
| | | gasParValueList, |
| | | }; |
| | | } |
| | |
| | | export { default as RechargeGrid } from './views/RechargeGrid/RechargeGrid.vue'; |
| | | export { default as PhoneBillRecharge } from './views/PhoneBillRecharge/PhoneBillRecharge.vue'; |
| | | export { default as electricBillRecharge } from './views/electricBillRecharge/electricBillRecharge.vue'; |
| | | export { default as GasBillRecharge } from './views/GasBillRecharge/GasBillRecharge.vue'; |
| | | export { default as SelectPayTypeView } from './views/SelectPayTypeView/SelectPayTypeView.vue'; |
| | | export { default as RechargeResultView } from './views/RechargeResultView/RechargeResultView.vue'; |
| | | export { default as PhoneOrder } from './views/Order/components/PhoneOrder.vue'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | @use './common.scss' as *; |
| | | |
| | | .gas-bill-recharge-wrapper { |
| | | .gasOrgType-card { |
| | | border-radius: 16px; |
| | | border: 1px solid #e8e8e8; |
| | | padding: 28px; |
| | | min-height: 120px; |
| | | margin-bottom: 30px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .gasOrgType-card-title { |
| | | font-size: 36px; |
| | | line-height: 48px; |
| | | color: boleGetCssVar('text-color', 'primary'); |
| | | } |
| | | } |
| | | } |
| | |
| | | @use './function.scss' as *; |
| | | @use './orderCard.scss' as *; |
| | | @use './card.scss' as *; |
| | | @use './gas.scss' as *; |
| | | @use './nut.scss' as *; |
| | | @use './layout.scss' as *; |
| | | @use './rechargeGrid.scss' as *; |
| | |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | |
| | | &.nut-button--plain { |
| | | border-width: 1px; |
| | | } |
| | | } |
| | | |
| | | &.electric { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GasBillRechargeStep1 v-if="current === 'step1'" /> |
| | | <GasBillRechargeStep2 v-else-if="current === 'step2'" /> |
| | | <GasBillRechargeStep3 |
| | | v-else-if="current === 'step3'" |
| | | v-bind="props" |
| | | @go-pay="emit('goPay', $event)" |
| | | /> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { computed, provide, reactive } from 'vue'; |
| | | import { useStepper } from 'senin-mini/hooks'; |
| | | import { GasBillRechargeContextKey } from './context'; |
| | | import GasBillRechargeStep1 from './GasBillRechargeStep1.vue'; |
| | | import GasBillRechargeStep2 from './GasBillRechargeStep2.vue'; |
| | | import GasBillRechargeStep3 from './GasBillRechargeStep3.vue'; |
| | | import { LifeRechargeConstants } from '@life-payment/core-vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasBillRecharge', |
| | | }); |
| | | |
| | | type Props = { |
| | | isDev?: boolean; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | isDev: false, |
| | | }); |
| | | |
| | | const stepperInfo = useStepper(['step1', 'step2', 'step3'], 'step3'); |
| | | const current = computed(() => stepperInfo.current.value); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goPay', orderNo: string): void; |
| | | }>(); |
| | | |
| | | const preSetForm = reactive({ |
| | | gasOrgType: '' as any as LifeRechargeConstants.GasOrgCodeEnum, |
| | | province: '', |
| | | city: '', |
| | | gasAccount: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | provide(GasBillRechargeContextKey, { |
| | | ...stepperInfo, |
| | | preSetForm, |
| | | }); |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <NutForm |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <NutFormItem label="ç¼´è´¹æ·å·" class="bole-form-item" prop="gasAccount" required> |
| | | <NutInput |
| | | v-model.trim="form.gasAccount" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥ç¼´è´¹æ·å·" |
| | | type="text" |
| | | max-length="13" |
| | | /> |
| | | </NutFormItem> |
| | | <slot></slot> |
| | | </NutForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Form as NutForm, FormItem as NutFormItem, Input as NutInput } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed, watch } from 'vue'; |
| | | import { useGetGasParValue } from '../../hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasBillRechargeBaseForm', |
| | | }); |
| | | |
| | | const form = defineModel<{ |
| | | province: string; |
| | | city: string; |
| | | gasAccount: string; |
| | | }>('form'); |
| | | |
| | | const { gasParValueList } = useGetGasParValue(); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | province: [{ required: true, message: 'è¯·éæ©æå¨åºå' }], |
| | | city: [{ required: true, message: 'è¯·éæ©æå¨åå¸' }], |
| | | gasAccount: [{ required: true, message: '请è¾å
¥ç¼´è´¹æ·å·', regex: /^\d{13}$/ }], |
| | | }); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | defineExpose({ |
| | | validate: computed(() => formRef.value.validate), |
| | | }); |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <NutForm label-position="top" class="order-bill-recharge gas-bill-recharge-wrapper phone"> |
| | | <NutFormItem class="bole-form-item"> |
| | | <GasOrgTypeCard |
| | | :title="item" |
| | | v-for="(item, gasOrgCodeEnum) in BlLifeRecharge.constants.GasOrgCodeEnumText" |
| | | :key="item" |
| | | @click="goNext(gasOrgCodeEnum)" |
| | | ></GasOrgTypeCard> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <NutButton class="recharge-button" type="primary" plain @click="goTo('step3')"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">è¿å</div> |
| | | </div> |
| | | </NutButton> |
| | | </div> |
| | | </NutForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Form as NutForm, FormItem as NutFormItem, Button as NutButton } from '@nutui/nutui-taro'; |
| | | import GasOrgTypeCard from './GasOrgTypeCard.vue'; |
| | | import { BlLifeRecharge, LifeRechargeConstants } from '@life-payment/core-vue'; |
| | | import { useGasBillRechargeContext } from './context'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasBillRechargeStep1', |
| | | }); |
| | | |
| | | const { preSetForm, goToNext, goTo } = useGasBillRechargeContext(); |
| | | |
| | | function goNext(gasOrgType: LifeRechargeConstants.GasOrgCodeEnum) { |
| | | preSetForm.gasOrgType = gasOrgType; |
| | | goToNext(); |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GasBillRechargeBaseForm ref="formRef" v-model:form="preSetForm"> |
| | | <NutFormItem label="夿³¨ä¿¡æ¯" class="bole-form-item" prop="remark"> |
| | | <NutInput |
| | | v-model.trim="preSetForm.remark" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥å¤æ³¨ä¿¡æ¯" |
| | | type="text" |
| | | max-length="30" |
| | | /> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <nut-button class="recharge-button" type="primary" plain @click="goToPrevious"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">è¿å</div> |
| | | </div> |
| | | </nut-button> |
| | | </div> |
| | | </GasBillRechargeBaseForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed, watch } from 'vue'; |
| | | import GasBillRechargeBaseForm from './GasBillRechargeBaseForm.vue'; |
| | | import { useGasBillRechargeContext } from './context'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | LifeRechargeConstants, |
| | | AddUpdateUserAccountInput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useAddUpdateUserAccount } from '../../hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasBillRechargeStep2', |
| | | }); |
| | | |
| | | const { preSetForm, goToPrevious, goToNext } = useGasBillRechargeContext(); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | function handleNext() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | handleAddUpdateUserAccount(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const { addUpdateUserAccount } = useAddUpdateUserAccount(); |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | async function handleAddUpdateUserAccount() { |
| | | try { |
| | | let params: AddUpdateUserAccountInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.çæ°è®¢å, |
| | | content: preSetForm.gasAccount, |
| | | province: preSetForm.province, |
| | | city: preSetForm.city, |
| | | extraProperties: JSON.stringify(preSetForm), |
| | | remark: preSetForm.remark, |
| | | }; |
| | | await addUpdateUserAccount(params); |
| | | goToNext(); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <NutForm |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <NutFormItem class="bole-form-item" prop="currentUserAccountId"> |
| | | <NutRadioGroup |
| | | v-model="form.currentUserAccountId" |
| | | direction="horizontal" |
| | | class="par-account-list" |
| | | v-if="userAccountAllList.length > 0" |
| | | @change="handleUserAccountChange" |
| | | > |
| | | <NutRadio :label="item.id" shape="button" v-for="item in userAccountAllList" :key="item.id" |
| | | >{{ item.city }}-{{ item.content }}</NutRadio |
| | | > |
| | | </NutRadioGroup> |
| | | <AccountCard |
| | | v-if="userAccountAllList.length > 0" |
| | | title="å
弿·å·" |
| | | :content="`${form.city} ${form.gasAccount}`" |
| | | :remark="form.remark" |
| | | > |
| | | <template #action> |
| | | <div class="account-card-action" @click="handleAddUserAccount">æ°å¢</div> |
| | | </template> |
| | | </AccountCard> |
| | | <AccountAddCard text="æ°å¢æ·å·" v-else @click="handleAddUserAccount" /> |
| | | </NutFormItem> |
| | | |
| | | <NutFormItem |
| | | v-if="!!form.province" |
| | | label="éæ©å
å¼éé¢" |
| | | class="bole-form-item" |
| | | prop="parValue" |
| | | required |
| | | > |
| | | <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> |
| | | <!-- <NutRadio |
| | | :label="Number(item)" |
| | | :key="item" |
| | | shape="button" |
| | | v-for="item in parValueList" |
| | | class="parValue-item" |
| | | > |
| | | <div class="parValue-item-inner"> |
| | | <div class="amount-wrapper"> |
| | | <div class="amount">{{ item }}</div> |
| | | <div class="unit">å
</div> |
| | | </div> |
| | | <div class="price-wrapper"> |
| | | <div class="price-text">æå</div> |
| | | <div class="price"> |
| | | {{ blLifeRecharge.getRechargeParValue(item, lifePayGasRate) }}å
|
| | | </div> |
| | | </div> |
| | | <div class="discountTag">{{ lifePayGasRate }}æ</div> |
| | | </div> |
| | | </NutRadio> --> |
| | | </NutRadioGroup> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleSubmit"> |
| | | <div class="recharge-button-inner"> |
| | | <!-- <div>ï¿¥{{ realParValue }}</div> --> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <RechargeTipsView :tips="tips"> |
| | | <template #tips-top> |
| | | åä¸çµè´¹è´¦æ·å¨å
弿é´åå¿å¨å¤å¹³å°éå¤å
å¼ï¼ä¸åå请ä»ç»é
è¯»ä¸æ¹é¡»ç¥å
容ãè¥æ¥å°éçæ¥çµï¼åå¿è½»ä¿¡ï¼ï¼ï¼ |
| | | </template> |
| | | </RechargeTipsView> |
| | | </div> |
| | | <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> |
| | | <template #tips> |
| | | 该产å为æ
¢å
模å¼ï¼0-72å°æ¶å
å°è´¦ï¼ä»æè¯·å¿ä»æ¬¾ï¼å
å¼å请ä»ç»é
读å
å¼é¡»ç¥ï¼ |
| | | </template> |
| | | <template #info> |
| | | <ConfirmDialogInfoItem |
| | | label="çæ°ç±»å" |
| | | :content="blLifeRecharge.constants.GasOrgCodeEnumText[form.gasOrgType]" |
| | | /> |
| | | <ConfirmDialogInfoItem :label-width="96" label="æ·å·" :content="form.gasAccount" /> |
| | | <ConfirmDialogInfoItem label="å
å¼éé¢" :content="`ï¿¥${form.parValue.toFixed(2)}`" danger /> |
| | | <ConfirmDialogInfoItem label="伿 éé¢" :content="`ï¿¥${discountParValue.toFixed(2)}`" /> |
| | | <ConfirmDialogInfoItem label="å®ä»éé¢" :content="`ï¿¥${realParValue}`" danger /> |
| | | </template> |
| | | <template #warning> |
| | | åä¸çæ°è´¹è´¦æ·å¨å
弿é´ï¼æªå°è´¦ååå¿å¨å
¶ä»ä»»ä½å¹³å°å次å
å¼ãå æ¤é æçèµéæå¤±é¡»ç¨æ·èªè¡æ¿æ
ï¼ï¼ï¼ |
| | | </template> |
| | | </ConfirmDialog> |
| | | </NutForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { |
| | | Form as NutForm, |
| | | FormItem as NutFormItem, |
| | | RadioGroup as NutRadioGroup, |
| | | Radio as NutRadio, |
| | | Button as NutButton, |
| | | } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed } from 'vue'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | LifeElectricDataCreateLifePayOrderInput, |
| | | LifeRechargeConstants, |
| | | LifeGasDataCreateLifePayOrderInput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useGetRate, useGetGasParValue, useSetUserAccountBySelect } from '../../hooks'; |
| | | import { useGasBillRechargeContext, GasUserAccountExtraProperties } from './context'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { CustomerServiceTips } from '../../constants'; |
| | | import AccountAddCard from '../../components/Card/AccountAddCard.vue'; |
| | | import AccountCard from '../../components/Card/AccountCard.vue'; |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasBillRechargeStep3', |
| | | }); |
| | | |
| | | type Props = { |
| | | isDev?: boolean; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | isDev: false, |
| | | }); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goPay', orderNo: string): void; |
| | | }>(); |
| | | |
| | | const { goTo } = useGasBillRechargeContext(); |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { lifePayGasRate } = useGetRate(); |
| | | |
| | | const form = reactive({ |
| | | parValue: 0, |
| | | province: '', |
| | | city: '', |
| | | gasOrgType: '', |
| | | gasAccount: '', |
| | | currentUserAccountId: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | const { userAccountAllList, handleUserAccountChange } = useSetUserAccountBySelect({ |
| | | lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum.çæ°è®¢å, |
| | | onSetUserAccount(currentUserAccount) { |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | currentUserAccount.extraProperties |
| | | ) as GasUserAccountExtraProperties; |
| | | // form.currentUserAccountId = currentUserAccount.id; |
| | | // form.electricAccount = currentUserAccount.content; |
| | | // form.province = currentUserAccount.province; |
| | | // form.city = currentUserAccount.city; |
| | | |
| | | // form.electricType = currentUserAccountExtraProperties.electricType; |
| | | // form.electricAccountType = currentUserAccountExtraProperties.electricAccountType; |
| | | // form.sixID = currentUserAccountExtraProperties.sixID; |
| | | // form.remark = currentUserAccount.remark; |
| | | // const electricParValueItem = electricParValueList.value.find( |
| | | // (x) => x.cityName === form.province |
| | | // ); |
| | | // if ( |
| | | // electricParValueItem && |
| | | // electricParValueItem.parValue.every((x) => Number(x) !== form.parValue) |
| | | // ) { |
| | | // form.parValue = 0; |
| | | // } |
| | | }, |
| | | }); |
| | | |
| | | function handleAddUserAccount() { |
| | | goTo('step1'); |
| | | } |
| | | |
| | | const realParValue = computed(() => |
| | | blLifeRecharge.getRechargeParValue(form.parValue, lifePayGasRate.value) |
| | | ); |
| | | const discountParValue = computed(() => form.parValue - Number(realParValue.value)); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | parValue: [ |
| | | { required: true, message: 'è¯·éæ©å
å¼éé¢', validator: FormValidator.validatorNumberNotNull }, |
| | | ], |
| | | currentUserAccountId: [{ required: true, message: 'è¯·éæ©å
弿·å·' }], |
| | | }); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | function handleSubmit() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | recharge(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const tips = [ |
| | | '平尿便
¢å
æå¡ï¼è®¢åæäº¤åï¼çæ°å°äº0 - 72 å°æ¶å
å°è´¦ï¼è¥æªè½ææ¶å°è´¦ï¼ç³»ç»å°èªå¨åèµ·éæ¬¾ã', |
| | | 'ç®åå¹³å°ä»
æ¯æä¸å½çæ°ååäº¬çæ°å
弿å¡ã', |
| | | 'ä¸å½çæ°å
弿·å·å¿
é¡»å¨â壹åæ
§âAPPçæ°ç¼´è´¹ç颿¥è¯¢å°è´¦æ·ä¿¡æ¯ï¼æ·å·ä¸º11å¼å¤´æè
5å¼å¤´ç10使°åã', |
| | | 'åäº¬çæ°ä¸æ¯ææ¬ è´¹å
å¼ï¼ä»
æ¯ææºè½è¡¨çæ·å·ï¼æ·å·æ¯9å¼å¤´11ä½çè´¦æ·è¿è¡å
å¼ã', |
| | | 'å
弿é´ï¼è¥åä¸è´¦æ·çå
弿¬¾æªå°è´¦ï¼è¯·å¿å¨å
¶ä»å¹³å°éå¤å
å¼ï¼å ä¸è¿°æä½å¯¼è´çèµéæå¤±ï¼ç±ç¨æ·èªè¡æ¿æ
ã', |
| | | '妿¥å°éçæ¥çµï¼å¯¹æ¹ä»¥ç¼´è´¹æè¯¯æä½ççç±è¦æ±å¤ç款项ï¼å¡å¿
ç«å³æé»ï¼è°¨é²è¯éªã', |
| | | 'ä¸åæ¶ï¼è¯·æ¨å¡å¿
å确填å宿´ççå¸åæ·å·ä¿¡æ¯ãå
å¼å®æåï¼å票ç±è¿è¥åæä¾ï¼æ¨å¯ç»å½ç½ä¸è¥ä¸å
ä¸è½½å¯¹åºççµåå票ã', |
| | | CustomerServiceTips, |
| | | ]; |
| | | |
| | | const confirmDialogVisible = ref(false); |
| | | |
| | | function recharge() { |
| | | confirmDialogVisible.value = true; |
| | | } |
| | | |
| | | async function goPay() { |
| | | try { |
| | | let params: LifeGasDataCreateLifePayOrderInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | productData: { |
| | | parValue: props.isDev ? 0.1 : form.parValue, |
| | | gasOrgType: form.gasOrgType, |
| | | gasAccount: form.gasAccount, |
| | | province: form.province, |
| | | city: form.city, |
| | | }, |
| | | }; |
| | | let res = await blLifeRecharge.services.createLifePayGasOrder(params); |
| | | emit('goPay', res.orderNo); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="gasOrgType-card"> |
| | | <div class="gasOrgType-card-title">{{ title }}</div> |
| | | <NutButton class="gasOrgType-card-button" type="primary"> è¿å
¥å
å¼ </NutButton> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Button as NutButton } from '@nutui/nutui-taro'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasOrgTypeCard', |
| | | }); |
| | | |
| | | type Props = { |
| | | title?: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { InjectionKey, UnwrapNestedRefs, Ref } from 'vue'; |
| | | import { inject } from 'vue'; |
| | | import { UseStepperReturn } from 'senin-mini/hooks'; |
| | | import { LifeRechargeConstants } from '@life-payment/core-vue'; |
| | | |
| | | type GasBillRechargeSteps = 'step1' | 'step2' | 'step3'; |
| | | |
| | | export interface GasBillRechargeContext |
| | | extends UseStepperReturn<GasBillRechargeSteps, GasBillRechargeSteps[], GasBillRechargeSteps> { |
| | | preSetForm: GasUserAccountExtraProperties; |
| | | } |
| | | |
| | | export const GasBillRechargeContextKey: InjectionKey<GasBillRechargeContext> = Symbol( |
| | | 'GasBillRechargeContextKey' |
| | | ); |
| | | |
| | | export function useGasBillRechargeContext() { |
| | | return inject(GasBillRechargeContextKey); |
| | | } |
| | | |
| | | export type GasUserAccountExtraProperties = { |
| | | gasOrgType: LifeRechargeConstants.GasOrgCodeEnum; |
| | | province: string; |
| | | city: string; |
| | | gasAccount: string; |
| | | remark: string; |
| | | }; |
| | |
| | | <template> |
| | | <PhoneBillRechargeBaseForm ref="formRef" v-model:form="form"> |
| | | <NutFormItem label="夿³¨ä¿¡æ¯" class="bole-form-item" prop="remark"> |
| | | <NutInput |
| | | v-model.trim="form.remark" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥å¤æ³¨ä¿¡æ¯" |
| | | type="text" |
| | | max-length="30" |
| | | /> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <nut-button class="recharge-button" type="primary" plain @click="goToNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">è¿å</div> |
| | | </div> |
| | | </nut-button> |
| | | </div> |
| | | </PhoneBillRechargeBaseForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { |
| | | Form as NutForm, |
| | | FormItem as NutFormItem, |
| | | RadioGroup as NutRadioGroup, |
| | | Radio as NutRadio, |
| | | Input as NutInput, |
| | | Button as NutButton, |
| | | } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { Button as NutButton, FormItem as NutFormItem, Input as NutInput } from '@nutui/nutui-taro'; |
| | | import { reactive, ref, computed, provide } from 'vue'; |
| | | import BlRadio from '../../components/Radio/Radio.vue'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | BlLifeRecharge, |
| | | LifePhoneDataCreateLifePayOrderInput, |
| | | LifeRechargeConstants, |
| | | } from '@life-payment/core-vue'; |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | import { useGetRate, useGetPhoneParValue } from '../../hooks'; |
| | | import PhoneBillRechargeBaseForm from './PhoneBillRechargeBaseForm.vue'; |
| | | import { usePhoneBillRechargeContext } from './context'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | LifeRechargeConstants, |
| | | AddUpdateUserAccountInput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useAddUpdateUserAccount } from '../../hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'PhoneBillRechargeStep1', |
| | |
| | | ispCode: '', |
| | | phone: '', |
| | | name: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | const { goToNext } = usePhoneBillRechargeContext(); |
| | |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | goToNext(); |
| | | handleAddUpdateUserAccount(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const { addUpdateUserAccount } = useAddUpdateUserAccount(); |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | async function handleAddUpdateUserAccount() { |
| | | try { |
| | | let params: AddUpdateUserAccountInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | operators: form.ispCode, |
| | | lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.è¯è´¹è®¢å, |
| | | content: form.phone, |
| | | extraProperties: JSON.stringify(form), |
| | | remark: form.remark, |
| | | }; |
| | | await addUpdateUserAccount(params); |
| | | goToNext(); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| | |
| | | label-position="top" |
| | | class="order-bill-recharge phone" |
| | | > |
| | | <NutFormItem class="bole-form-item"> |
| | | <!-- <AccountAddCard /> --> |
| | | <NutRadioGroup v-model="val1" direction="horizontal" class="par-account-list"> |
| | | <NutRadio label="1" shape="button">Option 1</NutRadio> |
| | | <NutRadio label="2" shape="button">Option 2</NutRadio> |
| | | <NutRadio label="3" shape="button">Option 3</NutRadio> |
| | | <NutRadio label="4" shape="button">Option 4</NutRadio> |
| | | <NutRadio label="5" shape="button">Option 5</NutRadio> |
| | | <NutRadio label="6" shape="button">Option 6</NutRadio> |
| | | <NutFormItem class="bole-form-item" prop="currentUserAccountId"> |
| | | <NutRadioGroup |
| | | v-model="form.currentUserAccountId" |
| | | direction="horizontal" |
| | | class="par-account-list" |
| | | v-if="userAccountAllList.length > 0" |
| | | @change="handleUserAccountChange" |
| | | > |
| | | <NutRadio |
| | | :label="item.id" |
| | | shape="button" |
| | | v-for="item in userAccountAllList" |
| | | :key="item.id" |
| | | >{{ item.content }}</NutRadio |
| | | > |
| | | </NutRadioGroup> |
| | | <AccountCard title="å
弿æºå·" content="18858418480" remark="çå°æ¹éªå²çå¼å§å"> |
| | | <AccountCard |
| | | v-if="userAccountAllList.length > 0" |
| | | title="å
弿æºå·" |
| | | :content="form.phone" |
| | | :remark="form.remark" |
| | | > |
| | | <template #action> |
| | | <div class="account-card-action">æ°å¢</div> |
| | | <div class="account-card-action" @click="handleAddUserAccount">æ°å¢</div> |
| | | </template> |
| | | </AccountCard> |
| | | <AccountAddCard v-else @click="handleAddUserAccount" /> |
| | | </NutFormItem> |
| | | |
| | | <NutFormItem label="éæ©å
å¼éé¢" class="bole-form-item" prop="parValue" required> |
| | |
| | | {{ blLifeRecharge.getRechargeParValue(item, lifePayPhoneRate) }}å
|
| | | </div> |
| | | </div> |
| | | <div class="discountTag">{{ lifePayPhoneRate * 100 }}æ</div> |
| | | <div class="discountTag">{{ lifePayPhoneRate }}æ</div> |
| | | </div> |
| | | </NutRadio> |
| | | </NutRadioGroup> |
| | |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | import { useGetRate, useGetPhoneParValue } from '../../hooks'; |
| | | import { useGetRate, useGetPhoneParValue, useSetUserAccountBySelect } from '../../hooks'; |
| | | import { CustomerServiceTips } from '../../constants'; |
| | | import AccountAddCard from '../../components/Card/AccountAddCard.vue'; |
| | | import AccountCard from '../../components/Card/AccountCard.vue'; |
| | | import { usePhoneBillRechargeContext, PhoneUserAccountExtraProperties } from './context'; |
| | | |
| | | defineOptions({ |
| | | name: 'PhoneBillRechargeStep2', |
| | |
| | | isDev: false, |
| | | }); |
| | | |
| | | const { goTo } = usePhoneBillRechargeContext(); |
| | | |
| | | const form = reactive({ |
| | | ispCode: '', |
| | | phone: '', |
| | | parValue: 0, |
| | | name: '', |
| | | currentUserAccountId: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | const val1 = ref(''); |
| | | const { userAccountAllList, handleUserAccountChange } = useSetUserAccountBySelect({ |
| | | lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum.è¯è´¹è®¢å, |
| | | onSetUserAccount(currentUserAccount) { |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | currentUserAccount.extraProperties |
| | | ) as PhoneUserAccountExtraProperties; |
| | | form.currentUserAccountId = currentUserAccount.id; |
| | | form.phone = currentUserAccount.content; |
| | | form.ispCode = currentUserAccountExtraProperties.ispCode; |
| | | form.name = currentUserAccountExtraProperties.name; |
| | | |
| | | form.remark = currentUserAccount.remark; |
| | | |
| | | changeIspCode(form.ispCode as any); |
| | | }, |
| | | }); |
| | | |
| | | function handleAddUserAccount() { |
| | | goTo('step1'); |
| | | } |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goPay', orderNo: string): void; |
| | |
| | | |
| | | function changeIspCode(val: LifeRechargeConstants.IspCode) { |
| | | const phoneParValueItem = phoneParValueList.value.find((x) => x.ispCode === val); |
| | | if (phoneParValueItem.parValue.every((x) => Number(x) !== form.parValue)) { |
| | | if (phoneParValueItem && phoneParValueItem.parValue.every((x) => Number(x) !== form.parValue)) { |
| | | form.parValue = 0; |
| | | } |
| | | } |
| | |
| | | parValue: [ |
| | | { required: true, message: 'è¯·éæ©å
å¼éé¢', validator: FormValidator.validatorNumberNotNull }, |
| | | ], |
| | | currentUserAccountId: [{ required: true, message: 'è¯·éæ©å
弿æºå·' }], |
| | | }); |
| | | |
| | | const formRef = ref<any>(null); |
| | |
| | | export function usePhoneBillRechargeContext() { |
| | | return inject(PhoneBillRechargeContextKey); |
| | | } |
| | | |
| | | export type PhoneUserAccountExtraProperties = { |
| | | ispCode: string; |
| | | phone: string; |
| | | name: string; |
| | | remark: string; |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <NutForm |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <NutFormItem label="æå¨åºå" class="bole-form-item" prop="province" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.province" |
| | | placeholder="è¯·éæ©åºå" |
| | | :value-enum="electricParValueList" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </NutFormItem> |
| | | <NutFormItem label="æå¨åå¸" class="bole-form-item" prop="city" required v-if="form.province"> |
| | | <ChooseInputWithPicker |
| | | v-model="form.city" |
| | | placeholder="è¯·éæ©åå¸" |
| | | :value-enum="electricCityList" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </NutFormItem> |
| | | <!-- <NutFormItem label="çµç½ç±»å" class="bole-form-item" prop="electricType" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.electricType" |
| | | placeholder="è¯·éæ©çµç½ç±»å" |
| | | :value-enum="blLifeRecharge.constants.ElectricTypeText" |
| | | /> |
| | | </NutFormItem> --> |
| | | <NutFormItem label="çµè´¹ç±»å" class="bole-form-item" prop="electricAccountType" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.electricAccountType" |
| | | placeholder="è¯·éæ©çµè´¹ç±»å" |
| | | :value-enum="blLifeRecharge.constants.ElectricAccountTypeText" |
| | | /> |
| | | </NutFormItem> |
| | | <NutFormItem label="çµç½æ·å·" class="bole-form-item" prop="electricAccount" required> |
| | | <NumberInput |
| | | v-model.trim="form.electricAccount" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥13使°åç¼å·" |
| | | max-length="13" |
| | | /> |
| | | </NutFormItem> |
| | | <NutFormItem |
| | | v-if="form.electricType === blLifeRecharge.constants.ElectricType.nanwang" |
| | | label="身份è¯åå
ä½" |
| | | class="bole-form-item" |
| | | prop="sixID" |
| | | required |
| | | > |
| | | <NutInput |
| | | v-model.trim="form.sixID" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥èº«ä»½è¯åå
ä½" |
| | | type="text" |
| | | max-length="6" |
| | | /> |
| | | </NutFormItem> |
| | | <slot /> |
| | | </NutForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Form as NutForm, FormItem as NutFormItem, Input as NutInput } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed, watch } from 'vue'; |
| | | import { useLifeRechargeContext } from '@life-payment/core-vue'; |
| | | import ChooseInputWithPicker from '../../components/Input/ChooseInputWithPicker.vue'; |
| | | import NumberInput from '../../components/Input/NumberInput.vue'; |
| | | import { useGetElectricParValue } from '../../hooks'; |
| | | import { FormValidator } from '../../utils'; |
| | | |
| | | defineOptions({ |
| | | name: 'ElectricBillRechargeBaseForm', |
| | | }); |
| | | const form = defineModel<{ |
| | | electricAccount: string; |
| | | electricType: string; |
| | | electricAccountType: string; |
| | | province: string; |
| | | city: string; |
| | | sixID: string; |
| | | }>('form'); |
| | | |
| | | const { electricParValueList } = useGetElectricParValue(); |
| | | |
| | | const electricCityList = computed( |
| | | () => |
| | | electricParValueList.value.find((x) => x.cityName === form.value.province)?.childCityList ?? [] |
| | | ); |
| | | |
| | | watch( |
| | | () => form.value.province, |
| | | (provinceName) => { |
| | | const electricParValue = electricParValueList.value.find( |
| | | (item) => item.cityName === provinceName |
| | | ); |
| | | form.value.electricType = electricParValue.electricType; |
| | | } |
| | | ); |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | province: [{ required: true, message: 'è¯·éæ©æå¨åºå' }], |
| | | city: [{ required: true, message: 'è¯·éæ©æå¨åå¸' }], |
| | | electricAccountType: [{ required: true, message: 'è¯·éæ©çµè´¹ç±»å' }], |
| | | electricAccount: [{ required: true, message: '请è¾å
¥çµç½æ·å·', regex: /^\d{13}$/ }], |
| | | sixID: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥èº«ä»½è¯åå
ä½', |
| | | validator: FormValidator.validatorIDNumberSix, |
| | | }, |
| | | ], |
| | | }); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | defineExpose({ |
| | | validate: computed(() => formRef.value.validate), |
| | | }); |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <ElectricBillRechargeBaseForm ref="formRef" v-model:form="form"> |
| | | <NutFormItem label="夿³¨ä¿¡æ¯" class="bole-form-item" prop="remark"> |
| | | <NutInput |
| | | v-model.trim="form.remark" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥å¤æ³¨ä¿¡æ¯" |
| | | type="text" |
| | | max-length="30" |
| | | /> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <nut-button class="recharge-button" type="primary" plain @click="goToNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">è¿å</div> |
| | | </div> |
| | | </nut-button> |
| | | </div> |
| | | </ElectricBillRechargeBaseForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Button as NutButton, FormItem as NutFormItem, Input as NutInput } from '@nutui/nutui-taro'; |
| | | import { reactive, ref } from 'vue'; |
| | | import { useElectricBillRechargeContext } from './context'; |
| | | import ElectricBillRechargeBaseForm from './ElectricBillRechargeBaseForm.vue'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | LifeRechargeConstants, |
| | | AddUpdateUserAccountInput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useAddUpdateUserAccount } from '../../hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'ElectricBillRechargeStep1', |
| | | }); |
| | | |
| | | const form = reactive({ |
| | | electricAccount: '', |
| | | electricType: '', |
| | | electricAccountType: '', |
| | | province: '', |
| | | city: '', |
| | | sixID: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | const { goToNext } = useElectricBillRechargeContext(); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | function handleNext() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | handleAddUpdateUserAccount(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const { addUpdateUserAccount } = useAddUpdateUserAccount(); |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | async function handleAddUpdateUserAccount() { |
| | | try { |
| | | let params: AddUpdateUserAccountInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.çµè´¹è®¢å, |
| | | content: form.electricAccount, |
| | | province: form.province, |
| | | city: form.city, |
| | | extraProperties: JSON.stringify(form), |
| | | remark: form.remark, |
| | | }; |
| | | await addUpdateUserAccount(params); |
| | | goToNext(); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <NutForm |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <NutFormItem class="bole-form-item" prop="currentUserAccountId"> |
| | | <NutRadioGroup |
| | | v-model="form.currentUserAccountId" |
| | | direction="horizontal" |
| | | class="par-account-list" |
| | | v-if="userAccountAllList.length > 0" |
| | | @change="handleUserAccountChange" |
| | | > |
| | | <NutRadio :label="item.id" shape="button" v-for="item in userAccountAllList" :key="item.id" |
| | | >{{ item.city }}-{{ item.content }}</NutRadio |
| | | > |
| | | </NutRadioGroup> |
| | | <AccountCard |
| | | v-if="userAccountAllList.length > 0" |
| | | title="å
弿·å·" |
| | | :content="`${form.city} ${form.electricAccount}`" |
| | | :remark="form.remark" |
| | | > |
| | | <template #action> |
| | | <div class="account-card-action" @click="handleAddUserAccount">æ°å¢</div> |
| | | </template> |
| | | </AccountCard> |
| | | <AccountAddCard text="æ°å¢æ·å·" v-else @click="handleAddUserAccount" /> |
| | | </NutFormItem> |
| | | |
| | | <NutFormItem |
| | | v-if="!!form.province" |
| | | label="éæ©å
å¼éé¢" |
| | | class="bole-form-item" |
| | | prop="parValue" |
| | | required |
| | | > |
| | | <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> |
| | | <NutRadio |
| | | :label="Number(item)" |
| | | :key="item" |
| | | shape="button" |
| | | v-for="item in parValueList" |
| | | class="parValue-item" |
| | | > |
| | | <div class="parValue-item-inner"> |
| | | <div class="amount-wrapper"> |
| | | <div class="amount">{{ item }}</div> |
| | | <div class="unit">å
</div> |
| | | </div> |
| | | <div class="price-wrapper"> |
| | | <div class="price-text">æå</div> |
| | | <div class="price"> |
| | | {{ blLifeRecharge.getRechargeParValue(item, lifePayElectricRate) }}å
|
| | | </div> |
| | | </div> |
| | | <div class="discountTag">{{ lifePayElectricRate }}æ</div> |
| | | </div> |
| | | </NutRadio> |
| | | </NutRadioGroup> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleSubmit"> |
| | | <div class="recharge-button-inner"> |
| | | <div>ï¿¥{{ realParValue }}</div> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <RechargeTipsView :tips="tips" /> |
| | | </div> |
| | | <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> |
| | | <template #tips> |
| | | 该产å为æ
¢å
模å¼ï¼0-72å°æ¶å
å°è´¦ï¼ä»æè¯·å¿ä»æ¬¾ï¼å
å¼å请ä»ç»é
读å
å¼é¡»ç¥ï¼ |
| | | </template> |
| | | <template #info> |
| | | <ConfirmDialogInfoItem |
| | | label="çµç½ç±»å" |
| | | :content="blLifeRecharge.constants.ElectricTypeText[form.electricType]" |
| | | /> |
| | | <ConfirmDialogInfoItem :label-width="96" label="æ·å·" :content="form.electricAccount" /> |
| | | <ConfirmDialogInfoItem label="å
å¼éé¢" :content="`ï¿¥${form.parValue.toFixed(2)}`" danger /> |
| | | <ConfirmDialogInfoItem label="伿 éé¢" :content="`ï¿¥${discountParValue.toFixed(2)}`" /> |
| | | <ConfirmDialogInfoItem label="å®ä»éé¢" :content="`ï¿¥${realParValue}`" danger /> |
| | | </template> |
| | | <template #warning> |
| | | åä¸çµè´¹è´¦æ·å¨å
弿é´ï¼æªå°è´¦ååå¿å¨å
¶ä»ä»»ä½å¹³å°å次å
å¼ãå æ¤é æçèµéæå¤±é¡»ç¨æ·èªè¡æ¿æ
ï¼ï¼ï¼ |
| | | </template> |
| | | </ConfirmDialog> |
| | | </NutForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { |
| | | Form as NutForm, |
| | | FormItem as NutFormItem, |
| | | RadioGroup as NutRadioGroup, |
| | | Radio as NutRadio, |
| | | Button as NutButton, |
| | | } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed } from 'vue'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | LifeElectricDataCreateLifePayOrderInput, |
| | | LifeRechargeConstants, |
| | | UserAccountListOutput, |
| | | } from '@life-payment/core-vue'; |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | import { useGetRate, useGetElectricParValue, useSetUserAccountBySelect } from '../../hooks'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { CustomerServiceTips } from '../../constants'; |
| | | import AccountAddCard from '../../components/Card/AccountAddCard.vue'; |
| | | import AccountCard from '../../components/Card/AccountCard.vue'; |
| | | import { useElectricBillRechargeContext, ElectricUserAccountExtraProperties } from './context'; |
| | | |
| | | defineOptions({ |
| | | name: 'ElectricBillRechargeStep2', |
| | | }); |
| | | |
| | | type Props = { |
| | | isDev?: boolean; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | isDev: false, |
| | | }); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goPay', orderNo: string): void; |
| | | }>(); |
| | | |
| | | const { goTo } = useElectricBillRechargeContext(); |
| | | |
| | | const form = reactive({ |
| | | parValue: 0, |
| | | electricAccount: '', |
| | | electricType: '', |
| | | electricAccountType: '', |
| | | province: '', |
| | | city: '', |
| | | sixID: '', |
| | | currentUserAccountId: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | const { userAccountAllList, handleUserAccountChange } = useSetUserAccountBySelect({ |
| | | lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum.çµè´¹è®¢å, |
| | | onSetUserAccount(currentUserAccount) { |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | currentUserAccount.extraProperties |
| | | ) as ElectricUserAccountExtraProperties; |
| | | form.currentUserAccountId = currentUserAccount.id; |
| | | form.electricAccount = currentUserAccount.content; |
| | | form.province = currentUserAccount.province; |
| | | form.city = currentUserAccount.city; |
| | | |
| | | form.electricType = currentUserAccountExtraProperties.electricType; |
| | | form.electricAccountType = currentUserAccountExtraProperties.electricAccountType; |
| | | form.sixID = currentUserAccountExtraProperties.sixID; |
| | | form.remark = currentUserAccount.remark; |
| | | const electricParValueItem = electricParValueList.value.find( |
| | | (x) => x.cityName === form.province |
| | | ); |
| | | if ( |
| | | electricParValueItem && |
| | | electricParValueItem.parValue.every((x) => Number(x) !== form.parValue) |
| | | ) { |
| | | form.parValue = 0; |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | function handleAddUserAccount() { |
| | | goTo('step1'); |
| | | } |
| | | |
| | | const { lifePayElectricRate } = useGetRate(); |
| | | const { electricParValueList } = useGetElectricParValue(); |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const parValueList = computed(() => { |
| | | const parValueList = |
| | | electricParValueList.value.find((x) => x.cityName === form.province)?.parValue ?? []; |
| | | return blLifeRecharge.filterParValueList(parValueList); |
| | | }); |
| | | |
| | | const realParValue = computed(() => |
| | | blLifeRecharge.getRechargeParValue(form.parValue, lifePayElectricRate.value) |
| | | ); |
| | | const discountParValue = computed(() => form.parValue - Number(realParValue.value)); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | parValue: [ |
| | | { required: true, message: 'è¯·éæ©å
å¼éé¢', validator: FormValidator.validatorNumberNotNull }, |
| | | ], |
| | | currentUserAccountId: [{ required: true, message: 'è¯·éæ©å
弿·å·' }], |
| | | }); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | function handleSubmit() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | recharge(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const tips = [ |
| | | '平尿便
¢å
æå¡ï¼è®¢åæäº¤åï¼çµè´¹å°äº0 - 72 å°æ¶å
å°è´¦ï¼è¥æªè½ææ¶å°è´¦ï¼ç³»ç»å°èªå¨åèµ·éæ¬¾ã', |
| | | 'å
弿é´ï¼è¥åä¸è´¦æ·çå
弿¬¾æªå°è´¦ï¼è¯·å¿å¨å
¶ä»å¹³å°éå¤å
å¼ï¼å ä¸è¿°æä½å¯¼è´çèµéæå¤±ï¼ç±ç¨æ·èªè¡æ¿æ
ã', |
| | | '为确ä¿å
å¼é¡ºå©è¿è¡ï¼ç®åå¹³å°ä¸æ¯æå¯¹æ¬ 款éé¢è¶
è¿1000å
çè´¦æ·è¿è¡å
å¼ï¼ä¸æ¯æ¬¡å
å¼éé¢å¿
é¡»é«äºæ¬ è´¹æ»é¢ã', |
| | | '妿¥å°éçæ¥çµï¼å¯¹æ¹ä»¥ç¼´è´¹æè¯¯æä½ççç±è¦æ±å¤ç款项ï¼å¡å¿
ç«å³æé»ï¼è°¨é²è¯éªã', |
| | | 'ä¸åæ¶ï¼è¯·æ¨å¡å¿
å确填å宿´ççå¸åæ·å·ä¿¡æ¯ãå
å¼å®æåï¼å票ç±è¿è¥åæä¾ï¼æ¨å¯ç»å½ç½ä¸è¥ä¸å
ä¸è½½å¯¹åºççµåå票ã', |
| | | CustomerServiceTips, |
| | | ]; |
| | | |
| | | const confirmDialogVisible = ref(false); |
| | | |
| | | function recharge() { |
| | | confirmDialogVisible.value = true; |
| | | } |
| | | |
| | | async function goPay() { |
| | | try { |
| | | let params: LifeElectricDataCreateLifePayOrderInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | productData: { |
| | | parValue: props.isDev ? 0.1 : form.parValue, |
| | | electricType: form.electricType, |
| | | electricAccountType: form.electricAccountType, |
| | | electricAccount: form.electricAccount, |
| | | province: form.province, |
| | | city: form.city, |
| | | sixID: form.sixID, |
| | | }, |
| | | }; |
| | | let res = await blLifeRecharge.services.createLifePayElectricOrder(params); |
| | | emit('goPay', res.orderNo); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { InjectionKey, UnwrapNestedRefs, Ref } from 'vue'; |
| | | import { inject } from 'vue'; |
| | | import { UseStepperReturn } from 'senin-mini/hooks'; |
| | | |
| | | type ElectricBillRechargeSteps = 'step1' | 'step2'; |
| | | |
| | | export interface ElectricBillRechargeContext |
| | | extends UseStepperReturn< |
| | | ElectricBillRechargeSteps, |
| | | ElectricBillRechargeSteps[], |
| | | ElectricBillRechargeSteps |
| | | > { |
| | | // form: UnwrapNestedRefs<{ |
| | | // ispCode: string; |
| | | // phone: string; |
| | | // parValue: number; |
| | | // name: string; |
| | | // }>; |
| | | } |
| | | |
| | | export const ElectricBillRechargeContextKey: InjectionKey<ElectricBillRechargeContext> = Symbol( |
| | | 'ElectricBillRechargeContextKey' |
| | | ); |
| | | |
| | | export function useElectricBillRechargeContext() { |
| | | return inject(ElectricBillRechargeContextKey); |
| | | } |
| | | |
| | | export type ElectricUserAccountExtraProperties = { |
| | | electricAccount: string; |
| | | electricType: string; |
| | | electricAccountType: string; |
| | | province: string; |
| | | city: string; |
| | | sixID: string; |
| | | remark: string; |
| | | }; |
| | |
| | | <template> |
| | | <NutForm |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <FormItem label="æå¨åºå" class="bole-form-item" prop="province" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.province" |
| | | placeholder="è¯·éæ©åºå" |
| | | :value-enum="electricParValueList" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="æå¨åå¸" class="bole-form-item" prop="city" required v-if="form.province"> |
| | | <ChooseInputWithPicker |
| | | v-model="form.city" |
| | | placeholder="è¯·éæ©åå¸" |
| | | :value-enum="electricCityList" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </FormItem> |
| | | <!-- <FormItem label="çµç½ç±»å" class="bole-form-item" prop="electricType" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.electricType" |
| | | placeholder="è¯·éæ©çµç½ç±»å" |
| | | :value-enum="blLifeRecharge.constants.ElectricTypeText" |
| | | /> |
| | | </FormItem> --> |
| | | <FormItem label="çµè´¹ç±»å" class="bole-form-item" prop="electricAccountType" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.electricAccountType" |
| | | placeholder="è¯·éæ©çµè´¹ç±»å" |
| | | :value-enum="blLifeRecharge.constants.ElectricAccountTypeText" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="çµç½æ·å·" class="bole-form-item" prop="electricAccount" required> |
| | | <NumberInput |
| | | v-model.trim="form.electricAccount" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥13使°åç¼å·" |
| | | max-length="13" |
| | | /> |
| | | </FormItem> |
| | | <FormItem |
| | | v-if="form.electricType === blLifeRecharge.constants.ElectricType.nanwang" |
| | | label="身份è¯åå
ä½" |
| | | class="bole-form-item" |
| | | prop="sixID" |
| | | required |
| | | > |
| | | <NutInput |
| | | v-model.trim="form.sixID" |
| | | class="bole-input-text" |
| | | placeholder="请è¾å
¥èº«ä»½è¯åå
ä½" |
| | | type="text" |
| | | max-length="6" |
| | | /> |
| | | </FormItem> |
| | | <FormItem |
| | | v-if="!!form.province" |
| | | label="éæ©å
å¼éé¢" |
| | | class="bole-form-item" |
| | | prop="parValue" |
| | | required |
| | | > |
| | | <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> |
| | | <NutRadio |
| | | :label="Number(item)" |
| | | :key="item" |
| | | shape="button" |
| | | v-for="item in parValueList" |
| | | class="parValue-item" |
| | | > |
| | | <div class="parValue-item-inner"> |
| | | <div class="amount-wrapper"> |
| | | <div class="amount">{{ item }}</div> |
| | | <div class="unit">å
</div> |
| | | </div> |
| | | <div class="price-wrapper"> |
| | | <div class="price-text">æå</div> |
| | | <div class="price"> |
| | | {{ blLifeRecharge.getRechargeParValue(item, lifePayElectricRate) }}å
|
| | | </div> |
| | | </div> |
| | | <div class="discountTag">{{ lifePayElectricRate * 100 }}æ</div> |
| | | </div> |
| | | </NutRadio> |
| | | </NutRadioGroup> |
| | | </FormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleSubmit"> |
| | | <div class="recharge-button-inner"> |
| | | <div>ï¿¥{{ realParValue }}</div> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <RechargeTipsView :tips="tips" /> |
| | | </div> |
| | | <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> |
| | | <template #tips> |
| | | 该产å为æ
¢å
模å¼ï¼0-72å°æ¶å
å°è´¦ï¼ä»æè¯·å¿ä»æ¬¾ï¼å
å¼å请ä»ç»é
读å
å¼é¡»ç¥ï¼ |
| | | </template> |
| | | <template #info> |
| | | <ConfirmDialogInfoItem |
| | | label="çµç½ç±»å" |
| | | :content="blLifeRecharge.constants.ElectricTypeText[form.electricType]" |
| | | /> |
| | | <ConfirmDialogInfoItem :label-width="96" label="æ·å·" :content="form.electricAccount" /> |
| | | <ConfirmDialogInfoItem label="å
å¼éé¢" :content="`ï¿¥${form.parValue.toFixed(2)}`" danger /> |
| | | <ConfirmDialogInfoItem label="伿 éé¢" :content="`ï¿¥${discountParValue.toFixed(2)}`" /> |
| | | <ConfirmDialogInfoItem label="å®ä»éé¢" :content="`ï¿¥${realParValue}`" danger /> |
| | | </template> |
| | | <template #warning> |
| | | åä¸çµè´¹è´¦æ·å¨å
弿é´ï¼æªå°è´¦ååå¿å¨å
¶ä»ä»»ä½å¹³å°å次å
å¼ãå æ¤é æçèµéæå¤±é¡»ç¨æ·èªè¡æ¿æ
ï¼ï¼ï¼ |
| | | </template> |
| | | </ConfirmDialog> |
| | | </NutForm> |
| | | <ElectricBillRechargeStep1 v-if="current === 'step1'" /> |
| | | <ElectricBillRechargeStep2 |
| | | v-else-if="current === 'step2'" |
| | | v-bind="props" |
| | | @go-pay="emit('goPay', $event)" |
| | | /> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { |
| | | Form as NutForm, |
| | | FormItem, |
| | | RadioGroup as NutRadioGroup, |
| | | Radio as NutRadio, |
| | | Input as NutInput, |
| | | Button as NutButton, |
| | | } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed, watch } from 'vue'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | BlLifeRecharge, |
| | | LifeElectricDataCreateLifePayOrderInput, |
| | | } from '@life-payment/core-vue'; |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | import ChooseInputWithPicker from '../../components/Input/ChooseInputWithPicker.vue'; |
| | | import NumberInput from '../../components/Input/NumberInput.vue'; |
| | | import { useGetRate, useGetElectricParValue } from '../../hooks'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { CustomerServiceTips } from '../../constants'; |
| | | import { computed, provide } from 'vue'; |
| | | import { useStepper } from 'senin-mini/hooks'; |
| | | import { ElectricBillRechargeContextKey } from './context'; |
| | | import ElectricBillRechargeStep1 from './ElectricBillRechargeStep1.vue'; |
| | | import ElectricBillRechargeStep2 from './ElectricBillRechargeStep2.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'electricBillRecharge', |
| | |
| | | (e: 'goPay', orderNo: string): void; |
| | | }>(); |
| | | |
| | | const form = reactive({ |
| | | parValue: 0, |
| | | electricAccount: '', |
| | | electricType: '', |
| | | electricAccountType: '', |
| | | province: '', |
| | | city: '', |
| | | sixID: '', |
| | | const stepperInfo = useStepper(['step1', 'step2'], 'step2'); |
| | | const current = computed(() => stepperInfo.current.value); |
| | | |
| | | provide(ElectricBillRechargeContextKey, { |
| | | ...stepperInfo, |
| | | }); |
| | | |
| | | const { lifePayElectricRate } = useGetRate(); |
| | | const { electricParValueList } = useGetElectricParValue(); |
| | | |
| | | const parValueList = computed(() => { |
| | | const parValueList = |
| | | electricParValueList.value.find((x) => x.cityName === form.province)?.parValue ?? []; |
| | | return blLifeRecharge.filterParValueList(parValueList); |
| | | }); |
| | | |
| | | const electricCityList = computed( |
| | | () => electricParValueList.value.find((x) => x.cityName === form.province)?.childCityList ?? [] |
| | | ); |
| | | |
| | | watch( |
| | | () => form.province, |
| | | (provinceName) => { |
| | | const electricParValue = electricParValueList.value.find( |
| | | (item) => item.cityName === provinceName |
| | | ); |
| | | form.electricType = electricParValue.electricType; |
| | | } |
| | | ); |
| | | |
| | | const realParValue = computed(() => |
| | | blLifeRecharge.getRechargeParValue(form.parValue, lifePayElectricRate.value) |
| | | ); |
| | | const discountParValue = computed(() => form.parValue - Number(realParValue.value)); |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | province: [{ required: true, message: 'è¯·éæ©æå¨åºå' }], |
| | | city: [{ required: true, message: 'è¯·éæ©æå¨åå¸' }], |
| | | electricAccountType: [{ required: true, message: 'è¯·éæ©çµè´¹ç±»å' }], |
| | | electricAccount: [{ required: true, message: '请è¾å
¥çµç½æ·å·', regex: /^\d{13}$/ }], |
| | | sixID: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥èº«ä»½è¯åå
ä½', |
| | | validator: FormValidator.validatorIDNumberSix, |
| | | }, |
| | | ], |
| | | parValue: [ |
| | | { required: true, message: 'è¯·éæ©å
å¼éé¢', validator: FormValidator.validatorNumberNotNull }, |
| | | ], |
| | | }); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | function handleSubmit() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | recharge(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const tips = [ |
| | | '平尿便
¢å
æå¡ï¼è®¢åæäº¤åï¼çµè´¹å°äº0 - 72 å°æ¶å
å°è´¦ï¼è¥æªè½ææ¶å°è´¦ï¼ç³»ç»å°èªå¨åèµ·éæ¬¾ã', |
| | | 'å
弿é´ï¼è¥åä¸è´¦æ·çå
弿¬¾æªå°è´¦ï¼è¯·å¿å¨å
¶ä»å¹³å°éå¤å
å¼ï¼å ä¸è¿°æä½å¯¼è´çèµéæå¤±ï¼ç±ç¨æ·èªè¡æ¿æ
ã', |
| | | '为确ä¿å
å¼é¡ºå©è¿è¡ï¼ç®åå¹³å°ä¸æ¯æå¯¹æ¬ 款éé¢è¶
è¿1000å
çè´¦æ·è¿è¡å
å¼ï¼ä¸æ¯æ¬¡å
å¼éé¢å¿
é¡»é«äºæ¬ è´¹æ»é¢ã', |
| | | '妿¥å°éçæ¥çµï¼å¯¹æ¹ä»¥ç¼´è´¹æè¯¯æä½ççç±è¦æ±å¤ç款项ï¼å¡å¿
ç«å³æé»ï¼è°¨é²è¯éªã', |
| | | 'ä¸åæ¶ï¼è¯·æ¨å¡å¿
å确填å宿´ççå¸åæ·å·ä¿¡æ¯ãå
å¼å®æåï¼å票ç±è¿è¥åæä¾ï¼æ¨å¯ç»å½ç½ä¸è¥ä¸å
ä¸è½½å¯¹åºççµåå票ã', |
| | | CustomerServiceTips, |
| | | ]; |
| | | |
| | | const confirmDialogVisible = ref(false); |
| | | |
| | | function recharge() { |
| | | confirmDialogVisible.value = true; |
| | | } |
| | | |
| | | async function goPay() { |
| | | try { |
| | | let params: LifeElectricDataCreateLifePayOrderInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | productData: { |
| | | parValue: props.isDev ? 0.1 : form.parValue, |
| | | electricType: form.electricType, |
| | | electricAccountType: form.electricAccountType, |
| | | electricAccount: form.electricAccount, |
| | | province: form.province, |
| | | city: form.city, |
| | | sixID: form.sixID, |
| | | }, |
| | | }; |
| | | let res = await blLifeRecharge.services.createLifePayElectricOrder(params); |
| | | emit('goPay', res.orderNo); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| | |
| | | } |
| | | |
| | | getRechargeParValue(amount: number | string, rate: number) { |
| | | return (Number(amount) * rate).toFixed(2); |
| | | return ((Number(amount) * rate) / 100).toFixed(2); |
| | | } |
| | | |
| | | MaxParValue = 300; |
| | |
| | | export namespace LifeRechargeConstants { |
| | | export enum LifePayRateTypeEnum { |
| | | 'é»è®¤è¯è´¹ææ£' = 10, |
| | | 'é»è®¤çµè´¹ææ£' = 10, |
| | | 'é»è®¤çµè´¹ææ£' = 20, |
| | | |
| | | é»è®¤çæ°ææ£ = 30, |
| | | |
| | | ä¾åºåææ£ä»· = 40, |
| | | } |
| | | |
| | | export enum LifePayTypeEnum { |
| | |
| | | export enum LifePayOrderTypeEnum { |
| | | è¯è´¹è®¢å = 10, |
| | | çµè´¹è®¢å = 20, |
| | | çæ°è®¢å = 30, |
| | | } |
| | | |
| | | export enum LifePayStatusEnum { |
| | |
| | | [ElectricAccountType.shop]: 'åºéº', |
| | | [ElectricAccountType.nanwashopng]: 'åºéº-ä¸å»ºè®®ä½¿ç¨', |
| | | }; |
| | | |
| | | export enum GasOrgCodeEnum { |
| | | ä¸å½çæ° = 'zhong_guo', |
| | | æ°å¥¥çæ° = 'xin_ao', |
| | | åæ¶¦çæ° = 'hua_run', |
| | | 港åçæ° = 'gang_hua', |
| | | ä¸ççæ° = 'zhong_ran', |
| | | åäº¬çæ° = 'bei_jing', |
| | | } |
| | | |
| | | export const GasOrgCodeEnumText = { |
| | | [GasOrgCodeEnum.ä¸å½çæ°]: 'ä¸å½çæ°', |
| | | [GasOrgCodeEnum.æ°å¥¥çæ°]: 'æ°å¥¥çæ°', |
| | | [GasOrgCodeEnum.åæ¶¦çæ°]: 'åæ¶¦çæ°', |
| | | [GasOrgCodeEnum.港åçæ°]: '港åçæ°', |
| | | [GasOrgCodeEnum.ä¸ççæ°]: 'ä¸ççæ°', |
| | | [GasOrgCodeEnum.åäº¬çæ°]: 'åäº¬çæ°', |
| | | }; |
| | | } |
| | |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åæçå
¨é¨æ·å·å表 POST /api/LifePay/GetUserAccountAllList */ |
| | | async getUserAccountAllList(body: QueryUserAccountAllListInput, options?: RequestConfig) { |
| | | return this.request<UserAccountListOutput[]>('/api/LifePay/GetUserAccountAllList', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** æ·»å æä¿®æ¹æçæ·å· POST /api/LifePay/AddUpdateUserAccount */ |
| | | async addUpdateUserAccount(body: AddUpdateUserAccountInput, options?: RequestConfig) { |
| | | return this.request<number>('/api/LifePay/AddUpdateUserAccount', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** åå»ºçæ´»ç¼´è´¹çæ°è®¢å POST /api/LifePay/CreateLifePayGasOrder */ |
| | | async createLifePayGasOrder(body: LifeGasDataCreateLifePayOrderInput, options?: RequestConfig) { |
| | | return this.request<CreateLifePayOrderOutput>('/api/LifePay/CreateLifePayGasOrder', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åçæ°é¢å¼ GET /api/LifePay/GetGasParValue */ |
| | | async getGasParValue(options?: RequestConfig) { |
| | | return this.request<GasParValueResponse>('/api/LifePay/GetGasParValue', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | } |
| | | |
| | | export interface PhoneMesssageCodeLoginInput { |
| | |
| | | timeExpire?: string; |
| | | message?: string; |
| | | } |
| | | |
| | | export interface QueryUserAccountAllListInput { |
| | | /** ç¨æ·Id */ |
| | | userId?: string; |
| | | lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum; |
| | | } |
| | | |
| | | export interface UserAccountListOutput { |
| | | id?: string; |
| | | lifePayType?: LifeRechargeConstants.LifePayOrderTypeEnum; |
| | | /** è¿è¥å */ |
| | | operators?: string; |
| | | /** ææºå·/æ·å· */ |
| | | content?: string; |
| | | /** ç */ |
| | | province?: string; |
| | | /** å¸ */ |
| | | city?: string; |
| | | /** æå±å段ï¼çµè´¹ç±»åï¼ */ |
| | | extraProperties?: string; |
| | | /** 夿³¨ */ |
| | | remark?: string; |
| | | /** å建æ¶é´ */ |
| | | creationTime?: string; |
| | | isDeleted?: boolean; |
| | | } |
| | | |
| | | export interface AddUpdateUserAccountInput { |
| | | id?: string; |
| | | /** ç¨æ·ç¼å· */ |
| | | userId?: string; |
| | | lifePayType?: LifeRechargeConstants.LifePayOrderTypeEnum; |
| | | /** è¿è¥å */ |
| | | operators?: string; |
| | | /** ææºå·/æ·å· */ |
| | | content?: string; |
| | | /** ç */ |
| | | province?: string; |
| | | /** å¸ */ |
| | | city?: string; |
| | | /** æå±å段ï¼çµè´¹ç±»åï¼ */ |
| | | extraProperties?: string; |
| | | /** 夿³¨ */ |
| | | remark?: string; |
| | | } |
| | | |
| | | export interface LifeGasDataCreateLifePayOrderInput { |
| | | userId?: string; |
| | | productData?: LifeGasData; |
| | | } |
| | | |
| | | export interface LifeGasData { |
| | | /** å
å¼é¢é¢ï¼åä½ä¸ºå
ã */ |
| | | parValue: number; |
| | | /** å¤©ç¶æ°å
¬å¸ç±»åï¼"zhong_ran"代表ä¸ççæ°ï¼"bei_jing"代表åäº¬çæ°ã */ |
| | | gasOrgType: string; |
| | | /** çæ°æ·å· */ |
| | | gasAccount: string; |
| | | /** ç份 */ |
| | | province: string; |
| | | /** åå¸ */ |
| | | city?: string; |
| | | } |
| | | |
| | | export interface GasParValueResponse { |
| | | success?: boolean; |
| | | requestNo?: string; |
| | | partnerId?: string; |
| | | service?: string; |
| | | version?: string; |
| | | protocol?: string; |
| | | context?: string; |
| | | ext?: any; |
| | | code?: string; |
| | | message?: string; |
| | | detail?: string; |
| | | gasParValue?: GasParValueOutput; |
| | | } |
| | | |
| | | export interface GasParValueOutput { |
| | | gasOrgName?: string; |
| | | gasOrgCode?: string; |
| | | parValue?: string[]; |
| | | rate?: number; |
| | | comments?: string; |
| | | } |
| | |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** æ·»å æä¿®æ¹æçæ·å· POST /api/LifePay/AddUpdateUserAccount */ |
| | | export async function addUpdateUserAccount( |
| | | body: API.AddUpdateUserAccountInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/AddUpdateUserAccount', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** ææ£é
ç½® POST /api/LifePay/CreateEditLifePayRate */ |
| | | export async function createEditLifePayRate( |
| | | body: API.LifePayRateInput[], |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/CreateEditLifePayRate', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** æ¸ é管ç POST /api/LifePay/CreateEditPayChannels */ |
| | | export async function createEditPayChannels( |
| | | body: API.CreateEditPayChannelsInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/CreateEditPayChannels', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** åå»ºçæ´»ç¼´è´¹çµè´¹è®¢å POST /api/LifePay/CreateLifePayElectricOrder */ |
| | | export async function createLifePayElectricOrder( |
| | | body: API.LifeElectricDataCreateLifePayOrderInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** åå»ºçæ´»ç¼´è´¹çæ°è®¢å POST /api/LifePay/CreateLifePayGasOrder */ |
| | | export async function createLifePayGasOrder( |
| | | body: API.LifeGasDataCreateLifePayOrderInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.CreateLifePayOrderOutput>('/api/LifePay/CreateLifePayGasOrder', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** åå»ºçæ´»ç¼´è´¹è¯è´¹è®¢å POST /api/LifePay/CreateLifePayPhoneOrder */ |
| | | export async function createLifePayPhoneOrder( |
| | | body: API.LifePhoneDataCreateLifePayOrderInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æçæ·å· POST /api/LifePay/DeleteUserAccount */ |
| | | export async function deleteUserAccount( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIdeleteUserAccountParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/DeleteUserAccount', { |
| | | method: 'POST', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åç¨æ·æ·å·åé¡µæ°æ® POST /api/LifePay/GetAccountPage */ |
| | | export async function getAccountPage( |
| | | body: API.QueryUserAccountListInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.UserAccountListOutputPageOutput>('/api/LifePay/GetAccountPage', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åçµè´¹é¢å¼ GET /api/LifePay/GetElectricParValue */ |
| | | export async function getElectricParValue(options?: API.RequestConfig) { |
| | | return request<API.ElectricParValueResponse>('/api/LifePay/GetElectricParValue', { |
| | |
| | | }); |
| | | } |
| | | |
| | | /** è·åçæ°æ¯æåæ· GET /api/LifePay/GetGasOrgType */ |
| | | export async function getGasOrgType(options?: API.RequestConfig) { |
| | | return request<API.GasOrgTypeValueResponse>('/api/LifePay/GetGasOrgType', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åçæ°é¢å¼ GET /api/LifePay/GetGasParValue */ |
| | | export async function getGasParValue(options?: API.RequestConfig) { |
| | | return request<API.GasParValueResponse>('/api/LifePay/GetGasParValue', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åæ¸ é详æ
GET /api/LifePay/GetLifePayChannlesDto */ |
| | | export async function getLifePayChannlesDto( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIgetLifePayChannlesDtoParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.CreateEditPayChannelsInput>('/api/LifePay/GetLifePayChannlesDto', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åç¼´è´¹æ¸ éå表 POST /api/LifePay/GetLifePayChannlesPage */ |
| | | export async function getLifePayChannlesPage(body: API.PageInput, options?: API.RequestConfig) { |
| | | return request<API.CreateEditPayChannelsInputPageOutput>('/api/LifePay/GetLifePayChannlesPage', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·å订ååé¡µæ°æ® POST /api/LifePay/GetLifePayOrderPage */ |
| | | export async function getLifePayOrderPage( |
| | | body: API.QueryLifePayOrderListInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** æ¤å¤å端没ææä¾æ³¨é POST /api/LifePay/GetLifePayOrderPageExport */ |
| | | export async function getLifePayOrderPageExport( |
| | | body: API.QueryLifePayOrderListInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<any>('/api/LifePay/GetLifePayOrderPageExport', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·å微信æ¯ä»çJSAPI POST /api/LifePay/GetPayOrderForJsAPI */ |
| | | export async function getPayOrderForJsAPI( |
| | | body: API.GetPayOrderForJsAPIInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** è·åæçå
¨é¨æ·å·å表 POST /api/LifePay/GetUserAccountAllList */ |
| | | export async function getUserAccountAllList( |
| | | body: API.QueryUserAccountAllListInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.UserAccountListOutput[]>('/api/LifePay/GetUserAccountAllList', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åæçæ·å·å表 POST /api/LifePay/GetUserAccountList */ |
| | | export async function getUserAccountList( |
| | | body: API.QueryUserAccountListInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.UserAccountListOutputPageOutput>('/api/LifePay/GetUserAccountList', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åæç订ååé¡µæ°æ® POST /api/LifePay/GetUserLifePayOrderPage */ |
| | | export async function getUserLifePayOrderPage( |
| | | body: API.QueryLifePayOrderListInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** ç¨æ·æ¥ççæ´»ç¼´è´¹é款失败详æ
GET /api/LifePay/GetUserLifePayOrderRefund */ |
| | | export async function getUserLifePayOrderRefund( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIgetUserLifePayOrderRefundParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.UserLifePayOrderRefundOutput>('/api/LifePay/GetUserLifePayOrderRefund', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åç¨æ·åé¡µæ°æ® POST /api/LifePay/GetUserPage */ |
| | | export async function getUserPage(body: API.PageInput, options?: API.RequestConfig) { |
| | | return request<API.UserListOutputPageOutput>('/api/LifePay/GetUserPage', { |
| | |
| | | }); |
| | | } |
| | | |
| | | /** ç¨æ·åèµ·çæ´»ç¼´è´¹é款 POST /api/LifePay/RefundUserLifePayOrder */ |
| | | export async function refundUserLifePayOrder( |
| | | body: API.RefundUserLifePayOrderInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/RefundUserLifePayOrder', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 鿬¾é©³å POST /api/LifePay/RejectRefundLifePayOrder */ |
| | | export async function rejectRefundLifePayOrder( |
| | | body: API.RefundLifePayOrderInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/RejectRefundLifePayOrder', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è®¾ç½®æ¸ éå¯ç¨ç¶æ GET /api/LifePay/SetLifePayChannelsStatus */ |
| | | export async function setLifePayChannelsStatus( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIsetLifePayChannelsStatusParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePay/SetLifePayChannelsStatus', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è®¾ç½®çæ´»ç¼´è´¹æ¯ä»ç±»å POST /api/LifePay/SetLifePayOrderPayType */ |
| | | export async function setLifePayOrderPayType( |
| | | body: API.SetLifePayOrderPayTypeInput, |
| | |
| | | jobType?: string; |
| | | } |
| | | |
| | | interface AddUpdateUserAccountInput { |
| | | id?: string; |
| | | /** ç¨æ·ç¼å· */ |
| | | userId?: string; |
| | | lifePayType?: LifePayOrderTypeEnum; |
| | | /** è¿è¥å */ |
| | | operators: string; |
| | | /** ææºå·/æ·å· */ |
| | | content?: string; |
| | | /** ç */ |
| | | province?: string; |
| | | /** å¸ */ |
| | | city?: string; |
| | | /** æå±å段ï¼çµè´¹ç±»åï¼ */ |
| | | extraProperties?: string; |
| | | /** 夿³¨ */ |
| | | remark?: string; |
| | | } |
| | | |
| | | interface AddUserCertificationAuditDto { |
| | | id?: string; |
| | | auditNo?: string; |
| | |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteUserAccountParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteUserParams { |
| | | id?: string; |
| | | } |
| | |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIgetLifePayChannlesDtoParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIgetLifePayWxIndentityParams { |
| | | /** ç¨æ·ç»å½åè¯ */ |
| | | code?: string; |
| | |
| | | userId?: string; |
| | | } |
| | | |
| | | interface APIgetUserLifePayOrderRefundParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIgetUserListByPhoneNumberParams { |
| | | phoneNumber?: string; |
| | | clientId?: string; |
| | |
| | | permissionName?: string; |
| | | } |
| | | |
| | | interface APIsetLifePayChannelsStatusParams { |
| | | id?: string; |
| | | status?: LifePayChannelsStatsEnum; |
| | | } |
| | | |
| | | interface APIsetMessageIsReadParams { |
| | | id?: string; |
| | | } |
| | |
| | | status?: CooperationApplyStatusEnum; |
| | | } |
| | | |
| | | interface CreateEditPayChannelsInput { |
| | | id?: string; |
| | | channlesName?: string; |
| | | channlesNum?: string; |
| | | channlesRate?: number; |
| | | switchType?: LifePaySwitchTypeEnum; |
| | | status?: LifePayChannelsStatsEnum; |
| | | channlesType?: LifePayChannlesTypeEnum; |
| | | } |
| | | |
| | | interface CreateEditPayChannelsInputPageOutput { |
| | | pageModel?: Pagination; |
| | | objectData?: any; |
| | | data?: CreateEditPayChannelsInput[]; |
| | | } |
| | | |
| | | interface CreateInformationAdvertiseInput { |
| | | /** 对å¤è系人 */ |
| | | outerContacter?: string; |
| | |
| | | charset?: string; |
| | | } |
| | | |
| | | interface GasOrgTypeValueResponse { |
| | | success?: boolean; |
| | | requestNo?: string; |
| | | partnerId?: string; |
| | | service?: string; |
| | | version?: string; |
| | | protocol?: string; |
| | | context?: string; |
| | | ext?: any; |
| | | code?: string; |
| | | message?: string; |
| | | detail?: string; |
| | | gasSupportMerchantInfos?: GasSupportMerchantInfos[]; |
| | | } |
| | | |
| | | interface GasParValueOutput { |
| | | gasOrgName?: string; |
| | | gasOrgCode?: string; |
| | | parValue?: string[]; |
| | | rate?: number; |
| | | comments?: string; |
| | | } |
| | | |
| | | interface GasParValueResponse { |
| | | success?: boolean; |
| | | requestNo?: string; |
| | | partnerId?: string; |
| | | service?: string; |
| | | version?: string; |
| | | protocol?: string; |
| | | context?: string; |
| | | ext?: any; |
| | | code?: string; |
| | | message?: string; |
| | | detail?: string; |
| | | gasParValue?: GasParValueOutput; |
| | | } |
| | | |
| | | interface GasSupportMerchantInfos { |
| | | gasOrgTypeCode?: string; |
| | | gasOrgTypeName?: string; |
| | | } |
| | | |
| | | interface GeAlltCompanyUsersInput { |
| | | /** å åï¼0å
¶ä»ï¼1ç级ï¼2å¸çº§ï¼3åºå¿çº§ */ |
| | | namingType?: number; |
| | |
| | | |
| | | interface LifeElectricDataCreateLifePayOrderInput { |
| | | userId?: string; |
| | | /** æ¸ éId */ |
| | | channelId?: string; |
| | | productData?: LifeElectricData; |
| | | } |
| | | |
| | | interface LifeGasData { |
| | | /** å
å¼é¢é¢ï¼åä½ä¸ºå
ã */ |
| | | parValue: number; |
| | | /** å¤©ç¶æ°å
¬å¸ç±»åï¼"zhong_ran"代表ä¸ççæ°ï¼"bei_jing"代表åäº¬çæ°ã */ |
| | | gasOrgType: string; |
| | | /** çæ°æ·å· */ |
| | | gasAccount: string; |
| | | /** ç份 */ |
| | | province: string; |
| | | /** åå¸ */ |
| | | city?: string; |
| | | } |
| | | |
| | | interface LifeGasDataCreateLifePayOrderInput { |
| | | userId?: string; |
| | | /** æ¸ éId */ |
| | | channelId?: string; |
| | | productData?: LifeGasData; |
| | | } |
| | | |
| | | type LifePayChannelsStatsEnum = 10 | 20; |
| | | |
| | | type LifePayChannlesTypeEnum = 10 | 20; |
| | | |
| | | interface LifePayOrderListOutput { |
| | | id?: string; |
| | | userId?: string; |
| | |
| | | refundCredentialsImgUrl?: string; |
| | | /** ä¸åæ¶é´ */ |
| | | creationTime?: string; |
| | | /** 鿬¾æ¶é´ */ |
| | | refundTime?: string; |
| | | refundApplyRemark?: string; |
| | | refundCheckRemark?: string; |
| | | acoolyOrderNo?: string; |
| | | } |
| | | |
| | | interface LifePayOrderListOutputPageOutput { |
| | |
| | | data?: LifePayOrderListOutput[]; |
| | | } |
| | | |
| | | type LifePayOrderStatusEnum = 10 | 20 | 30; |
| | | type LifePayOrderStatusEnum = 10 | 20 | 30 | 40 | 50 | 60; |
| | | |
| | | type LifePayOrderTypeEnum = 10 | 20; |
| | | type LifePayOrderTypeEnum = 10 | 20 | 30; |
| | | |
| | | interface LifePayPhoneMesssageCodeLoginInput { |
| | | /** ææºå· */ |
| | | phoneNumber: string; |
| | | } |
| | | |
| | | interface LifePayRateInput { |
| | | rateType?: LifePayRateTypeEnum; |
| | | rate?: number; |
| | | id?: string; |
| | | } |
| | | |
| | | interface LifePayRateListOutput { |
| | | rateType?: LifePayRateTypeEnum; |
| | | rate?: number; |
| | | id?: string; |
| | | } |
| | | |
| | | type LifePayRateTypeEnum = 10 | 20; |
| | | type LifePayRateTypeEnum = 10 | 20 | 30 | 40; |
| | | |
| | | type LifePayStatusEnum = 10 | 20 | 30 | 40; |
| | | |
| | | type LifePaySwitchTypeEnum = 10 | 20 | 30; |
| | | |
| | | type LifePayTypeEnum = 10 | 20; |
| | | |
| | | interface LifePhoneData { |
| | |
| | | |
| | | interface LifePhoneDataCreateLifePayOrderInput { |
| | | userId?: string; |
| | | /** æ¸ éId */ |
| | | channelId?: string; |
| | | productData?: LifePhoneData; |
| | | } |
| | | |
| | |
| | | interface QueryLifePayOrderListInput { |
| | | pageModel?: Pagination; |
| | | lifePayOrderType?: LifePayOrderTypeEnum; |
| | | lifePayType?: LifePayTypeEnum; |
| | | /** å¼å§æ¯ä»æ¶é´ */ |
| | | beginPayTime?: string; |
| | | /** ç»ææ¯ä»æ¶é´ */ |
| | |
| | | endFinishTime?: string; |
| | | /** ç¨æ·Id */ |
| | | userId?: string; |
| | | /** æç´¢å
³é®è¯ */ |
| | | keyWords?: string; |
| | | } |
| | | |
| | | interface QueryMatchMakingApplyByOrderInput { |
| | |
| | | orderUserId?: string; |
| | | } |
| | | |
| | | interface QueryUserAccountAllListInput { |
| | | /** ç¨æ·Id */ |
| | | userId?: string; |
| | | lifePayOrderType?: LifePayOrderTypeEnum; |
| | | } |
| | | |
| | | interface QueryUserAccountListInput { |
| | | pageModel?: Pagination; |
| | | /** ç¨æ·Id */ |
| | | userId?: string; |
| | | lifePayOrderType?: LifePayOrderTypeEnum; |
| | | } |
| | | |
| | | interface QueryUserCertificationAuditListInput { |
| | | pageModel?: Pagination; |
| | | /** ä¼ä¸åç§° */ |
| | |
| | | interface RefundLifePayOrderInput { |
| | | id?: string; |
| | | refundCredentialsImgUrl?: string; |
| | | refundCheckRemark?: string; |
| | | } |
| | | |
| | | interface RefundOrderContactSignInput { |
| | |
| | | orderSignId?: string; |
| | | } |
| | | |
| | | interface RefundUserLifePayOrderInput { |
| | | id?: string; |
| | | /** ç¨æ·Id */ |
| | | userId?: string; |
| | | refundApplyRemark?: string; |
| | | } |
| | | |
| | | interface RegisterDto { |
| | | extraProperties?: Record<string, any>; |
| | | userName: string; |
| | |
| | | staffCount?: number; |
| | | } |
| | | |
| | | interface UserAccountListOutput { |
| | | id?: string; |
| | | lifePayType?: LifePayOrderTypeEnum; |
| | | /** è¿è¥å */ |
| | | operators?: string; |
| | | /** ææºå·/æ·å· */ |
| | | content?: string; |
| | | /** ç */ |
| | | province?: string; |
| | | /** å¸ */ |
| | | city?: string; |
| | | /** æå±å段ï¼çµè´¹ç±»åï¼ */ |
| | | extraProperties?: string; |
| | | /** 夿³¨ */ |
| | | remark?: string; |
| | | /** å建æ¶é´ */ |
| | | creationTime?: string; |
| | | isDeleted?: boolean; |
| | | } |
| | | |
| | | interface UserAccountListOutputPageOutput { |
| | | pageModel?: Pagination; |
| | | objectData?: any; |
| | | data?: UserAccountListOutput[]; |
| | | } |
| | | |
| | | interface UserAttentionsDto { |
| | | /** 产åå
³æ³¨æ° */ |
| | | productCount?: number; |
| | |
| | | creationTime?: string; |
| | | /** 鿬¾æ¶é´ */ |
| | | refundTime?: string; |
| | | /** 鿬¾åè¯ */ |
| | | refundCredentialsImgUrl?: string; |
| | | refundApplyRemark?: string; |
| | | refundCheckRemark?: string; |
| | | /** æ¸ éæµæ°´å· */ |
| | | acoolyOrderNo?: string; |
| | | } |
| | | |
| | | interface UserLifePayOrderOutputPageOutput { |
| | |
| | | data?: UserLifePayOrderOutput[]; |
| | | } |
| | | |
| | | interface UserLifePayOrderRefundOutput { |
| | | /** 订åç¼å· */ |
| | | id?: string; |
| | | /** 订åå· */ |
| | | orderNo?: string; |
| | | /** 鿬¾åå */ |
| | | refundApplyRemark?: string; |
| | | /** åå°å¡«åç驳ååå */ |
| | | refundCheckRemark?: string; |
| | | lifePayOrderStatus?: LifePayOrderStatusEnum; |
| | | } |
| | | |
| | | interface UserListOutput { |
| | | id?: string; |
| | | /** ç¨æ·ææºå· */ |