| | |
| | | env: { |
| | | // BASE_URL: '"https://testrlywx.boleyuma.com"', |
| | | BASE_URL: '"https://api.81812333.com"', |
| | | BASE_URL_H5: '"https://testrlywx.boleyuma.com"', |
| | | BASE_URL_H5: '"https://testlifepay.81812333.com"', |
| | | BASE_URL_JX: '"https://api.jx818.com"', |
| | | |
| | | APP_ENV: '"staging"', |
| | |
| | | const props = defineProps(commonNavigationBarProps); |
| | | |
| | | const router = Taro.useRouter(); |
| | | console.log('router: ', router); |
| | | |
| | | const isLastPage = computed(() => { |
| | | const pages = Taro.getCurrentPages(); |
| | |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { useLifeRechargeContext, CreateEditPayChannelsInput } from '@life-payment/core-vue'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | CreateEditPayChannelsInput, |
| | | GetShowingLifePayAnnouncementInput, |
| | | } from '@life-payment/core-vue'; |
| | | import { MaybeRef } from 'vue'; |
| | | import { Message } from '@/utils'; |
| | | import Taro from '@tarojs/taro'; |
| | | |
| | | export function useOnlineService() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | |
| | | getChannlesNameByNum, |
| | | }; |
| | | } |
| | | |
| | | type UseShowingLifePayAnnouncementOptions = { |
| | | params?: MaybeRef<API.GetShowingLifePayAnnouncementInput>; |
| | | onSuccess?: (data: API.CreateEditLifePayAnnouncementOutput) => any; |
| | | staleTime?: MaybeRef<number>; |
| | | }; |
| | | |
| | | export function useShowingLifePayAnnouncement(options: UseShowingLifePayAnnouncementOptions = {}) { |
| | | const { onSuccess, params = {}, staleTime } = options; |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { |
| | | data: announcement, |
| | | isLoading, |
| | | refetch, |
| | | } = useQuery({ |
| | | queryKey: ['blLifeRecharge/getShowingLifePayAnnouncement', params], |
| | | queryFn: async () => { |
| | | return await blLifeRecharge.services.getShowingLifePayAnnouncement(unref(params), { |
| | | showLoading: false, |
| | | skipErrorHandler: true, |
| | | }); |
| | | }, |
| | | onSuccess: (data) => { |
| | | onSuccess?.(data); |
| | | }, |
| | | staleTime: staleTime, |
| | | }); |
| | | |
| | | return { |
| | | announcement, |
| | | isLoading, |
| | | refetch, |
| | | }; |
| | | } |
| | | |
| | | const dialogShowingLifePayAnnouncementCache = {}; |
| | | |
| | | export function useDialogShowingLifePayAnnouncement() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | const router = Taro.useRouter(); |
| | | |
| | | useShowingLifePayAnnouncement({ |
| | | params: { |
| | | announcementType: blLifeRecharge.constants.AnnouncementTypeEnum.Dialog, |
| | | }, |
| | | onSuccess(data) { |
| | | if (!dialogShowingLifePayAnnouncementCache[router.path]) { |
| | | dialogShowingLifePayAnnouncementCache[router.path] = true; |
| | | Message.confirm({ |
| | | title: 'å
Œ', |
| | | message: data.announcementContent ?? '', |
| | | showCancelBtn: false, |
| | | }); |
| | | } |
| | | }, |
| | | staleTime: Infinity, |
| | | }); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <nut-noticebar :left-icon="false" :text="text" v-if="!!text" /> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { BlLifeRecharge } from '@life-payment/core-vue'; |
| | | import { useShowingLifePayAnnouncement } from '@/hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'NormalAnnouncement', |
| | | }); |
| | | |
| | | // type Props = {}; |
| | | |
| | | // const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const text = ref(''); |
| | | |
| | | useShowingLifePayAnnouncement({ |
| | | params: { |
| | | announcementType: BlLifeRecharge.constants.AnnouncementTypeEnum.Normal, |
| | | }, |
| | | onSuccess(data) { |
| | | text.value = data.announcementContent; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import '@/styles/common.scss'; |
| | | </style> |
| | |
| | | <template #bg> |
| | | <img :src="OssAssets.common.HomePageBg" class="home-page-bg" /> |
| | | </template> |
| | | <NormalAnnouncement /> |
| | | <ContentView> |
| | | <div class="home-page-banner-wrapper"> |
| | | <div class="home-page-banner-left"> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { useAccessLogin } from '@/hooks'; |
| | | import { useAccessLogin, useDialogShowingLifePayAnnouncement } from '@/hooks'; |
| | | import { useUserStore } from '@/stores/modules/user'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { OrderInputType } from '@life-payment/constants'; |
| | |
| | | import IconBanner from '@/assets/home/icon-banner.png'; |
| | | import IconBannerLogo from '@/assets/home/icon-banner-logo.png'; |
| | | import IconBannerItem from '@/assets/home/icon-banner-item.png'; |
| | | import NormalAnnouncement from './components/NormalAnnouncement.vue'; |
| | | |
| | | const userStore = useUserStore(); |
| | | |
| | | const router = Taro.useRouter(); |
| | | |
| | | useDialogShowingLifePayAnnouncement(); |
| | | |
| | | const goPhoneBillRecharge = useAccessLogin(() => { |
| | | RouteHelper.navigateTo({ |
| | | url: `${RouterPath.phoneBillRecharge}`, |
| | |
| | | title?: string; |
| | | message?: string | VNode; |
| | | confirmText?: string; |
| | | showCancelBtn?: boolean; |
| | | }; |
| | | |
| | | export class Message { |
| | | static confirm(options: ConfirmOptions = {}) { |
| | | const { title = 'æç¤º', message = 'ç¡®å®è¦å é¤è¯¥æ°æ®å?', confirmText = '确认' } = options; |
| | | const { |
| | | title = 'æç¤º', |
| | | message = 'ç¡®å®è¦å é¤è¯¥æ°æ®å?', |
| | | confirmText = '确认', |
| | | showCancelBtn = true, |
| | | } = options; |
| | | return new Promise((resolve, reject) => { |
| | | Portal.add((key) => { |
| | | return ( |
| | |
| | | onClose(); |
| | | }} |
| | | confirmText={confirmText} |
| | | showCancelBtn={showCancelBtn} |
| | | ></Model> |
| | | ), |
| | | }} |
| | |
| | | import { useInfiniteLoading } from './infiniteLoading'; |
| | | import { OrderInputType } from '../constants'; |
| | | import { convertOrderFrontStatus } from '../utils'; |
| | | import { useLifePayRateChannelAllList } from './rate'; |
| | | |
| | | export function useGetRate() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { data: lifePayRateList, isLoading } = useQuery({ |
| | | queryKey: ['blLifeRecharge/getRate'], |
| | | queryFn: async () => { |
| | | return await blLifeRecharge.services.getRate({ showLoading: false }); |
| | | }, |
| | | placeholderData: () => [] as LifePayRateListOutput[], |
| | | }); |
| | | // const { data: lifePayRateList, isLoading } = useQuery({ |
| | | // queryKey: ['blLifeRecharge/getRate'], |
| | | // queryFn: async () => { |
| | | // return await blLifeRecharge.services.getRate({ showLoading: false }); |
| | | // }, |
| | | // placeholderData: () => [] as LifePayRateListOutput[], |
| | | // }); |
| | | const { allRateChannelList } = useLifePayRateChannelAllList(); |
| | | |
| | | const hasChannel = computed(() => !!blLifeRecharge.accountModel.channlesNum); |
| | | |
| | |
| | | if (hasChannel.value && channelRate.value.channlesRate) { |
| | | return channelRate.value.channlesRate; |
| | | } |
| | | // return ( |
| | | // lifePayRateList.value.find( |
| | | // (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤è¯è´¹ææ£ |
| | | // )?.rate ?? 0 |
| | | // ); |
| | | return ( |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤è¯è´¹ææ£ |
| | | )?.rate ?? 0 |
| | | allRateChannelList.value |
| | | .filter((x) => x.lifePayOrderType == blLifeRecharge.constants.LifePayOrderTypeEnum.è¯è´¹è®¢å) |
| | | .toSorted((a, b) => a.platformRate - b.platformRate)?.[0]?.platformRate ?? 0 |
| | | ); |
| | | }); |
| | | |
| | |
| | | if (hasChannel.value && channelRate.value.channlesRate) { |
| | | return channelRate.value.channlesRate; |
| | | } |
| | | // return ( |
| | | // lifePayRateList.value.find( |
| | | // (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤çµè´¹ææ£ |
| | | // )?.rate ?? 0 |
| | | // ); |
| | | return ( |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤çµè´¹ææ£ |
| | | )?.rate ?? 0 |
| | | allRateChannelList.value |
| | | .filter((x) => x.lifePayOrderType == blLifeRecharge.constants.LifePayOrderTypeEnum.çµè´¹è®¢å) |
| | | .toSorted((a, b) => a.platformRate - b.platformRate)?.[0]?.platformRate ?? 0 |
| | | ); |
| | | }); |
| | | |
| | |
| | | if (hasChannel.value && channelRate.value.channlesRate) { |
| | | return channelRate.value.channlesRate; |
| | | } |
| | | // return ( |
| | | // lifePayRateList.value.find( |
| | | // (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤çæ°ææ£ |
| | | // )?.rate ?? 0 |
| | | // ); |
| | | return ( |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.é»è®¤çæ°ææ£ |
| | | )?.rate ?? 0 |
| | | allRateChannelList.value |
| | | .filter((x) => x.lifePayOrderType == blLifeRecharge.constants.LifePayOrderTypeEnum.çæ°è®¢å) |
| | | .toSorted((a, b) => a.platformRate - b.platformRate)?.[0]?.platformRate ?? 0 |
| | | ); |
| | | }); |
| | | |
| | | return { |
| | | lifePayRateList, |
| | | // lifePayRateList, |
| | | lifePayPhoneRate, |
| | | lifePayElectricRate, |
| | | lifePayGasRate, |
| | | allRateChannelList, |
| | | }; |
| | | } |
| | | |
| | |
| | | onSetUserAccount: (currentUserAccount: UserAccountListOutput) => any; |
| | | getDefaultUserAccount?: ( |
| | | userAccountList: UserAccountListOutput[] |
| | | ) => UserAccountListOutput | undefined; |
| | | ) => Promise<UserAccountListOutput | undefined>; |
| | | }; |
| | | |
| | | export function useSetUserAccountBySelect({ |
| | | lifePayOrderType, |
| | | onSetUserAccount, |
| | | getDefaultUserAccount = (data) => data[0], |
| | | getDefaultUserAccount = (data) => Promise.resolve(data[0]), |
| | | }: UseSetUserAccountBySelectOptions) { |
| | | const { userAccountAllList } = useUserAccountAllList({ |
| | | lifePayOrderType: lifePayOrderType, |
| | | onSuccess(data) { |
| | | if (data.length > 0) { |
| | | const currentUserAccount = getDefaultUserAccount(data); |
| | | if (currentUserAccount) { |
| | | onSetUserAccount?.(currentUserAccount); |
| | | async onSuccess(data) { |
| | | try { |
| | | if (data.length > 0) { |
| | | const currentUserAccount = await getDefaultUserAccount(data); |
| | | if (currentUserAccount) { |
| | | onSetUserAccount?.(currentUserAccount); |
| | | } |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | }, |
| | | }); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | useLifeRechargeContext, |
| | | QueryRateChannelInput, |
| | | CreateEditRateChannelOutput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useQuery, useQueryClient } from '@tanstack/vue-query'; |
| | | import { MaybeRef, unref, computed, Ref } from 'vue'; |
| | | |
| | | type UseLifePayRateChannelAllListOptions = { |
| | | params?: MaybeRef<QueryRateChannelInput>; |
| | | }; |
| | | |
| | | export function useLifePayRateChannelAllList(options: UseLifePayRateChannelAllListOptions = {}) { |
| | | const { params = {} } = options; |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const queryClient = useQueryClient(); |
| | | |
| | | const _params = computed(() => ({ |
| | | status: blLifeRecharge.constants.LifePayRateChannelStatus.Enabled, |
| | | ...unref(params), |
| | | })); |
| | | |
| | | const { data: allRateChannelList } = useQuery({ |
| | | queryKey: ['blLifeRecharge/getLifePayRateChannelAllList', _params], |
| | | queryFn: async () => { |
| | | return await blLifeRecharge.services.getLifePayRateChannelAllList(_params.value, { |
| | | showLoading: false, |
| | | }); |
| | | }, |
| | | placeholderData: () => [] as CreateEditRateChannelOutput[], |
| | | }); |
| | | |
| | | function ensureLifePayRateChannelAllList() { |
| | | return queryClient.ensureQueryData({ |
| | | queryKey: ['blLifeRecharge/getLifePayRateChannelAllList', _params], |
| | | }); |
| | | } |
| | | |
| | | function getRateChannelByCode(code: string) { |
| | | return allRateChannelList.value.find((item) => item.code === code); |
| | | } |
| | | |
| | | return { |
| | | allRateChannelList, |
| | | ensureLifePayRateChannelAllList, |
| | | getRateChannelByCode, |
| | | }; |
| | | } |
| | | |
| | | type UseCheckCanRechargeOptions = { |
| | | msg: Ref<string>; |
| | | show: Ref<boolean>; |
| | | }; |
| | | |
| | | export function useCheckCanRecharge(options: UseCheckCanRechargeOptions) { |
| | | const { msg, show } = options; |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { getRateChannelByCode, ensureLifePayRateChannelAllList } = useLifePayRateChannelAllList({ |
| | | params: { |
| | | status: null, |
| | | }, |
| | | }); |
| | | |
| | | /** |
| | | * |
| | | * @param rateChannelCode |
| | | * @description rateChannelCodeå¼è¯è´¹ä¸ºIspCodeãçµè´¹ä¸ºelectricTypeãçæ°è´¹ä¸ºgasOrgType |
| | | * @returns |
| | | */ |
| | | function isCanRecharge(rateChannelCode: string) { |
| | | const rateChannel = getRateChannelByCode(rateChannelCode); |
| | | return rateChannel?.status === blLifeRecharge.constants.LifePayRateChannelStatus.Enabled; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param rateChannelCode |
| | | * @description rateChannelCodeå¼è¯è´¹ä¸ºIspCodeãçµè´¹ä¸ºelectricTypeãçæ°è´¹ä¸ºgasOrgType |
| | | * @returns |
| | | */ |
| | | function checkCanRecharge(rateChannelCode: string) { |
| | | const rateChannel = getRateChannelByCode(rateChannelCode); |
| | | if (!isCanRecharge(rateChannelCode)) { |
| | | //é鿣å¨å级ï¼ç»æ¨å¸¦æ¥ä¸ä¾¿å°½æ
è°
è§£ |
| | | msg.value = rateChannel?.remark ?? ''; |
| | | show.value = true; |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | return { |
| | | isCanRecharge, |
| | | checkCanRecharge, |
| | | ensureLifePayRateChannelAllList, |
| | | }; |
| | | } |
| | |
| | | direction="horizontal" |
| | | class="par-account-list" |
| | | v-if="userAccountAllList.length > 0" |
| | | @change="handleUserAccountChange" |
| | | @change="_handleUserAccountChange" |
| | | > |
| | | <NutRadio |
| | | :label="item.id" |
| | |
| | | import { RechargeProps } from '../PhoneBillRecharge/types'; |
| | | import Chunk from '../../components/Layout/Chunk.vue'; |
| | | import IconSelect from '../../assets/recharge/icon-select.png'; |
| | | import { useCheckCanRecharge } from '../../hooks/rate'; |
| | | |
| | | defineOptions({ |
| | | name: 'GasBillRechargeStep3', |
| | |
| | | form.parValue = 0; |
| | | } |
| | | }, |
| | | async getDefaultUserAccount(userAccountList) { |
| | | await ensureLifePayRateChannelAllList(); |
| | | const defaultUserAccount = userAccountList.find((x) => { |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | x.extraProperties |
| | | ) as GasUserAccountExtraProperties; |
| | | return isCanRecharge(currentUserAccountExtraProperties.gasOrgType); |
| | | }); |
| | | return defaultUserAccount; |
| | | }, |
| | | }); |
| | | |
| | | function _handleUserAccountChange(userAccountId: string) { |
| | | const currentUserAccount = userAccountAllList.value.find((x) => x.id === userAccountId); |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | currentUserAccount.extraProperties |
| | | ) as GasUserAccountExtraProperties; |
| | | if (!checkCanRecharge(currentUserAccountExtraProperties.gasOrgType)) { |
| | | // return; |
| | | } |
| | | handleUserAccountChange(userAccountId); |
| | | } |
| | | |
| | | function handleAddUserAccount() { |
| | | goTo('step1'); |
| | | } |
| | |
| | | |
| | | const currentOrderNo = ref(''); |
| | | |
| | | const { isCanRecharge, checkCanRecharge, ensureLifePayRateChannelAllList } = useCheckCanRecharge({ |
| | | msg: toRef(state, 'msg'), |
| | | show: toRef(state, 'show'), |
| | | }); |
| | | |
| | | async function goPay() { |
| | | try { |
| | | if (!checkCanRecharge(form.gasOrgType)) { |
| | | return; |
| | | } |
| | | let params: LifeGasDataCreateLifePayOrderInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | channelId: blLifeRecharge.accountModel.channlesNum, |
| | |
| | | > |
| | | <NutFormItem label="éæ©è¿è¥å:" class="bole-form-item" prop="ispCode" required> |
| | | <NutRadioGroup v-model="form.ispCode" direction="horizontal" @change="handleIspCodeChange"> |
| | | <BlRadio |
| | | :label="key" |
| | | v-for="(val, key) in BlLifeRecharge.constants.IspCodeTextForSelect" |
| | | :key="key" |
| | | >{{ val }}</BlRadio |
| | | > |
| | | <BlRadio :label="item.code" v-for="item in allRateChannelList" :key="item.id">{{ |
| | | item.rateChannelName |
| | | }}</BlRadio> |
| | | </NutRadioGroup> |
| | | </NutFormItem> |
| | | <NutFormItem label="å
弿æºå·" class="bole-form-item" prop="phone" required> |
| | |
| | | import BlRadio from '../../components/Radio/Radio.vue'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { BlLifeRecharge, LifeRechargeConstants } from '@life-payment/core-vue'; |
| | | import { useLifePayRateChannelAllList } from '../../hooks/rate'; |
| | | |
| | | defineOptions({ |
| | | name: 'PhoneBillRechargeBaseForm', |
| | |
| | | |
| | | const dialogVisible = ref(false); |
| | | |
| | | const { allRateChannelList } = useLifePayRateChannelAllList({ |
| | | params: { |
| | | lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum.è¯è´¹è®¢å, |
| | | }, |
| | | }); |
| | | |
| | | function handleIspCodeChange(ispCode: LifeRechargeConstants.IspCode) { |
| | | console.log('ispCode: ', ispCode); |
| | | if (ispCode === LifeRechargeConstants.IspCode.dianxin) { |
| | |
| | | import { RechargeProps } from './types'; |
| | | import Chunk from '../../components/Layout/Chunk.vue'; |
| | | import IconSelect from '../../assets/recharge/icon-select.png'; |
| | | import { useCheckCanRecharge } from '../../hooks/rate'; |
| | | |
| | | defineOptions({ |
| | | name: 'PhoneBillRechargeStep2', |
| | |
| | | form.remark = currentUserAccount.remark; |
| | | changeIspCode(form.ispCode as any); |
| | | }, |
| | | getDefaultUserAccount(userAccountList) { |
| | | async getDefaultUserAccount(userAccountList) { |
| | | await ensureLifePayRateChannelAllList(); |
| | | const defaultUserAccount = userAccountList.find((x) => { |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | x.extraProperties |
| | |
| | | |
| | | const currentOrderNo = ref(''); |
| | | |
| | | function isCanRecharge(ispCode: string) { |
| | | // return ispCode !== blLifeRecharge.constants.IspCode.yidong; |
| | | return true; |
| | | } |
| | | |
| | | function checkCanRecharge(ispCode: string) { |
| | | if (!isCanRecharge(ispCode)) { |
| | | //é鿣å¨å级ï¼ç»æ¨å¸¦æ¥ä¸ä¾¿å°½æ
è°
è§£ |
| | | state.msg = |
| | | 'å°æ¬çç¨æ·ï¼ä¸ºæä¾æ´å®å
¨ã稳å®çå
弿å¡ï¼ç§»å¨å
å¼é鿣å¨è¿è¡å级维æ¤ï¼ç»´æ¤æé´ææ æ³åèµ·å
å¼'; |
| | | state.show = true; |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | const { isCanRecharge, checkCanRecharge, ensureLifePayRateChannelAllList } = useCheckCanRecharge({ |
| | | msg: toRef(state, 'msg'), |
| | | show: toRef(state, 'show'), |
| | | }); |
| | | |
| | | async function goPay() { |
| | | try { |
| | |
| | | direction="horizontal" |
| | | class="par-account-list" |
| | | v-if="userAccountAllList.length > 0" |
| | | @change="handleUserAccountChange" |
| | | @change="_handleUserAccountChange" |
| | | > |
| | | <NutRadio |
| | | :label="item.id" |
| | |
| | | import { RechargeProps } from '../PhoneBillRecharge/types'; |
| | | import Chunk from '../../components/Layout/Chunk.vue'; |
| | | import IconSelect from '../../assets/recharge/icon-select.png'; |
| | | import { useCheckCanRecharge } from '../../hooks/rate'; |
| | | |
| | | defineOptions({ |
| | | name: 'ElectricBillRechargeStep2', |
| | |
| | | form.parValue = 0; |
| | | } |
| | | }, |
| | | async getDefaultUserAccount(userAccountList) { |
| | | await ensureLifePayRateChannelAllList(); |
| | | const defaultUserAccount = userAccountList.find((x) => { |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | x.extraProperties |
| | | ) as ElectricUserAccountExtraProperties; |
| | | return isCanRecharge(currentUserAccountExtraProperties.electricType); |
| | | }); |
| | | return defaultUserAccount; |
| | | }, |
| | | }); |
| | | |
| | | function _handleUserAccountChange(userAccountId: string) { |
| | | const currentUserAccount = userAccountAllList.value.find((x) => x.id === userAccountId); |
| | | const currentUserAccountExtraProperties = JSON.parse( |
| | | currentUserAccount.extraProperties |
| | | ) as ElectricUserAccountExtraProperties; |
| | | if (!checkCanRecharge(currentUserAccountExtraProperties.electricType)) { |
| | | // return; |
| | | } |
| | | handleUserAccountChange(userAccountId); |
| | | } |
| | | |
| | | function handleAddUserAccount() { |
| | | goTo('step1'); |
| | | } |
| | |
| | | |
| | | const currentOrderNo = ref(''); |
| | | |
| | | const { isCanRecharge, checkCanRecharge, ensureLifePayRateChannelAllList } = useCheckCanRecharge({ |
| | | msg: toRef(state, 'msg'), |
| | | show: toRef(state, 'show'), |
| | | }); |
| | | |
| | | async function goPay() { |
| | | try { |
| | | if (!checkCanRecharge(form.electricType)) { |
| | | return; |
| | | } |
| | | let params: LifeElectricDataCreateLifePayOrderInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | channelId: blLifeRecharge.accountModel.channlesNum, |
| | |
| | | [LifePayChannelAgentType.BrandAgent]: 'åç代ç', |
| | | [LifePayChannelAgentType.AreaAgent]: 'åºå代ç', |
| | | }; |
| | | |
| | | export enum AnnouncementTypeEnum { |
| | | /**æ®éå
Œ */ |
| | | Normal = 10, |
| | | /**å¼¹çªå
Œ */ |
| | | Dialog = 20, |
| | | } |
| | | |
| | | export enum AnnouncementStatusEnum { |
| | | /**å±ç¤ºä¸ */ |
| | | Showing = 10, |
| | | /**å¾
å±ç¤º */ |
| | | Wait = 20, |
| | | /**已忢 */ |
| | | Stop = 30, |
| | | } |
| | | |
| | | export enum LifePayRateChannelStatus { |
| | | /**å¯ç¨ */ |
| | | Disabled = -10, |
| | | /**ç¦ç¨ */ |
| | | Enabled = 10, |
| | | } |
| | | } |
| | |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åå½åå±ç¤ºä¸çå
Œ POST /api/LifePayAnnouncement/GetShowingLifePayAnnouncement */ |
| | | async getShowingLifePayAnnouncement( |
| | | body: GetShowingLifePayAnnouncementInput, |
| | | options?: RequestConfig |
| | | ) { |
| | | return this.request<CreateEditLifePayAnnouncementOutput>( |
| | | '/api/LifePayAnnouncement/GetShowingLifePayAnnouncement', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** è·åææ£ééé
ç½®å表 POST /api/LifePayRate/GetLifePayRateChannelAllList */ |
| | | async getLifePayRateChannelAllList(body: QueryRateChannelInput, options?: RequestConfig) { |
| | | return this.request<CreateEditRateChannelOutput[]>( |
| | | '/api/LifePayRate/GetLifePayRateChannelAllList', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | |
| | | export interface PhoneMesssageCodeLoginInput { |
| | |
| | | /** IdNumber */ |
| | | idNumber?: string; |
| | | } |
| | | |
| | | export interface GetShowingLifePayAnnouncementInput { |
| | | announcementType?: LifeRechargeConstants.AnnouncementTypeEnum; |
| | | } |
| | | |
| | | export interface CreateEditLifePayAnnouncementOutput { |
| | | id?: string; |
| | | announcementType: LifeRechargeConstants.AnnouncementTypeEnum; |
| | | /** çææ¥æ */ |
| | | startTime: string; |
| | | /** æªæ¢æ¥æ */ |
| | | endTime: string; |
| | | /** å
¬åå
容 */ |
| | | announcementContent: string; |
| | | creationTime?: string; |
| | | status?: LifeRechargeConstants.AnnouncementStatusEnum; |
| | | } |
| | | |
| | | export interface QueryRateChannelInput { |
| | | status?: LifeRechargeConstants.LifePayRateChannelStatus; |
| | | lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum; |
| | | } |
| | | |
| | | export interface CreateEditRateChannelOutput { |
| | | id?: string; |
| | | lifePayOrderType: LifeRechargeConstants.LifePayOrderTypeEnum; |
| | | /** éé */ |
| | | rateChannelName: string; |
| | | /** ID */ |
| | | code: string; |
| | | /** ä¾åºåææ£ */ |
| | | supplierRate: number; |
| | | /** å¹³å°ææ£ */ |
| | | platformRate: number; |
| | | status: LifeRechargeConstants.LifePayRateChannelStatus; |
| | | /** éç¥å
容 */ |
| | | remark: string; |
| | | creationTime?: string; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* eslint-disable */ |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** æ°å¢ç¼è¾å
Œ POST /api/LifePayAnnouncement/CreateOrEditLifePayAnnouncement */ |
| | | export async function createOrEditLifePayAnnouncement( |
| | | body: API.CreateEditLifePayAnnouncementInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePayAnnouncement/CreateOrEditLifePayAnnouncement', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** å é¤å
Œ GET /api/LifePayAnnouncement/DeleteLifePayAnnouncement */ |
| | | export async function deleteLifePayAnnouncement( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIdeleteLifePayAnnouncementParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePayAnnouncement/DeleteLifePayAnnouncement', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åå
¬åå页 POST /api/LifePayAnnouncement/GetLifePayAnnouncementPage */ |
| | | export async function getLifePayAnnouncementPage( |
| | | body: API.GetLifePayAnnouncementPageInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.CreateEditLifePayAnnouncementOutputPageOutput>( |
| | | '/api/LifePayAnnouncement/GetLifePayAnnouncementPage', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** è·åå½åå±ç¤ºä¸çå
Œ POST /api/LifePayAnnouncement/GetShowingLifePayAnnouncement */ |
| | | export async function getShowingLifePayAnnouncement( |
| | | body: API.GetShowingLifePayAnnouncementInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.CreateEditLifePayAnnouncementOutput>( |
| | | '/api/LifePayAnnouncement/GetShowingLifePayAnnouncement', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* eslint-disable */ |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** æ°å¢ç¼è¾ææ£ééé
ç½® POST /api/LifePayRate/CreateOrEditLifePayRateChannel */ |
| | | export async function createOrEditLifePayRateChannel( |
| | | body: API.CreateEditRateChannelInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePayRate/CreateOrEditLifePayRateChannel', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** å 餿æ£éé POST /api/LifePayRate/DeleteRateChannel */ |
| | | export async function deleteRateChannel( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIdeleteRateChannelParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePayRate/DeleteRateChannel', { |
| | | method: 'POST', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** è·åææ£ééé
ç½®å表 POST /api/LifePayRate/GetLifePayRateChannelAllList */ |
| | | export async function getLifePayRateChannelAllList( |
| | | body: API.QueryRateChannelInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.CreateEditRateChannelOutput[]>( |
| | | '/api/LifePayRate/GetLifePayRateChannelAllList', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** è·åææ£ééé
ç½®å页 POST /api/LifePayRate/GetLifePayRateChannelPage */ |
| | | export async function getLifePayRateChannelPage(body: API.PageInput, options?: API.RequestConfig) { |
| | | return request<API.CreateEditRateChannelOutputPageOutput>( |
| | | '/api/LifePayRate/GetLifePayRateChannelPage', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** è®¾ç½®ææ£ééç¶æ GET /api/LifePayRate/SetRateChannelStatus */ |
| | | export async function setRateChannelStatus( |
| | | // å å çæçParamç±»å (ébodyåæ°swaggeré»è®¤æ²¡æçæå¯¹è±¡) |
| | | params: API.APIsetRateChannelStatusParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<number>('/api/LifePayRate/SetRateChannelStatus', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | /** æ¤å¤å端没ææä¾æ³¨é POST /api/WxPayNotify/WxPayDomesticRefundsNotifyImp */ |
| | | export async function wxPayDomesticRefundsNotifyImp( |
| | | body: API.WxPayDomesticRefundsNotice, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<any>('/api/WxPayNotify/WxPayDomesticRefundsNotifyImp', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 微信æ¯ä»åè°éç¥ POST /api/WxPayNotify/WxRechargeNotify */ |
| | | export async function wxRechargeNotify( |
| | | body: API.WxRechargeNotifyInput, |
| | |
| | | import * as IdentityUser from './IdentityUser'; |
| | | import * as IdentityUserLookup from './IdentityUserLookup'; |
| | | import * as LifePay from './LifePay'; |
| | | import * as LifePayAnnouncement from './LifePayAnnouncement'; |
| | | import * as LifePayRate from './LifePayRate'; |
| | | import * as Log from './Log'; |
| | | import * as OperateHistory from './OperateHistory'; |
| | | import * as Permissions from './Permissions'; |
| | |
| | | IdentityUser, |
| | | IdentityUserLookup, |
| | | LifePay, |
| | | LifePayAnnouncement, |
| | | LifePayRate, |
| | | Log, |
| | | OperateHistory, |
| | | Permissions, |
| | |
| | | column?: ModuleColumnDto[]; |
| | | } |
| | | |
| | | type AnnouncementStatusEnum = 10 | 20 | 30; |
| | | |
| | | type AnnouncementTypeEnum = 10 | 20; |
| | | |
| | | interface APIaddOrEditModuleStatusParams { |
| | | id?: string; |
| | | isMenu?: number; |
| | |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteLifePayAnnouncementParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteModuleButtonParams { |
| | | id?: string; |
| | | } |
| | |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteRateChannelParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteRoleParams { |
| | | id?: string; |
| | | } |
| | |
| | | status?: LifePayChannelsStatsEnum; |
| | | } |
| | | |
| | | interface APIsetRateChannelStatusParams { |
| | | id?: string; |
| | | status?: LifePayRateChannelStatus; |
| | | } |
| | | |
| | | interface APIstatisticsByDateParams { |
| | | days?: number; |
| | | } |
| | |
| | | customerResources?: string; |
| | | } |
| | | |
| | | interface CreateEditLifePayAnnouncementInput { |
| | | id?: string; |
| | | announcementType: AnnouncementTypeEnum; |
| | | /** çææ¥æ */ |
| | | startTime: string; |
| | | /** æªæ¢æ¥æ */ |
| | | endTime: string; |
| | | /** å
¬åå
容 */ |
| | | announcementContent: string; |
| | | } |
| | | |
| | | interface CreateEditLifePayAnnouncementOutput { |
| | | id?: string; |
| | | announcementType: AnnouncementTypeEnum; |
| | | /** çææ¥æ */ |
| | | startTime: string; |
| | | /** æªæ¢æ¥æ */ |
| | | endTime: string; |
| | | /** å
¬åå
容 */ |
| | | announcementContent: string; |
| | | creationTime?: string; |
| | | status?: AnnouncementStatusEnum; |
| | | } |
| | | |
| | | interface CreateEditLifePayAnnouncementOutputPageOutput { |
| | | pageModel?: Pagination; |
| | | objectData?: any; |
| | | data?: CreateEditLifePayAnnouncementOutput[]; |
| | | } |
| | | |
| | | interface CreateEditPayChannelsInput { |
| | | id?: string; |
| | | channlesName?: string; |
| | |
| | | data?: CreateEditPayChannelsInput[]; |
| | | } |
| | | |
| | | interface CreateEditRateChannelInput { |
| | | id?: string; |
| | | lifePayOrderType: LifePayOrderTypeEnum; |
| | | /** éé */ |
| | | rateChannelName: string; |
| | | /** ID */ |
| | | code: string; |
| | | /** ä¾åºåææ£ */ |
| | | supplierRate: number; |
| | | /** å¹³å°ææ£ */ |
| | | platformRate: number; |
| | | status: LifePayRateChannelStatus; |
| | | /** éç¥å
容 */ |
| | | remark: string; |
| | | } |
| | | |
| | | interface CreateEditRateChannelOutput { |
| | | id?: string; |
| | | lifePayOrderType: LifePayOrderTypeEnum; |
| | | /** éé */ |
| | | rateChannelName: string; |
| | | /** ID */ |
| | | code: string; |
| | | /** ä¾åºåææ£ */ |
| | | supplierRate: number; |
| | | /** å¹³å°ææ£ */ |
| | | platformRate: number; |
| | | status: LifePayRateChannelStatus; |
| | | /** éç¥å
容 */ |
| | | remark: string; |
| | | creationTime?: string; |
| | | } |
| | | |
| | | interface CreateEditRateChannelOutputPageOutput { |
| | | pageModel?: Pagination; |
| | | objectData?: any; |
| | | data?: CreateEditRateChannelOutput[]; |
| | | } |
| | | |
| | | interface CreateLifePayOrderOutput { |
| | | orderNo?: string; |
| | | } |
| | |
| | | groups?: FeatureGroupDto[]; |
| | | } |
| | | |
| | | interface GetLifePayAnnouncementPageInput { |
| | | pageModel?: Pagination; |
| | | creationTimeBegin?: string; |
| | | creationTimeEnd?: string; |
| | | startTime?: string; |
| | | endTime?: string; |
| | | status?: AnnouncementStatusEnum; |
| | | } |
| | | |
| | | interface GetOperateHistoryInput { |
| | | pageModel?: Pagination; |
| | | relationId?: string; |
| | |
| | | queryCondition?: string; |
| | | } |
| | | |
| | | interface GetShowingLifePayAnnouncementInput { |
| | | announcementType?: AnnouncementTypeEnum; |
| | | } |
| | | |
| | | interface IanaTimeZone { |
| | | timeZoneName?: string; |
| | | } |
| | |
| | | id?: string; |
| | | } |
| | | |
| | | type LifePayRateChannelStatus = 10 | -10; |
| | | |
| | | interface LifePayRateInput { |
| | | rateType?: LifePayRateTypeEnum; |
| | | rate?: number; |
| | |
| | | phoneChargeOrder?: PhoneChargeOrderOutput; |
| | | } |
| | | |
| | | interface QueryRateChannelInput { |
| | | status?: LifePayRateChannelStatus; |
| | | lifePayOrderType?: LifePayOrderTypeEnum; |
| | | } |
| | | |
| | | interface QueryUserAccountAllListInput { |
| | | pageModel?: Pagination; |
| | | checkChannelId?: string; |
| | |
| | | incomeList?: ReceiptsDetail[]; |
| | | } |
| | | |
| | | interface RefundAmount { |
| | | total: number; |
| | | refund: number; |
| | | payerTotal: string; |
| | | payerRefund: string; |
| | | } |
| | | |
| | | interface RefundLifePayOrderInput { |
| | | id?: string; |
| | | /** ä¸ä¼ åè¯ */ |
| | |
| | | unionId?: string; |
| | | } |
| | | |
| | | interface WxPayDomesticRefundsNotice { |
| | | mchid?: string; |
| | | outTradeNo?: string; |
| | | transactionId?: string; |
| | | outRefundNo?: string; |
| | | refundStatus?: string; |
| | | amount?: RefundAmount; |
| | | } |
| | | |
| | | interface WxPayDomesticRefundsQueryReponse { |
| | | code?: string; |
| | | message?: string; |
| | |
| | | interface RequestConfig extends GlobalType.RequestConfig { |
| | | showNavigationBarLoading?: boolean; |
| | | showLoading?: boolean; |
| | | skipErrorHandler?: boolean; |
| | | mock?: boolean; |
| | | customErrorHandler?: (error: any) => boolean; |
| | | } |