From f2025539d8bf4798b90a5ab8a47c5a379ab68e9b Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 11 三月 2025 17:51:43 +0800 Subject: [PATCH] fix: 二期需求 --- packages/components/src/views/electricBillRecharge/electricBillRecharge.vue | 260 ------ packages/components/src/components/Card/AccountAddCard.vue | 10 apps/taro/src/subpackages/recharge/gasBillRecharge/InnerPage.vue | 20 packages/components/src/views/electricBillRecharge/ElectricBillRechargeBaseForm.vue | 128 +++ packages/components/src/views/GasBillRecharge/GasBillRechargeStep1.vue | 37 + packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep1.vue | 63 + packages/components/src/components/RechargeTipsView/RechargeTipsView.vue | 4 packages/components/src/views/GasBillRecharge/GasBillRechargeStep2.vue | 74 ++ packages/core/src/lifeRecharge.ts | 2 packages/components/src/index.ts | 1 packages/core/src/lifeRechargeConstants.ts | 25 packages/components/src/styles/index.scss | 1 packages/components/src/views/GasBillRecharge/GasOrgTypeCard.vue | 20 packages/components/src/styles/rechargeGrid.scss | 4 packages/services/api/LifePay.ts | 238 ++++++ packages/components/src/views/PhoneBillRecharge/context.ts | 7 packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue | 51 + packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue | 244 ++++++ packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue | 249 ++++++ packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue | 67 + packages/services/api/typings.d.ts | 211 +++++ packages/components/src/views/GasBillRecharge/context.ts | 27 packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep1.vue | 84 ++ packages/core/src/lifeRechargeServices.ts | 130 +++ packages/components/src/views/electricBillRecharge/context.ts | 37 + packages/components/src/hooks/index.ts | 142 +++ packages/components/src/views/GasBillRecharge/GasBillRecharge.vue | 51 + packages/components/src/styles/gas.scss | 24 28 files changed, 1,915 insertions(+), 296 deletions(-) diff --git a/apps/taro/src/subpackages/recharge/gasBillRecharge/InnerPage.vue b/apps/taro/src/subpackages/recharge/gasBillRecharge/InnerPage.vue index 81c8793..beeabad 100644 --- a/apps/taro/src/subpackages/recharge/gasBillRecharge/InnerPage.vue +++ b/apps/taro/src/subpackages/recharge/gasBillRecharge/InnerPage.vue @@ -1,13 +1,23 @@ <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> diff --git a/packages/components/src/components/Card/AccountAddCard.vue b/packages/components/src/components/Card/AccountAddCard.vue index d0e1d5b..77465f3 100644 --- a/packages/components/src/components/Card/AccountAddCard.vue +++ b/packages/components/src/components/Card/AccountAddCard.vue @@ -1,5 +1,5 @@ <template> - <div class="account-add-card"><Uploader /> 鏂板鎵嬫満鍙�</div> + <div class="account-add-card"><Uploader /> {{ text }}</div> </template> <script setup lang="ts"> @@ -8,4 +8,12 @@ defineOptions({ name: 'AccountAddCard', }); + +type Props = { + text?: string; +}; + +const props = withDefaults(defineProps<Props>(), { + text: '鏂板鎵嬫満鍙�', +}); </script> diff --git a/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue b/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue index ac45de4..294e782 100644 --- a/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue +++ b/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue @@ -3,7 +3,9 @@ <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"> diff --git a/packages/components/src/hooks/index.ts b/packages/components/src/hooks/index.ts index 1849770..6862870 100644 --- a/packages/components/src/hooks/index.ts +++ b/packages/components/src/hooks/index.ts @@ -7,8 +7,12 @@ 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'; @@ -28,20 +32,28 @@ () => 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, }; } @@ -127,3 +139,127 @@ 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, + }; +} diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 5806c92..dd86493 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -1,6 +1,7 @@ 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'; diff --git a/packages/components/src/styles/gas.scss b/packages/components/src/styles/gas.scss new file mode 100644 index 0000000..3687334 --- /dev/null +++ b/packages/components/src/styles/gas.scss @@ -0,0 +1,24 @@ +@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'); + } + } +} diff --git a/packages/components/src/styles/index.scss b/packages/components/src/styles/index.scss index 2e31249..e51f71f 100644 --- a/packages/components/src/styles/index.scss +++ b/packages/components/src/styles/index.scss @@ -3,6 +3,7 @@ @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 *; diff --git a/packages/components/src/styles/rechargeGrid.scss b/packages/components/src/styles/rechargeGrid.scss index 861eedf..8695d25 100644 --- a/packages/components/src/styles/rechargeGrid.scss +++ b/packages/components/src/styles/rechargeGrid.scss @@ -128,6 +128,10 @@ margin-left: 20px; } } + + &.nut-button--plain { + border-width: 1px; + } } &.electric { diff --git a/packages/components/src/views/GasBillRecharge/GasBillRecharge.vue b/packages/components/src/views/GasBillRecharge/GasBillRecharge.vue new file mode 100644 index 0000000..475fb43 --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/GasBillRecharge.vue @@ -0,0 +1,51 @@ +<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> diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue new file mode 100644 index 0000000..f29dc02 --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue @@ -0,0 +1,51 @@ +<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> diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep1.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep1.vue new file mode 100644 index 0000000..e863bf0 --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep1.vue @@ -0,0 +1,37 @@ +<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> diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep2.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep2.vue new file mode 100644 index 0000000..9c7dd98 --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep2.vue @@ -0,0 +1,74 @@ +<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> diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue new file mode 100644 index 0000000..cc6068c --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue @@ -0,0 +1,244 @@ +<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 灏忔椂鍐呭埌璐︼紝鑻ユ湭鑳芥寜鏃跺埌璐︼紝绯荤粺灏嗚嚜鍔ㄥ彂璧烽��娆俱��', + '鐩墠骞冲彴浠呮敮鎸佷腑鍥界噧姘斿拰鍖椾含鐕冩皵鍏呭�兼湇鍔°��', + '涓浗鐕冩皵鍏呭�兼埛鍙峰繀椤诲湪鈥滃9鍝佹収鈥滱PP鐕冩皵缂磋垂鐣岄潰鏌ヨ鍒拌处鎴蜂俊鎭紝鎴峰彿涓�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> diff --git a/packages/components/src/views/GasBillRecharge/GasOrgTypeCard.vue b/packages/components/src/views/GasBillRecharge/GasOrgTypeCard.vue new file mode 100644 index 0000000..49dbdf4 --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/GasOrgTypeCard.vue @@ -0,0 +1,20 @@ +<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> diff --git a/packages/components/src/views/GasBillRecharge/context.ts b/packages/components/src/views/GasBillRecharge/context.ts new file mode 100644 index 0000000..a3300ca --- /dev/null +++ b/packages/components/src/views/GasBillRecharge/context.ts @@ -0,0 +1,27 @@ +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; +}; diff --git a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep1.vue b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep1.vue index 9afa13b..ca42ed0 100644 --- a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep1.vue +++ b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep1.vue @@ -1,9 +1,23 @@ <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> @@ -11,30 +25,16 @@ </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', @@ -44,6 +44,7 @@ ispCode: '', phone: '', name: '', + remark: '', }); const { goToNext } = usePhoneBillRechargeContext(); @@ -54,8 +55,26 @@ 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> diff --git a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue index 333f782..73fd93e 100644 --- a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue +++ b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue @@ -6,21 +6,33 @@ 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> @@ -43,7 +55,7 @@ {{ blLifeRecharge.getRechargeParValue(item, lifePayPhoneRate) }}鍏� </div> </div> - <div class="discountTag">{{ lifePayPhoneRate * 100 }}鎶�</div> + <div class="discountTag">{{ lifePayPhoneRate }}鎶�</div> </div> </NutRadio> </NutRadioGroup> @@ -89,10 +101,11 @@ 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', @@ -106,14 +119,37 @@ 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; @@ -130,7 +166,7 @@ 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; } } @@ -146,6 +182,7 @@ parValue: [ { required: true, message: '璇烽�夋嫨鍏呭�奸噾棰�', validator: FormValidator.validatorNumberNotNull }, ], + currentUserAccountId: [{ required: true, message: '璇烽�夋嫨鍏呭�兼墜鏈哄彿' }], }); const formRef = ref<any>(null); diff --git a/packages/components/src/views/PhoneBillRecharge/context.ts b/packages/components/src/views/PhoneBillRecharge/context.ts index 7dff77c..48d3ffa 100644 --- a/packages/components/src/views/PhoneBillRecharge/context.ts +++ b/packages/components/src/views/PhoneBillRecharge/context.ts @@ -25,3 +25,10 @@ export function usePhoneBillRechargeContext() { return inject(PhoneBillRechargeContextKey); } + +export type PhoneUserAccountExtraProperties = { + ispCode: string; + phone: string; + name: string; + remark: string; +}; diff --git a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeBaseForm.vue b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeBaseForm.vue new file mode 100644 index 0000000..796693c --- /dev/null +++ b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeBaseForm.vue @@ -0,0 +1,128 @@ +<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> diff --git a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep1.vue b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep1.vue new file mode 100644 index 0000000..e14cef1 --- /dev/null +++ b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep1.vue @@ -0,0 +1,84 @@ +<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> diff --git a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue new file mode 100644 index 0000000..1bc4f9c --- /dev/null +++ b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue @@ -0,0 +1,249 @@ +<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> diff --git a/packages/components/src/views/electricBillRecharge/context.ts b/packages/components/src/views/electricBillRecharge/context.ts new file mode 100644 index 0000000..3c3488d --- /dev/null +++ b/packages/components/src/views/electricBillRecharge/context.ts @@ -0,0 +1,37 @@ +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; +}; diff --git a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue index 96ee990..e982c54 100644 --- a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue +++ b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue @@ -1,151 +1,18 @@ <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', @@ -163,105 +30,10 @@ (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> diff --git a/packages/core/src/lifeRecharge.ts b/packages/core/src/lifeRecharge.ts index cb24d72..aa8c8e6 100644 --- a/packages/core/src/lifeRecharge.ts +++ b/packages/core/src/lifeRecharge.ts @@ -43,7 +43,7 @@ } getRechargeParValue(amount: number | string, rate: number) { - return (Number(amount) * rate).toFixed(2); + return ((Number(amount) * rate) / 100).toFixed(2); } MaxParValue = 300; diff --git a/packages/core/src/lifeRechargeConstants.ts b/packages/core/src/lifeRechargeConstants.ts index 87bb7be..f052615 100644 --- a/packages/core/src/lifeRechargeConstants.ts +++ b/packages/core/src/lifeRechargeConstants.ts @@ -1,7 +1,11 @@ export namespace LifeRechargeConstants { export enum LifePayRateTypeEnum { '榛樿璇濊垂鎶樻墸' = 10, - '榛樿鐢佃垂鎶樻墸' = 10, + '榛樿鐢佃垂鎶樻墸' = 20, + + 榛樿鐕冩皵鎶樻墸 = 30, + + 渚涘簲鍟嗘姌鎵d环 = 40, } export enum LifePayTypeEnum { @@ -12,6 +16,7 @@ export enum LifePayOrderTypeEnum { 璇濊垂璁㈠崟 = 10, 鐢佃垂璁㈠崟 = 20, + 鐕冩皵璁㈠崟 = 30, } export enum LifePayStatusEnum { @@ -76,4 +81,22 @@ [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.鍖椾含鐕冩皵]: '鍖椾含鐕冩皵', + }; } diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts index 69c431f..865a7e2 100644 --- a/packages/core/src/lifeRechargeServices.ts +++ b/packages/core/src/lifeRechargeServices.ts @@ -156,6 +156,50 @@ ...(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 { @@ -392,3 +436,89 @@ 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"浠h〃涓噧鐕冩皵锛�"bei_jing"浠h〃鍖椾含鐕冩皵銆� */ + 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; +} diff --git a/packages/services/api/LifePay.ts b/packages/services/api/LifePay.ts index 0808f78..af5b26a 100644 --- a/packages/services/api/LifePay.ts +++ b/packages/services/api/LifePay.ts @@ -2,6 +2,51 @@ // @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, @@ -17,12 +62,57 @@ }); } +/** 鍒涘缓鐢熸椿缂磋垂鐕冩皵璁㈠崟 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, options?: API.RequestConfig ) { return request<API.CreateLifePayOrderOutput>('/api/LifePay/CreateLifePayPhoneOrder', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 鍒犻櫎鎴戠殑鎴峰彿 POST /api/LifePay/DeleteUserAccount */ +export async function deleteUserAccount( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟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', @@ -48,12 +138,70 @@ }); } +/** 鑾峰彇鐕冩皵鏀寔鍟嗘埛 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( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟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, options?: API.RequestConfig ) { return request<API.LifePayOrderListOutputPageOutput>('/api/LifePay/GetLifePayOrderPage', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 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', @@ -109,6 +257,36 @@ }); } +/** 鑾峰彇鎴戠殑鍏ㄩ儴鎴峰彿鍒楄〃 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, @@ -120,6 +298,21 @@ 'Content-Type': 'application/json', }, data: body, + ...(options || {}), + }); +} + +/** 鐢ㄦ埛鏌ョ湅鐢熸椿缂磋垂閫�娆惧け璐ヨ鎯� GET /api/LifePay/GetUserLifePayOrderRefund */ +export async function getUserLifePayOrderRefund( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) + params: API.APIgetUserLifePayOrderRefundParams, + options?: API.RequestConfig +) { + return request<API.UserLifePayOrderRefundOutput>('/api/LifePay/GetUserLifePayOrderRefund', { + method: 'GET', + params: { + ...params, + }, ...(options || {}), }); } @@ -151,6 +344,51 @@ }); } +/** 鐢ㄦ埛鍙戣捣鐢熸椿缂磋垂閫�娆� 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( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟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, diff --git a/packages/services/api/typings.d.ts b/packages/services/api/typings.d.ts index 7724c53..287efc4 100644 --- a/packages/services/api/typings.d.ts +++ b/packages/services/api/typings.d.ts @@ -517,6 +517,25 @@ 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; @@ -1126,6 +1145,10 @@ id?: string; } + interface APIdeleteUserAccountParams { + id?: string; + } + interface APIdeleteUserParams { id?: string; } @@ -1466,6 +1489,10 @@ id?: string; } + interface APIgetLifePayChannlesDtoParams { + id?: string; + } + interface APIgetLifePayWxIndentityParams { /** 鐢ㄦ埛鐧诲綍鍑瘉 */ code?: string; @@ -1713,6 +1740,10 @@ userId?: string; } + interface APIgetUserLifePayOrderRefundParams { + id?: string; + } + interface APIgetUserListByPhoneNumberParams { phoneNumber?: string; clientId?: string; @@ -1866,6 +1897,11 @@ interface APIsetForUserParams { userId?: string; permissionName?: string; + } + + interface APIsetLifePayChannelsStatusParams { + id?: string; + status?: LifePayChannelsStatsEnum; } interface APIsetMessageIsReadParams { @@ -3884,6 +3920,22 @@ /** 璺熻繘澶囨敞 */ remark?: 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 { @@ -6237,6 +6289,49 @@ sign?: string; signType?: 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 { @@ -12220,8 +12315,34 @@ interface LifeElectricDataCreateLifePayOrderInput { userId?: string; + /** 娓犻亾Id */ + channelId?: string; productData?: LifeElectricData; } + + interface LifeGasData { + /** 鍏呭�奸潰棰濓紝鍗曚綅涓哄厓銆� */ + parValue: number; + /** 澶╃劧姘斿叕鍙哥被鍨嬶紝"zhong_ran"浠h〃涓噧鐕冩皵锛�"bei_jing"浠h〃鍖椾含鐕冩皵銆� */ + 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; @@ -12250,6 +12371,11 @@ refundCredentialsImgUrl?: string; /** 涓嬪崟鏃堕棿 */ creationTime?: string; + /** 閫�娆炬椂闂� */ + refundTime?: string; + refundApplyRemark?: string; + refundCheckRemark?: string; + acoolyOrderNo?: string; } interface LifePayOrderListOutputPageOutput { @@ -12258,23 +12384,32 @@ 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; @@ -12291,6 +12426,8 @@ interface LifePhoneDataCreateLifePayOrderInput { userId?: string; + /** 娓犻亾Id */ + channelId?: string; productData?: LifePhoneData; } @@ -16101,6 +16238,7 @@ interface QueryLifePayOrderListInput { pageModel?: Pagination; lifePayOrderType?: LifePayOrderTypeEnum; + lifePayType?: LifePayTypeEnum; /** 寮�濮嬫敮浠樻椂闂� */ beginPayTime?: string; /** 缁撴潫鏀粯鏃堕棿 */ @@ -16113,6 +16251,8 @@ endFinishTime?: string; /** 鐢ㄦ埛Id */ userId?: string; + /** 鎼滅储鍏抽敭璇� */ + keyWords?: string; } interface QueryMatchMakingApplyByOrderInput { @@ -16279,6 +16419,19 @@ pageModel?: Pagination; applyUserId?: string; orderUserId?: string; + } + + interface QueryUserAccountAllListInput { + /** 鐢ㄦ埛Id */ + userId?: string; + lifePayOrderType?: LifePayOrderTypeEnum; + } + + interface QueryUserAccountListInput { + pageModel?: Pagination; + /** 鐢ㄦ埛Id */ + userId?: string; + lifePayOrderType?: LifePayOrderTypeEnum; } interface QueryUserCertificationAuditListInput { @@ -16777,6 +16930,7 @@ interface RefundLifePayOrderInput { id?: string; refundCredentialsImgUrl?: string; + refundCheckRemark?: string; } interface RefundOrderContactSignInput { @@ -16786,6 +16940,13 @@ userId?: string; /** 璁㈠崟鍗忚Id */ orderSignId?: string; + } + + interface RefundUserLifePayOrderInput { + id?: string; + /** 鐢ㄦ埛Id */ + userId?: string; + refundApplyRemark?: string; } interface RegisterDto { @@ -19387,6 +19548,32 @@ 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; @@ -20285,6 +20472,12 @@ creationTime?: string; /** 閫�娆炬椂闂� */ refundTime?: string; + /** 閫�娆惧嚟璇� */ + refundCredentialsImgUrl?: string; + refundApplyRemark?: string; + refundCheckRemark?: string; + /** 娓犻亾娴佹按鍙� */ + acoolyOrderNo?: string; } interface UserLifePayOrderOutputPageOutput { @@ -20293,6 +20486,18 @@ data?: UserLifePayOrderOutput[]; } + interface UserLifePayOrderRefundOutput { + /** 璁㈠崟缂栧彿 */ + id?: string; + /** 璁㈠崟鍙� */ + orderNo?: string; + /** 閫�娆惧師鍥� */ + refundApplyRemark?: string; + /** 鍚庡彴濉啓鐨勯┏鍥炲師鍥� */ + refundCheckRemark?: string; + lifePayOrderStatus?: LifePayOrderStatusEnum; + } + interface UserListOutput { id?: string; /** 鐢ㄦ埛鎵嬫満鍙� */ -- Gitblit v1.9.1