| | |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { useLifeRechargeContext, CreateEditPayChannelsInput } from '@life-payment/core-vue'; |
| | | import { MaybeRef } from 'vue'; |
| | | |
| | | export function useOnlineService() { |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | |
| | | } |
| | | |
| | | type UseLifePayChannlesAllListOptions = { |
| | | params?: MaybeRef<API.QueryLifePayChannlesInput>; |
| | | onSuccess?: (data: API.CreateEditPayChannelsInput[]) => any; |
| | | }; |
| | | |
| | | export function useLifePayChannlesAllList(options: UseLifePayChannlesAllListOptions = {}) { |
| | | const { onSuccess } = options; |
| | | const { onSuccess, params = {} } = options; |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | |
| | | isLoading, |
| | | refetch, |
| | | } = useQuery({ |
| | | queryKey: ['blLifeRecharge/getLifePayChannlesAllList'], |
| | | queryKey: ['blLifeRecharge/getLifePayChannlesAllList', params], |
| | | queryFn: async () => { |
| | | return await blLifeRecharge.services.getLifePayChannlesAllList({ |
| | | return await blLifeRecharge.services.getLifePayChannlesAllList(unref(params), { |
| | | showLoading: false, |
| | | }); |
| | | }, |
| | |
| | | <div class="order-card-title-top"> |
| | | <div class="order-card-title-text">{{ title }}</div> |
| | | <div class="order-card-title-status"> |
| | | {{ LifeRechargeConstants.LifePayOrderFrontStatusEnumText[status] }} |
| | | {{ LifeRechargeConstants.LifePayOrderStatusEnumText[status] }} |
| | | </div> |
| | | </div> |
| | | <div class="order-card-title-ordernum-wrapper"> |
| | |
| | | <slot name="actions"> |
| | | <div |
| | | class="order-card-action" |
| | | v-if="status === LifeRechargeConstants.LifePayOrderFrontStatusEnum.支付成功" |
| | | v-if="status === LifeRechargeConstants.LifePayOrderStatusEnum.充值中" |
| | | @click="emit('goApplyRefund', id)" |
| | | > |
| | | 申请退款 |
| | | </div> |
| | | <div |
| | | class="order-card-action" |
| | | v-if="status === LifeRechargeConstants.LifePayOrderFrontStatusEnum.退款失败" |
| | | v-if="status === LifeRechargeConstants.LifePayOrderStatusEnum.退款失败" |
| | | @click="emit('goRefundDetail', orderNo)" |
| | | > |
| | | 详情 |
| | |
| | | |
| | | type Props = { |
| | | title: string; |
| | | status?: LifeRechargeConstants.LifePayOrderFrontStatusEnum; |
| | | status?: LifeRechargeConstants.LifePayOrderStatusEnum; |
| | | orderNo: string; |
| | | id: string; |
| | | }; |
| | |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as TopStatisticsOutput), |
| | | enabled: computed(() => blLifeRecharge.accountModel.userChannles.length > 0), |
| | | enabled: computed(() => blLifeRecharge.accountModel.isBackClientUser), |
| | | }); |
| | | </script> |
| | |
| | | <template #renderItem="{ item }"> |
| | | <OrderCard |
| | | title="电费充值" |
| | | :status="item?.frontStatus" |
| | | :status="item?.lifePayOrderStatus" |
| | | :order-no="item?.orderNo" |
| | | :id="item?.id" |
| | | @goApplyRefund="emit('goApplyRefund', $event)" |
| | |
| | | <template #renderItem="{ item }"> |
| | | <OrderCard |
| | | title="燃气充值" |
| | | :status="item?.frontStatus" |
| | | :status="item?.lifePayOrderStatus" |
| | | :order-no="item?.orderNo" |
| | | :id="item?.id" |
| | | @goApplyRefund="emit('goApplyRefund', $event)" |
| | |
| | | <template #renderItem="{ item }"> |
| | | <OrderCard |
| | | title="话费充值" |
| | | :status="item?.frontStatus" |
| | | :status="item?.lifePayOrderStatus" |
| | | :order-no="item?.orderNo" |
| | | :id="item?.id" |
| | | @goApplyRefund="emit('goApplyRefund', $event)" |
| | |
| | | export enum LifePayOrderStatusEnum { |
| | | 充值中 = 10, |
| | | |
| | | // 已失败 = 20, |
| | | /** |
| | | * @deprecated 仅作为老数据兼容判断 |
| | | */ |
| | | 已失败 = 20, |
| | | |
| | | 已完成 = 30, |
| | | |
| | |
| | | |
| | | export const LifePayOrderStatusEnumText = { |
| | | [LifePayOrderStatusEnum.充值中]: '充值中', |
| | | // [LifePayOrderStatusEnum.已失败]: '已失败', |
| | | [LifePayOrderStatusEnum.已失败]: '已失败', |
| | | [LifePayOrderStatusEnum.已完成]: '已完成', |
| | | [LifePayOrderStatusEnum.待退款]: '待退款', |
| | | [LifePayOrderStatusEnum.已退款]: '已退款', |
| | |
| | | 微信小程序 = 20, |
| | | 微信公众号 = 30, |
| | | } |
| | | |
| | | export enum LifePayChannelsStatsEnum { |
| | | 启用 = 10, |
| | | |
| | | 禁用 = 20, |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** 获取全部缴费渠道 GET /api/LifePay/GetLifePayChannlesAllList */ |
| | | async getLifePayChannlesAllList(options?: RequestConfig) { |
| | | async getLifePayChannlesAllList(body: QueryLifePayChannlesInput, options?: RequestConfig) { |
| | | return this.request<CreateEditPayChannelsInput[]>('/api/LifePay/GetLifePayChannlesAllList', { |
| | | method: 'GET', |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | |
| | | /** 昨日活跃用户 */ |
| | | yesterdayActiveUsers?: number; |
| | | } |
| | | |
| | | export interface QueryLifePayChannlesInput { |
| | | status?: LifeRechargeConstants.LifePayChannelsStatsEnum; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 同步订单 GET /api/LifePay/GetAllChannlesRake */ |
| | | /** 同步订单分佣信息 GET /api/LifePay/GetAllChannlesRake */ |
| | | export async function getAllChannlesRake(options?: API.RequestConfig) { |
| | | return request<any>('/api/LifePay/GetAllChannlesRake', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 统计交易流水 GET /api/LifePay/GetAllLifePayConsumption */ |
| | | export async function getAllLifePayConsumption(options?: API.RequestConfig) { |
| | | return request<any>('/api/LifePay/GetAllLifePayConsumption', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 渠道数据 POST /api/LifePay/GetChannelDataList */ |
| | | export async function getChannelDataList( |
| | | body: API.TopStatisticsInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.ChannelDataListOutPut>('/api/LifePay/GetChannelDataList', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取渠道折扣 POST /api/LifePay/GetChannelRate */ |
| | | export async function getChannelRate(body: API.ChannelsBaseInput, options?: API.RequestConfig) { |
| | | return request<API.ChannelRateOutput>('/api/LifePay/GetChannelRate', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 30日佣金列表 POST /api/LifePay/GetChannlesRakeList */ |
| | | export async function getChannlesRakeList( |
| | | body: API.TopStatisticsInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.ChannlesRakeListOutPut>('/api/LifePay/GetChannlesRakeList', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取全部缴费渠道 GET /api/LifePay/GetLifePayChannlesAllList */ |
| | | export async function getLifePayChannlesAllList(options?: API.RequestConfig) { |
| | | /** 获取全部缴费渠道 POST /api/LifePay/GetLifePayChannlesAllList */ |
| | | export async function getLifePayChannlesAllList( |
| | | body: API.QueryLifePayChannlesInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.CreateEditPayChannelsInput[]>('/api/LifePay/GetLifePayChannlesAllList', { |
| | | method: 'GET', |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取消费流水分页数据 POST /api/LifePay/GetLifePayConsumptionPage */ |
| | | export async function getLifePayConsumptionPage( |
| | | body: API.LifePayConsumptionPageInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.LifePayConsumptionListOutputPageOutput>( |
| | | '/api/LifePay/GetLifePayConsumptionPage', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** 获取收支流水分页数据 POST /api/LifePay/GetLifePayExpensesReceiptsPage */ |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取30日收款统计 POST /api/LifePay/GetReceiptsList */ |
| | | export async function getReceiptsList(body: API.TopStatisticsInput, options?: API.RequestConfig) { |
| | | return request<API.ReceiptsListOutPut>('/api/LifePay/GetReceiptsList', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取顶部统计数据 POST /api/LifePay/GetTopStatistics */ |
| | | export async function getTopStatistics(body: API.TopStatisticsInput, options?: API.RequestConfig) { |
| | | return request<API.TopStatisticsOutput>('/api/LifePay/GetTopStatistics', { |
| | |
| | | type?: number; |
| | | } |
| | | |
| | | interface ChannelDataListOutPut { |
| | | /** Top5渠道收款 */ |
| | | receiveList?: ChannelDataReceive[]; |
| | | /** Top5渠道用户 */ |
| | | userNumberList?: ChannelDataUserNumber[]; |
| | | } |
| | | |
| | | interface ChannelDataReceive { |
| | | /** 渠道名称 */ |
| | | channelName?: string; |
| | | /** 收款 */ |
| | | receivePrice?: number; |
| | | /** 佣金 */ |
| | | channlesRakePrice?: number; |
| | | } |
| | | |
| | | interface ChannelDataUserNumber { |
| | | /** 渠道名称 */ |
| | | channelName?: string; |
| | | /** 用户数量 */ |
| | | number?: number; |
| | | } |
| | | |
| | | interface ChannelOutput { |
| | | name?: string; |
| | | channlesNum?: string; |
| | |
| | | checkChannelId?: string; |
| | | } |
| | | |
| | | interface ChannlesRakeListOutPut { |
| | | /** 30天佣金 */ |
| | | channlesRakeList?: ReceiptsDetail[]; |
| | | } |
| | | |
| | | interface CheckLoginVerificationCodeInput { |
| | | messageType?: string; |
| | | phoneNumber: string; |
| | |
| | | interface ClockDto { |
| | | kind?: string; |
| | | } |
| | | |
| | | type ConsumptionFlowEnum = 10 | 20; |
| | | |
| | | type ConsumptionFrozenStatusEnum = 10 | 20; |
| | | |
| | | interface ControllerApiDescriptionModel { |
| | | controllerName?: string; |
| | |
| | | } |
| | | |
| | | type LifePayChannlesTypeEnum = 10 | 20; |
| | | |
| | | interface LifePayConsumptionListOutput { |
| | | /** 编号 */ |
| | | id?: string; |
| | | /** 平台订单号 */ |
| | | orderNo?: string; |
| | | /** 外部订单号 */ |
| | | acoolyOrderNo?: string; |
| | | /** 交易金额 */ |
| | | amount?: number; |
| | | acoolyStatus?: ACOOLYStatusEnum; |
| | | /** 记账时间 */ |
| | | finishTime?: string; |
| | | frozenStatus?: ConsumptionFrozenStatusEnum; |
| | | flow?: ConsumptionFlowEnum; |
| | | /** 扣款金额 */ |
| | | deductionAmount?: number; |
| | | /** 冻结金额 */ |
| | | frozenAmount?: number; |
| | | } |
| | | |
| | | interface LifePayConsumptionListOutputPageOutput { |
| | | pageModel?: Pagination; |
| | | objectData?: any; |
| | | data?: LifePayConsumptionListOutput[]; |
| | | } |
| | | |
| | | interface LifePayConsumptionPageInput { |
| | | pageModel?: Pagination; |
| | | checkChannelId?: string; |
| | | /** 查询条件 */ |
| | | keyWord?: string; |
| | | flow?: ConsumptionFlowEnum; |
| | | /** 记账开始时间 */ |
| | | timeBegin?: string; |
| | | /** 记账结束时间 */ |
| | | timeEnd?: string; |
| | | } |
| | | |
| | | interface LifePayExpensesReceiptsListOutput { |
| | | /** 编号 */ |
| | |
| | | providerKey?: string; |
| | | } |
| | | |
| | | interface QueryLifePayChannlesInput { |
| | | status?: LifePayChannelsStatsEnum; |
| | | } |
| | | |
| | | interface QueryLifePayOrderListInput { |
| | | pageModel?: Pagination; |
| | | checkChannelId?: string; |
| | |
| | | loginTimeEnd?: string; |
| | | } |
| | | |
| | | interface ReceiptsDetail { |
| | | /** 创建时间 */ |
| | | creationTime?: string; |
| | | /** 金额 */ |
| | | amount?: number; |
| | | } |
| | | |
| | | interface ReceiptsListOutPut { |
| | | /** 30天收款 */ |
| | | receiveList?: ReceiptsDetail[]; |
| | | /** 30天收入 */ |
| | | incomeList?: ReceiptsDetail[]; |
| | | } |
| | | |
| | | interface RefundLifePayOrderInput { |
| | | id?: string; |
| | | /** 上传凭证 */ |