zhengyiming
2025-03-27 55c03f35a31979aefd46aead13a145c9b293e6d8
fix: 四期需求
12个文件已修改
1个文件已添加
479 ■■■■■ 已修改文件
apps/taro/src/hooks/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/hooks/lifepay.ts 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/pages/mine/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/stores/modules/user.ts 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/login/loginByForm/verificationCodeLoginForm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/my/shareQrcode/InnerPage.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/Mine/ShareQrcodeView.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRecharge.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeAccountModel.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeServices.ts 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/Account.ts 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/LifePay.ts 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/typings.d.ts 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/hooks/index.ts
@@ -3,3 +3,4 @@
export * from './access';
export * from './login';
export * from './infiniteLoading';
export * from './lifepay';
apps/taro/src/hooks/lifepay.ts
New file
@@ -0,0 +1,60 @@
import { useQuery } from '@tanstack/vue-query';
import { useLifeRechargeContext, CreateEditPayChannelsInput } from '@life-payment/core-vue';
export function useOnlineService() {
  const { blLifeRecharge } = useLifeRechargeContext();
  const { data } = useQuery({
    queryKey: ['blLifeRecharge/getOnlineService'],
    queryFn: async () => {
      return await blLifeRecharge.services.getOnlineService({
        showLoading: false,
      });
    },
    placeholderData: () => '',
  });
  return {
    onlineServiceLink: data,
  };
}
type UseLifePayChannlesAllListOptions = {
  onSuccess?: (data: API.CreateEditPayChannelsInput[]) => any;
};
export function useLifePayChannlesAllList(options: UseLifePayChannlesAllListOptions = {}) {
  const { onSuccess } = options;
  const { blLifeRecharge } = useLifeRechargeContext();
  const {
    data: allChannlesList,
    isLoading,
    refetch,
  } = useQuery({
    queryKey: ['blLifeRecharge/getLifePayChannlesAllList'],
    queryFn: async () => {
      return await blLifeRecharge.services.getLifePayChannlesAllList({
        showLoading: false,
      });
    },
    placeholderData: () => [] as CreateEditPayChannelsInput[],
    onSuccess: (data) => {
      onSuccess?.(data);
    },
  });
  function getChannlesNameByNum(channlesNum: string) {
    return (
      allChannlesList.value.find((item) => item.channlesNum === channlesNum)?.channlesName ?? ''
    );
  }
  return {
    allChannlesList,
    isLoading,
    refetch,
    getChannlesNameByNum,
  };
}
apps/taro/src/pages/mine/index.vue
@@ -25,7 +25,7 @@
          <ListItem title="数据看板" @click="goDashboard"></ListItem>
          <ListItem title="推广二维码" @click="goShareQrcode"></ListItem>
        </template>
        <ListItem v-if="isWeb" title="在线客服" @click="handleChat"></ListItem>
        <ListItem v-if="isWeb && !isInAlipay" title="在线客服" @click="handleChat"></ListItem>
        <ListItem v-if="isLogin" title="退出登录" @click="goLogout"></ListItem>
      </List>
    </ContentScrollView>
