| | |
| | | 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'; |
| | | |
| | | export function useOnlineService() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | |
| | | getChannlesNameByNum, |
| | | }; |
| | | } |
| | | |
| | | type UseShowingLifePayAnnouncementOptions = { |
| | | params?: MaybeRef<API.GetShowingLifePayAnnouncementInput>; |
| | | onSuccess?: (data: API.CreateEditLifePayAnnouncementOutput) => any; |
| | | }; |
| | | |
| | | export function useShowingLifePayAnnouncement(options: UseShowingLifePayAnnouncementOptions = {}) { |
| | | const { onSuccess, params = {} } = 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); |
| | | }, |
| | | }); |
| | | |
| | | return { |
| | | announcement, |
| | | isLoading, |
| | | refetch, |
| | | }; |
| | | } |
| | | |
| | | export function useDialogShowingLifePayAnnouncement() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | useShowingLifePayAnnouncement({ |
| | | params: { |
| | | announcementType: blLifeRecharge.constants.AnnouncementTypeEnum.Dialog, |
| | | }, |
| | | onSuccess(data) { |
| | | Message.confirm({ |
| | | title: '公告', |
| | | message: data.announcementContent ?? '', |
| | | showCancelBtn: false, |
| | | }); |
| | | }, |
| | | }); |
| | | } |
New file |
| | |
| | | <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> |
| | | ), |
| | | }} |
| | |
| | | [LifePayChannelAgentType.BrandAgent]: '品牌代理', |
| | | [LifePayChannelAgentType.AreaAgent]: '区域代理', |
| | | }; |
| | | |
| | | export enum AnnouncementTypeEnum { |
| | | /**普通公告 */ |
| | | Normal = 10, |
| | | /**弹窗公告 */ |
| | | Dialog = 20, |
| | | } |
| | | |
| | | export enum AnnouncementStatusEnum { |
| | | /**展示中 */ |
| | | Showing = 10, |
| | | /**待展示 */ |
| | | Wait = 20, |
| | | /**已停止 */ |
| | | Stop = 30, |
| | | } |
| | | } |
| | |
| | | ...(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 || {}), |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
New file |
| | |
| | | /* 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 || {}), |
| | | } |
| | | ); |
| | | } |
New file |
| | |
| | | /* 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; |
| | | } |
| | |
| | | } |
| | | |
| | | interface APIdeleteModuleParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIdeleteRateChannelParams { |
| | | id?: string; |
| | | } |
| | | |
| | |
| | | interface APIsetLifePayChannelsStatusParams { |
| | | id?: string; |
| | | status?: LifePayChannelsStatsEnum; |
| | | } |
| | | |
| | | interface APIsetRateChannelStatusParams { |
| | | id?: string; |
| | | status?: LifePayRateChannelStatus; |
| | | } |
| | | |
| | | interface APIstatisticsByDateParams { |
| | |
| | | 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; |
| | |
| | | pageModel?: Pagination; |
| | | objectData?: any; |
| | | 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 { |
| | |
| | | groups?: FeatureGroupDto[]; |
| | | } |
| | | |
| | | interface GetLifePayAnnouncementPageInput { |
| | | pageModel?: Pagination; |
| | | creationTimeBegin?: string; |
| | | creationTimeEnd?: string; |
| | | startTime?: string; |
| | | endTime?: string; |
| | | status?: AnnouncementStatusEnum; |
| | | } |
| | | |
| | | interface GetOperateHistoryInput { |
| | | pageModel?: Pagination; |
| | | relationId?: string; |
| | |
| | | pageModel?: Pagination; |
| | | /** 查询条件:角色名称 */ |
| | | queryCondition?: string; |
| | | } |
| | | |
| | | interface GetShowingLifePayAnnouncementInput { |
| | | announcementType?: AnnouncementTypeEnum; |
| | | } |
| | | |
| | | interface IanaTimeZone { |
| | |
| | | rate?: number; |
| | | id?: string; |
| | | } |
| | | |
| | | type LifePayRateChannelStatus = 10 | -10; |
| | | |
| | | interface LifePayRateInput { |
| | | rateType?: LifePayRateTypeEnum; |
| | |
| | | phoneChargeOrder?: PhoneChargeOrderOutput; |
| | | } |
| | | |
| | | interface QueryRateChannelInput { |
| | | status?: LifePayRateChannelStatus; |
| | | } |
| | | |
| | | interface QueryUserAccountAllListInput { |
| | | pageModel?: Pagination; |
| | | checkChannelId?: string; |
| | |
| | | receiveList?: ReceiptsDetail[]; |
| | | /** 30天收入 */ |
| | | incomeList?: ReceiptsDetail[]; |
| | | } |
| | | |
| | | interface RefundAmount { |
| | | total: number; |
| | | refund: number; |
| | | payerTotal: string; |
| | | payerRefund: string; |
| | | } |
| | | |
| | | interface RefundLifePayOrderInput { |
| | |
| | | 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; |
| | | } |