@@ -34,7 +34,7 @@
<script setup lang="ts">
import { TransparentNavigationBar, List, ListItem } from '@/components';
import { useUser, useIsLogin, useGoLogin, useAccessLogin } from '@/hooks';
import { useUser, useIsLogin, useGoLogin, useAccessLogin, useOnlineService } from '@/hooks';
import Taro from '@tarojs/taro';
import { RouterPath, OssAssets } from '@/constants';
import DefaultAvatar from '@/assets/components/icon-default-avatar.png';
@@ -42,7 +42,7 @@
import PageLayoutWithBg from '@/components/Layout/PageLayoutWithBg.vue';
import { useUserStore } from '@/stores/modules/user';
import { Message } from '@/utils';
import { isWeb } from '@/utils/env';
import { isWeb, isInAlipay } from '@/utils/env';
import { useLifeRechargeContext } from '@life-payment/core-vue';
import { hiddenPhoneNumber } from '@life-payment/utils';
@@ -93,9 +93,15 @@
  } catch (error) {}
}
const { onlineServiceLink } = useOnlineService();
function handleChat() {
  if (isWeb) {
    window.open('https://work.weixin.qq.com/kfid/kfcd24e0c60fd91099e', '_blank');
  if (isWeb && onlineServiceLink.value) {
    if (isInAlipay) {
      Message.warning('请在微信中打开使用该功能');
    } else {
      window.open(onlineServiceLink.value, '_blank');
    }
  }
}
</script>
apps/taro/src/stores/modules/user.ts
@@ -140,7 +140,7 @@
      if (res) {
        this.loginVirtualSuccess({
          virtualUserId: res,
          virtualUserId: res.userId,
          virtualPhoneNumber: data.phoneNumber,
        });
      }
@@ -220,8 +220,6 @@
      try {
        // let res = await userServices.getUserInfo({ showLoading: false });
        // if (res) {
        //   res.originalAvatarUrl = res.avatarUrl;
        //   res.avatarUrl = res.avatarUrl ? setOSSLink(res.avatarUrl) : DefaultAvatar;
        //   this.setUserDetail(res);
        //   this.firstGetUserDetail = false;
        // }
apps/taro/src/subpackages/login/loginByForm/verificationCodeLoginForm.vue
@@ -104,7 +104,7 @@
        );
        userStore.loginVirtualSuccess({
          virtualPhoneNumber: form.phoneNumber,
          virtualUserId: res,
          virtualUserId: res.userId,
        });
        jump();
      }
apps/taro/src/subpackages/my/shareQrcode/InnerPage.vue
@@ -1,12 +1,23 @@
<template>
  <ContentScrollView>
    <ShareQrcodeView />
  </ContentScrollView>
  <ProTabs v-model="orderType" name="user-home-tabs" class="user-home-tabs" flexTitle fullHeight>
    <ProTabPane title="话费订单" pane-key="1">
      <ShareQrcodeView :channles-num="'818'" />
    </ProTabPane>
    <ProTabPane title="电费订单" pane-key="2">
      <ShareQrcodeView :channles-num="'818'" />
    </ProTabPane>
  </ProTabs>
</template>
<script setup lang="ts">
import { ShareQrcodeView } from '@life-payment/components';
import { useLifePayChannlesAllList } from '@/hooks';
defineOptions({
  name: 'InnerPage',
});
const orderType = ref('1');
const { getChannlesNameByNum } = useLifePayChannlesAllList();
</script>
packages/components/src/views/Mine/ShareQrcodeView.vue
@@ -13,9 +13,13 @@
  name: 'ShareQrcodeView',
});
type Props = {
  channlesNum?: string;
};
const props = withDefaults(defineProps<Props>(), {});
const { blLifeRecharge } = useLifeRechargeContext();
const link = computed(
  () => `${CLIENT_ORIGIN}?channelId=${blLifeRecharge.accountModel.channlesNum}`
);
const link = computed(() => `${CLIENT_ORIGIN}?channelId=${props.channlesNum}`);
</script>
packages/core/src/lifeRecharge.ts
@@ -26,7 +26,7 @@
  async login(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
    try {
      let res = await this.services.lifePayPhoneMesssageCodeLogin(body, options);
      this.accountModel.setUserId(res);
      this.accountModel.setUserId(res.userId);
      this.accountModel.setPhoneNumber(body.phoneNumber);
      return res;
    } catch (error) {
packages/core/src/lifeRechargeAccountModel.ts
@@ -1,4 +1,5 @@
import { BlLifeRechargeAccountModelOptions } from './types';
import { LifePayPhoneMesssageCodeLoginOutput } from './lifeRechargeServices';
export class BlLifeRechargeAccountModel {
  userId = '';
packages/core/src/lifeRechargeServices.ts
@@ -42,14 +42,17 @@
  }
  async lifePayPhoneMesssageCodeLogin(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
    return this.request<string>('/api/Account/LifePayPhoneMesssageCodeLogin', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
    return this.request<LifePayPhoneMesssageCodeLoginOutput>(
      '/api/Account/LifePayPhoneMesssageCodeLogin',
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
      }
    );
  }
  /** 获取折扣 GET /api/LifePay/GetRate */
@@ -335,6 +338,22 @@
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
  /** 获取在线客服 GET /api/LifePay/GetOnlineService */
  async getOnlineService(options?: RequestConfig) {
    return this.request<string>('/api/LifePay/GetOnlineService', {
      method: 'GET',
      ...(options || {}),
    });
  }
  /** 获取全部缴费渠道 GET /api/LifePay/GetLifePayChannlesAllList */
  async getLifePayChannlesAllList(options?: RequestConfig) {
    return this.request<CreateEditPayChannelsInput[]>('/api/LifePay/GetLifePayChannlesAllList', {
      method: 'GET',
      ...(options || {}),
    });
  }
@@ -775,3 +794,20 @@
export interface ChannelRateOutput {
  channlesRate?: number;
}
export interface CreateEditPayChannelsInput {
  id?: string;
  channlesName?: string;
  channlesNum?: string;
  channlesRate?: number;
  channlesRakeRate?: number;
}
export interface LifePayPhoneMesssageCodeLoginOutput {
  /** 用户Id */
  userId?: string;
  /** 是否是后台用户 */
  isBackClientUser?: boolean;
  /** 渠道号 */
  channlesNum?: string[];
}
packages/services/api/Account.ts
@@ -42,14 +42,17 @@
  body: API.LifePayPhoneMesssageCodeLoginInput,
  options?: API.RequestConfig
) {
  return request<string>('/api/Account/LifePayPhoneMesssageCodeLogin', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
  return request<API.LifePayPhoneMesssageCodeLoginOutput>(
    '/api/Account/LifePayPhoneMesssageCodeLogin',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 此处后端没有提供注释 GET /api/accountAuth/GetCode */
packages/services/api/LifePay.ts
@@ -14,6 +14,21 @@
  });
}
/** 上传充值流水 POST /api/LifePay/AddUpdatePayRechargeReceipts */
export async function addUpdatePayRechargeReceipts(
  body: API.AddUpdatePayRechargeReceiptsInput,
  options?: API.RequestConfig
) {
  return request<number>('/api/LifePay/AddUpdatePayRechargeReceipts', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 添加或修改我的户号 POST /api/LifePay/AddUpdateUserAccount */
export async function addUpdateUserAccount(
  body: API.AddUpdateUserAccountInput,
@@ -337,6 +352,24 @@
  });
}
/** 获取充值流水分页数据 POST /api/LifePay/GetLifePayRechargeReceiptsPage */
export async function getLifePayRechargeReceiptsPage(
  body: API.LifePayRechargeReceiptsPageInput,
  options?: API.RequestConfig
) {
  return request<API.LifePayRechargeReceiptsListOutputLifePayRechargeReceiptsPageOutput>(
    '/api/LifePay/GetLifePayRechargeReceiptsPage',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 导出退款订单Excel POST /api/LifePay/GetLifePayRefudOrderPageExport */
export async function getLifePayRefudOrderPageExport(
  body: API.QueryLifePayRefundOrderListInput,
@@ -378,6 +411,14 @@
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取在线客服 GET /api/LifePay/GetOnlineService */
export async function getOnlineService(options?: API.RequestConfig) {
  return request<string>('/api/LifePay/GetOnlineService', {
    method: 'GET',
    ...(options || {}),
  });
}
@@ -550,6 +591,33 @@
  });
}
/** 查询支付宝支付订单信息 POST /api/LifePay/QueryAlipayTrade */
export async function queryAlipayTrade(body: API.OrderInQuiryInput, options?: API.RequestConfig) {
  return request<API.AlipayTradeQueryResponse>('/api/LifePay/QueryAlipayTrade', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 查询支付宝退款订单信息 POST /api/LifePay/QueryAlipayTradeRefund */
export async function queryAlipayTradeRefund(
  body: API.OrderInQuiryInput,
  options?: API.RequestConfig
) {
  return request<API.AlipayTradeFastpayRefundQueryResponse>('/api/LifePay/QueryAlipayTradeRefund', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 退款生活缴费订单 POST /api/LifePay/RefundLifePayOrder */
export async function refundLifePayOrder(
  body: API.RefundLifePayOrderInput,
@@ -624,3 +692,48 @@
    ...(options || {}),
  });
}
/** 修改实际到账金额 POST /api/LifePay/UpdateLifePayOrderActualReceivedAmount */
export async function updateLifePayOrderActualReceivedAmount(
  body: API.UpdateLifePayOrderInput,
  options?: API.RequestConfig
) {
  return request<number>('/api/LifePay/UpdateLifePayOrderActualReceivedAmount', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 在线客服配置 POST /api/LifePay/UpdateOnlineService */
export async function updateOnlineService(
  body: API.OnlineServiceInput,
  options?: API.RequestConfig
) {
  return request<number>('/api/LifePay/UpdateOnlineService', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 此处后端没有提供注释 GET /api/LifePay/WxPayDomesticRefundsQuery */
export async function wxPayDomesticRefundsQuery(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIwxPayDomesticRefundsQueryParams,
  options?: API.RequestConfig
) {
  return request<any>('/api/LifePay/WxPayDomesticRefundsQuery', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
packages/services/api/typings.d.ts
@@ -30,6 +30,19 @@
    implementFrom?: string;
  }
  interface AddUpdatePayRechargeReceiptsInput {
    /** 编号 */
    id?: string;
    /** 业务订单号 */
    orderNo?: string;
    /** 充值金额 */
    rechargeAmount?: number;
    /** 备注 */
    remark?: string;
    /** 充值凭证 */
    voucher?: string;
  }
  interface AddUpdateUserAccountInput {
    pageModel?: Pagination;
    checkChannelId?: string;
@@ -49,6 +62,75 @@
    extraProperties?: string;
    /** 备注 */
    remark?: string;
  }
  interface AlipayTradeFastpayRefundQueryResponse {
    httpBody?: string;
    code?: string;
    msg?: string;
    subCode?: string;
    subMsg?: string;
    errorCode?: string;
    gmtRefundPay?: string;
    industrySepcDetail?: string;
    outRequestNo?: string;
    outTradeNo?: string;
    presentRefundBuyerAmount?: string;
    presentRefundDiscountAmount?: string;
    presentRefundMdiscountAmount?: string;
    refundAmount?: string;
    refundChargeAmount?: string;
    refundDetailItemList?: TradeFundBill[];
    refundReason?: string;
    refundRoyaltys?: RefundRoyaltyResult[];
    refundSettlementId?: string;
    refundStatus?: string;
    sendBackFee?: string;
    totalAmount?: string;
    tradeNo?: string;
  }
  interface AlipayTradeQueryResponse {
    httpBody?: string;
    code?: string;
    msg?: string;
    subCode?: string;
    subMsg?: string;
    tradeNo?: string;
    outTradeNo?: string;
    buyerLogonId?: string;
    tradeStatus?: string;
    totalAmount?: string;
    transCurrency?: string;
    settleCurrency?: string;
    settleAmount?: string;
    payCurrency?: string;
    payAmount?: string;
    settleTransRate?: string;
    transPayRate?: string;
    buyerPayAmount?: string;
    pointAmount?: string;
    invoiceAmount?: string;
    sendPayDate?: string;
    receiptAmount?: string;
    storeId?: string;
    terminalId?: string;
    fundBillList?: TradeFundBill[];
    storeName?: string;
    buyerUserId?: string;
    chargeAmount?: string;
    chargeFlags?: string;
    settlementId?: string;
    tradeSettleInfo?: TradeSettleInfo[];
    authTradePayMode?: string;
    buyerUserType?: string;
    mdiscountAmount?: string;
    discountAmount?: string;
    buyerUserName?: string;
    subject?: string;
    body?: string;
    alipaySubMerchantId?: string;
    extInfos?: string;
  }
  interface AllSubModule {
@@ -330,6 +412,10 @@
  interface APIupdateRolesParams {
    id?: string;
  }
  interface APIwxPayDomesticRefundsQueryParams {
    outTradeNo?: string;
  }
  interface ApplicationApiDescriptionModel {
@@ -1203,6 +1289,15 @@
    phoneNumber: string;
  }
  interface LifePayPhoneMesssageCodeLoginOutput {
    /** 用户Id */
    userId?: string;
    /** 是否是后台用户 */
    isBackClientUser?: boolean;
    /** 渠道号 */
    channlesNum?: string[];
  }
  interface LifePayPremiumInput {
    premiumType?: LifePayTypeEnum;
    rate?: number;
@@ -1228,6 +1323,40 @@
  }
  type LifePayRateTypeEnum = 10 | 20 | 30 | 40;
  interface LifePayRechargeReceiptsListOutput {
    /** 编号 */
    id?: string;
    /** 业务订单号 */
    orderNo?: string;
    /** 充值金额 */
    rechargeAmount?: number;
    /** 备注 */
    remark?: string;
    /** 凭证 */
    voucher?: string;
    /** 记账时间 */
    creationTime?: string;
  }
  interface LifePayRechargeReceiptsListOutputLifePayRechargeReceiptsPageOutput {
    pageModel?: Pagination;
    objectData?: any;
    data?: LifePayRechargeReceiptsListOutput[];
    /** 累计充值 */
    totalRechargeAmount?: number;
  }
  interface LifePayRechargeReceiptsPageInput {
    pageModel?: Pagination;
    checkChannelId?: string;
    /** 查询条件 */
    keyWord?: string;
    /** 记账开始时间 */
    creationTimeBegin?: string;
    /** 记账结束时间 */
    creationTimeEnd?: string;
  }
  interface LifePayRefundOrderOutput {
    id?: string;
@@ -1435,6 +1564,11 @@
    enums?: Record<string, any>;
  }
  interface OnlineServiceInput {
    /** 在线客服链接 */
    link?: string;
  }
  interface OperateHistoryDto {
    /** 关联关系ID */
    relationId?: string;
@@ -1489,6 +1623,10 @@
  interface OrderInput {
    property?: string;
    order?: OrderTypeEnum;
  }
  interface OrderInQuiryInput {
    outTradeNo?: string;
  }
  type OrderTypeEnum = 0 | 1;
@@ -1677,9 +1815,14 @@
    checkChannelId?: string;
    /** 手机号/用户名 */
    queryCondition?: string;
    /** 注册时间 */
    /** 注册开始时间 */
    creationTimeBegin?: string;
    /** 注册结束时间 */
    creationTimeEnd?: string;
    /** 登录开始时间 */
    loginTimeBegin?: string;
    /** 登录结束时间 */
    loginTimeEnd?: string;
  }
  interface RefundLifePayOrderInput {
@@ -1691,6 +1834,16 @@
    lifePayRefundType?: LifePayRefundTypeEnum;
    /** 退款金额 */
    refundPrice?: number;
  }
  interface RefundRoyaltyResult {
    refundAmount?: string;
    royaltyType?: string;
    resultCode?: string;
    transOut?: string;
    transOutEmail?: string;
    transIn?: string;
    transInEmail?: string;
  }
  interface RefundUserLifePayOrderInput {
@@ -1892,6 +2045,27 @@
    yesterdayActiveUsers?: number;
  }
  interface TradeFundBill {
    fundChannel?: string;
    bankCode?: string;
    amount?: string;
    realAmount?: string;
    fundType?: string;
  }
  interface TradeSettleDetail {
    operationType?: string;
    operationSerial_no?: string;
    operationDt?: string;
    transOut?: string;
    transIn?: string;
    amount?: string;
  }
  interface TradeSettleInfo {
    tradeSettleDetailList?: TradeSettleDetail[];
  }
  interface TypeApiDescriptionModel {
    baseType?: string;
    isEnum?: boolean;
@@ -1932,6 +2106,12 @@
    features?: UpdateFeatureDto[];
  }
  interface UpdateLifePayOrderInput {
    id?: string;
    /** 实际到账金额 */
    actualReceivedAmount?: number;
  }
  interface UpdatePassWordInput {
    id?: string;
    passWord?: string;