zhengyiming
2025-03-12 db365a5eff31c040c42463df4966bf34a5de6a6d
fix: 二期需求
36个文件已修改
20个文件已添加
42251 ■■■■ 已修改文件
apps/taro/config/staging.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/app.config.ts 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/constants/router.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/pages/mine/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/order/order/InnerPage.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/order/orderApplyRefund/InnerPage.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/order/orderRefundResult/InnerPage.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/order/orderRefundResult/orderRefundResult.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/order/orderRefundResult/orderRefundResult.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/recharge/rechargeGasResult/rechargeGasResult.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/recharge/rechargeGasResult/rechargeGasResult.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editElectricUserAccount/InnerPage.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editElectricUserAccount/editElectricUserAccount.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editElectricUserAccount/editElectricUserAccount.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editGasUserAccount/InnerPage.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editGasUserAccount/editGasUserAccount.confg.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editGasUserAccount/editGasUserAccount.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editPhoneUserAccount/InnerPage.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editPhoneUserAccount/editPhoneUserAccount.config.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/editPhoneUserAccount/editPhoneUserAccount.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/subpackages/userAccount/userAccountList/InnerPage.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/utils/blLifeRecharge.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/package.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/components/Card/OrderCard.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/components/Input/ChooseInputWithAreaPicker.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/hooks/area.ts 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/hooks/index.ts 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/index.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/styles/components.scss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/utils/validator.ts 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/GasBillRecharge.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/GasBillRechargeStep1.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/GasBillRechargeStep2.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/context.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/Order/OrderApplyRefundView.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/Order/OrderRefundResultView.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/Order/components/ElectricOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/Order/components/GasOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/Order/components/PhoneOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/RechargeResultView/RechargeResultView.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep1.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/userAccount/EditElectricUserAccount.vue 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/userAccount/EditGasUserAccount.vue 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/userAccount/EditPhoneUserAccount.vue 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/userAccount/UserAccountListView.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRecharge.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeAccountModel.ts 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeServices.ts 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/types.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/LifePay.ts 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/typings.d.ts 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/utils/common.ts 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pnpm-lock.yaml 40873 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/config/staging.js
@@ -4,7 +4,7 @@
  env: {
    // BASE_URL: '"https://testrlywx.boleyuma.com"',
    BASE_URL: '"https://api.81812333.com"',
    BASE_URL_H5: '"http://118.178.252.28:8742"',
    BASE_URL_H5: '"https://testrlywx.boleyuma.com"',
    BASE_URL_JX: '"https://api.jx818.com"',
    OSS_URL: '"https://waterdroptest2.oss-cn-hangzhou.aliyuncs.com/"',
apps/taro/src/app.config.ts
@@ -60,15 +60,25 @@
        'selectPayType/selectPayType',
        'rechargeResult/rechargeResult',
        'rechargeElectricResult/rechargeElectricResult',
        'rechargeGasResult/rechargeGasResult',
      ],
    },
    {
      root: 'subpackages/order',
      pages: ['order/order', 'orderApplyRefund/orderApplyRefund'],
      pages: [
        'order/order',
        'orderApplyRefund/orderApplyRefund',
        'orderRefundResult/orderRefundResult',
      ],
    },
    {
      root: 'subpackages/userAccount',
      pages: ['userAccountList/userAccountList'],
      pages: [
        'userAccountList/userAccountList',
        'editGasUserAccount/editGasUserAccount',
        'editPhoneUserAccount/editPhoneUserAccount',
        'editElectricUserAccount/editElectricUserAccount',
      ],
    },
  ],
  // preloadRule: {
apps/taro/src/constants/router.ts
@@ -14,8 +14,13 @@
  selectPayType = '/subpackages/recharge/selectPayType/selectPayType',
  rechargeResult = '/subpackages/recharge/rechargeResult/rechargeResult',
  rechargeElectricResult = '/subpackages/recharge/rechargeElectricResult/rechargeElectricResult',
  rechargeGasResult = '/subpackages/recharge/rechargeGasResult/rechargeGasResult',
  order = '/subpackages/order/order/order',
  orderApplyRefund = '/subpackages/order/orderApplyRefund/orderApplyRefund',
  orderRefundResult = '/subpackages/order/orderRefundResult/orderRefundResult',
  userAccountList = '/subpackages/userAccount/userAccountList/userAccountList',
  editGasUserAccount = '/subpackages/userAccount/editGasUserAccount/editGasUserAccount',
  editPhoneUserAccount = '/subpackages/userAccount/editPhoneUserAccount/editPhoneUserAccount',
  editElectricUserAccount = '/subpackages/userAccount/editElectricUserAccount/editElectricUserAccount',
}
apps/taro/src/pages/mine/index.vue
@@ -13,7 +13,7 @@
    <div class="mine-page-top-view" @click="goLogin">
      <img class="mine-avatar" :src="DefaultAvatar" alt="" />
      <div class="user-info">
        <div class="user-info-name" v-if="isLogin">{{ virtualPhoneNumber }}</div>
        <div class="user-info-name" v-if="isLogin">{{ hiddenPhoneNumber(virtualPhoneNumber) }}</div>
        <div class="mine-go-login" v-else>登录</div>
      </div>
    </div>
@@ -38,6 +38,7 @@
import { useUserStore } from '@/stores/modules/user';
import { Message } from '@/utils';
import { useLifeRechargeContext } from '@life-payment/core-vue';
import { hiddenPhoneNumber } from '@life-payment/utils';
const { userDetail, virtualPhoneNumber } = useUser();
const isLogin = useIsLogin();
apps/taro/src/subpackages/order/order/InnerPage.vue
@@ -22,9 +22,9 @@
const orderType = ref('1');
function goApplyRefund(orderNo: string) {
function goApplyRefund(id: string) {
  Taro.navigateTo({
    url: `${RouterPath.orderApplyRefund}?orderNo=${orderNo}`,
    url: `${RouterPath.orderApplyRefund}?id=${id}`,
    // events: {
    //   submitApplyRefund: function () {},
    // },
@@ -32,7 +32,7 @@
}
function goRefundDetail(orderNo: string) {
  Taro.navigateTo({
    url: `${RouterPath.orderApplyRefund}?orderNo=${orderNo}`,
    url: `${RouterPath.orderRefundResult}?orderNo=${orderNo}`,
  });
}
</script>
apps/taro/src/subpackages/order/orderApplyRefund/InnerPage.vue
@@ -1,17 +1,22 @@
<template>
  <ContentScrollView :paddingH="false">
    <OrderApplyRefundView :orderNo="orderNo" />
    <OrderApplyRefundView :id="id" @submitApplyRefund="submitApplyRefund" />
  </ContentScrollView>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro';
import { OrderApplyRefundView } from '@life-payment/components';
import { goBack } from '@/utils';
defineOptions({
  name: 'InnerPage',
});
const router = Taro.useRouter();
const orderNo = router.params?.orderNo ?? '';
const id = router.params?.id ?? '';
function submitApplyRefund() {
  goBack();
}
</script>
apps/taro/src/subpackages/order/orderRefundResult/InnerPage.vue
New file
@@ -0,0 +1,22 @@
<template>
  <ContentScrollView>
    <OrderRefundResultView
      style="margin-top: 40px"
      @go-back-home="goHome()"
      :orderNo="orderNo"
    ></OrderRefundResultView>
  </ContentScrollView>
</template>
<script setup lang="ts">
import { OrderRefundResultView } from '@life-payment/components';
import { goHome } from '@/utils';
import Taro from '@tarojs/taro';
defineOptions({
  name: 'InnerPage',
});
const router = Taro.useRouter();
const orderNo = router.params?.orderNo ?? '';
</script>
apps/taro/src/subpackages/order/orderRefundResult/orderRefundResult.config.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/taro/src/subpackages/order/orderRefundResult/orderRefundResult.vue
New file
@@ -0,0 +1,14 @@
<template>
  <PageLayout title="申请退款" class="orderRefundResult-page-wrapper" hasBorder>
    <InnerPage />
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import InnerPage from './InnerPage.vue';
defineOptions({
  name: 'orderRefundResult',
});
</script>
apps/taro/src/subpackages/recharge/rechargeGasResult/rechargeGasResult.config.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/taro/src/subpackages/recharge/rechargeGasResult/rechargeGasResult.vue
New file
@@ -0,0 +1,25 @@
<template>
  <PageLayout title="充值成功" class="rechargeGasResult-page-wrapper" hasBorder>
    <ContentScrollView>
      <RechargeResultView
        style="margin-top: 40px"
        @go-back-home="goHome()"
        title="支付成功,充值款将在0-72小时内到账"
      >
        <template #tips>
          同一燃气费账户在充值期间,未到账前切勿在其他任何平台再次充值。因此造成的资金损失须用户自行承担!!!
        </template>
      </RechargeResultView>
    </ContentScrollView>
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import { goHome } from '@/utils';
import { RechargeResultView } from '@life-payment/components';
defineOptions({
  name: 'rechargeGasResult',
});
</script>
apps/taro/src/subpackages/recharge/selectPayType/InnerPage.vue
@@ -48,6 +48,10 @@
    Taro.navigateTo({
      url: `${RouterPath.rechargeElectricResult}?orderNo=${orderNo}&lifePayOrderType=${lifePayOrderType}`,
    });
  } else if (lifePayOrderType === LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单) {
    Taro.navigateTo({
      url: `${RouterPath.rechargeGasResult}?orderNo=${orderNo}&lifePayOrderType=${lifePayOrderType}`,
    });
  }
}
</script>
apps/taro/src/subpackages/userAccount/editElectricUserAccount/InnerPage.vue
New file
@@ -0,0 +1,22 @@
<template>
  <ContentScrollView :paddingH="false">
    <EditElectricUserAccount :id="id" @success="handleSuccess" />
  </ContentScrollView>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro';
import { EditElectricUserAccount } from '@life-payment/components';
import { goBack } from '@/utils';
defineOptions({
  name: 'InnerPage',
});
const router = Taro.useRouter();
const id = router.params?.id ?? '';
function handleSuccess() {
  goBack();
}
</script>
apps/taro/src/subpackages/userAccount/editElectricUserAccount/editElectricUserAccount.config.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/taro/src/subpackages/userAccount/editElectricUserAccount/editElectricUserAccount.vue
New file
@@ -0,0 +1,14 @@
<template>
  <PageLayout title="编辑" class="editElectricUserAccount-page-wrapper" hasBorder>
    <InnerPage />
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import InnerPage from './InnerPage.vue';
defineOptions({
  name: 'editElectricUserAccount',
});
</script>
apps/taro/src/subpackages/userAccount/editGasUserAccount/InnerPage.vue
New file
@@ -0,0 +1,22 @@
<template>
  <ContentScrollView :paddingH="false">
    <EditGasUserAccount :id="id" @success="handleSuccess" />
  </ContentScrollView>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro';
import { EditGasUserAccount } from '@life-payment/components';
import { goBack } from '@/utils';
defineOptions({
  name: 'InnerPage',
});
const router = Taro.useRouter();
const id = router.params?.id ?? '';
function handleSuccess() {
  goBack();
}
</script>
apps/taro/src/subpackages/userAccount/editGasUserAccount/editGasUserAccount.confg.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/taro/src/subpackages/userAccount/editGasUserAccount/editGasUserAccount.vue
New file
@@ -0,0 +1,14 @@
<template>
  <PageLayout title="编辑" class="editGasUserAccount-page-wrapper" hasBorder>
    <InnerPage />
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import InnerPage from './InnerPage.vue';
defineOptions({
  name: 'editGasUserAccount',
});
</script>
apps/taro/src/subpackages/userAccount/editPhoneUserAccount/InnerPage.vue
New file
@@ -0,0 +1,22 @@
<template>
  <ContentScrollView :paddingH="false">
    <EditPhoneUserAccount :id="id" @success="handleSuccess" />
  </ContentScrollView>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro';
import { EditPhoneUserAccount } from '@life-payment/components';
import { goBack } from '@/utils';
defineOptions({
  name: 'InnerPage',
});
const router = Taro.useRouter();
const id = router.params?.id ?? '';
function handleSuccess() {
  goBack();
}
</script>
apps/taro/src/subpackages/userAccount/editPhoneUserAccount/editPhoneUserAccount.config.ts
New file
@@ -0,0 +1,3 @@
export default definePageConfig({
  disableScroll: true,
});
apps/taro/src/subpackages/userAccount/editPhoneUserAccount/editPhoneUserAccount.vue
New file
@@ -0,0 +1,14 @@
<template>
  <PageLayout title="编辑" class="editPhoneUserAccount-page-wrapper" hasBorder>
    <InnerPage />
  </PageLayout>
</template>
<script setup lang="ts">
import { PageLayout } from '@/components';
import InnerPage from './InnerPage.vue';
defineOptions({
  name: 'editPhoneUserAccount',
});
</script>
apps/taro/src/subpackages/userAccount/userAccountList/InnerPage.vue
@@ -1,11 +1,29 @@
<template>
  <UserAccountListView />
  <UserAccountListView @go-edit="handleGoEdit" />
</template>
<script setup lang="ts">
import { UserAccountListView } from '@life-payment/components';
import { UserAccountListOutput, LifeRechargeConstants } from '@life-payment/core-vue';
import Taro from '@tarojs/taro';
defineOptions({
  name: 'InnerPage',
});
function handleGoEdit(row: UserAccountListOutput) {
  if (row.lifePayType === LifeRechargeConstants.LifePayOrderTypeEnum.话费订单) {
    Taro.navigateTo({
      url: `${RouterPath.editPhoneUserAccount}?id=${row.id}`,
    });
  } else if (row.lifePayType === LifeRechargeConstants.LifePayOrderTypeEnum.电费订单) {
    Taro.navigateTo({
      url: `${RouterPath.editElectricUserAccount}?id=${row.id}`,
    });
  } else if (row.lifePayType === LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单) {
    Taro.navigateTo({
      url: `${RouterPath.editGasUserAccount}?id=${row.id}`,
    });
  }
}
</script>
apps/taro/src/utils/blLifeRecharge.ts
@@ -7,4 +7,5 @@
  axiosConfig: config,
  userId: getStorageVirtualUserId()?.virtualUserId ?? '',
  phoneNumber: getStorageVirtualUserId()?.virtualPhoneNumber ?? '',
  channlesNum: '818',
});
packages/components/package.json
@@ -45,6 +45,7 @@
    "@life-payment/core-vue": "workspace:^",
    "@nutui/icons-vue-taro": "0.0.9",
    "@nutui/nutui-taro": "4.3.13",
    "@tanstack/vue-query": "4.35.3",
    "@tarojs/components": "3.6.20",
    "@tarojs/taro": "3.6.20",
    "@vitejs/plugin-vue": "^5.1.4",
@@ -57,6 +58,7 @@
  "peerDependencies": {
    "@life-payment/core-vue": "*",
    "@nutui/nutui-taro": "*",
    "@tanstack/vue-query": "4.35.3",
    "@tarojs/components": "*",
    "@tarojs/taro": "*",
    "vue": "*"
packages/components/src/components/Card/OrderCard.vue
@@ -15,7 +15,7 @@
          <div
            class="order-card-action"
            v-if="status === LifeRechargeConstants.LifePayOrderFrontStatusEnum.支付成功"
            @click="emit('goApplyRefund', orderNo)"
            @click="emit('goApplyRefund', id)"
          >
            申请退款
          </div>
@@ -46,12 +46,13 @@
  title: string;
  status: LifeRechargeConstants.LifePayOrderFrontStatusEnum;
  orderNo: string;
  id: string;
};
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'goApplyRefund', orderNo: string): void;
  (e: 'goApplyRefund', id: string): void;
  (e: 'goRefundDetail', orderNo: string): void;
}>();
</script>
packages/components/src/components/Input/ChooseInputWithAreaPicker.vue
New file
@@ -0,0 +1,62 @@
<template>
  <ChooseInput :modelValue="inputValue" @click="handleOpen()" v-bind="$attrs"></ChooseInput>
  <NutPopup v-model:visible="visible" position="bottom">
    <NutPicker
      :modelValue="modelValue"
      :columns="columns"
      :fieldNames="fieldNames"
      :title="title"
      @cancel="visible = false"
      @confirm="handleConfirm"
    >
    </NutPicker>
  </NutPopup>
</template>
<script setup lang="ts">
// import { useAllAreaList } from '../../hooks/area';
import ChooseInput from './ChooseInput.vue';
import { Popup as NutPopup, Picker as NutPicker } from '@nutui/nutui-taro';
import { computed, ref } from 'vue';
defineOptions({
  name: 'ChooseInputWithAreaPicker',
});
// const { findAreaNameFromCode } = useAllAreaList();
type Props = {
  fieldNames?: object;
  columns: API.AreaTreeNode[];
  modelValue: Array<string | number>;
  title?: string;
};
const props = withDefaults(defineProps<Props>(), {
  title: '选择地址',
  fieldNames: () => ({
    text: 'areaName',
    value: 'areaName',
    children: 'children',
  }),
});
const inputValue = computed(() => props.modelValue.join(','));
const emit = defineEmits<{
  (e: 'update:modelValue', val: Array<string | number>): void;
}>();
const visible = ref(false);
function handleOpen() {
  visible.value = true;
}
function handleConfirm({ selectedValue, selectedOptions }) {
  emit(
    'update:modelValue',
    selectedOptions.map((x) => x.areaName)
  );
  visible.value = false;
}
</script>
packages/components/src/hooks/area.ts
New file
@@ -0,0 +1,103 @@
import { useQuery } from '@tanstack/vue-query';
import { computed } from 'vue';
import { useLifeRechargeContext, AreaInfo } from '@life-payment/core-vue';
// import { AreaType } from '@12333/constants';
export function flattenAreaTree(tree: AreaInfo[]) {
  let result = [] as AreaInfo[];
  // 递归函数,用于遍历子节点
  function flatten(node: AreaInfo) {
    result.push(node);
    if (node.children && node.children.length > 0) {
      node.children.forEach(flatten);
    }
  }
  // 遍历树的根节点
  tree.forEach(flatten);
  return result;
}
export function useArea() {
  const { blLifeRecharge } = useLifeRechargeContext();
  const { data: areaStore } = useQuery({
    queryKey: ['blLifeRecharge/getRegionalManagementList'],
    queryFn: async () => {
      return await blLifeRecharge.services.getRegionalManagementList({ showLoading: false });
    },
    placeholderData: () => [] as AreaInfo[],
    staleTime: Infinity,
    select(data) {
      const areaItemMap: Record<AreaInfo['areaCode'], AreaInfo> = {};
      data.forEach((item) => {
        areaItemMap[item.areaCode] = item;
      });
      const completeAreaList = flattenAreaTree([...data]);
      return {
        completeAreaList: completeAreaList,
        completeAreaTree: [...data],
        // cityAreaTree: formatAreaListToTree(completeAreaList, 0, AreaType.City),
        provinceList: [...data],
        areaItemMap: areaItemMap,
      };
    },
  });
  function getAreaFromCompleteAreaList(areaCode: number) {
    return areaStore.value.completeAreaList.find((x) => x.areaCode === areaCode);
  }
  function getAreaByAreaCode(areaCode: number) {
    return areaStore.value.areaItemMap[areaCode];
  }
  return {
    completeAreaList: computed(() => areaStore.value.completeAreaList),
    completeAreaTree: computed(() => areaStore.value.completeAreaTree),
    cityAreaTree: computed(() =>
      areaStore.value.completeAreaTree.map((x) => ({
        ...x,
        children: x.children.map((y) => ({
          ...y,
          children: undefined,
        })),
      }))
    ),
    provinceList: computed(() => areaStore.value.provinceList),
    areaItemMap: computed(() => areaStore.value.areaItemMap),
    getAreaFromCompleteAreaList,
    getAreaByAreaCode,
  };
}
export function useAllAreaList() {
  const { completeAreaTree, provinceList, completeAreaList, cityAreaTree } = useArea();
  const findAreaCodeFromName = (areaName: string) => {
    const areaItem = completeAreaList.value.find((x) => x.areaName === areaName);
    return areaItem?.areaCode ?? 0;
  };
  const findAreaNameFromCode = (areaCode: number) => {
    const areaItem = completeAreaList.value.find((x) => x.areaCode === areaCode);
    return areaItem?.areaName ?? '';
  };
  const findAreaItemFromCode = (areaCode: number) => {
    const areaItem = completeAreaList.value.find((x) => x.areaCode === areaCode);
    return areaItem;
  };
  return {
    findAreaCodeFromName,
    findAreaNameFromCode,
    findAreaItemFromCode,
    areaTreeList: completeAreaTree,
    provinceList,
    cityAreaTree,
  };
}
packages/components/src/hooks/index.ts
@@ -11,6 +11,7 @@
  UserAccountListOutput,
  AddUpdateUserAccountInput,
  GasParValueResponse,
  GasParValueOutput,
} from '@life-payment/core-vue';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import { computed, MaybeRef, reactive, unref } from 'vue';
@@ -63,7 +64,7 @@
  const { data: phoneParValueList, isLoading } = useQuery({
    queryKey: ['blLifeRecharge/getPhoneParValue'],
    queryFn: async () => {
      return await blLifeRecharge.services.getPhoneParValue({ showLoading: false });
      return await blLifeRecharge.services.getPhoneParValue({}, { showLoading: false });
    },
    select(data) {
      return data?.phoneParValue ?? [];
@@ -82,7 +83,7 @@
  const { data: electricParValueList, isLoading } = useQuery({
    queryKey: ['blLifeRecharge/getElectricSupportArea'],
    queryFn: async () => {
      return await blLifeRecharge.services.getElectricSupportArea({ showLoading: false });
      return await blLifeRecharge.services.getElectricSupportArea({}, { showLoading: false });
    },
    select(data) {
      return data.electricAreaList ?? [];
@@ -251,7 +252,7 @@
  const { data: gasParValueList, isLoading } = useQuery({
    queryKey: ['blLifeRecharge/getGasParValue'],
    queryFn: async () => {
      return await blLifeRecharge.services.getGasParValue({ showLoading: false });
      return await blLifeRecharge.services.getGasParValue({}, { showLoading: false });
    },
    select(data) {
      return data?.gasParValue ?? [];
packages/components/src/index.ts
@@ -8,5 +8,9 @@
export { default as ElectricOrder } from './views/Order/components/ElectricOrder.vue';
export { default as GasOrder } from './views/Order/components/GasOrder.vue';
export { default as OrderApplyRefundView } from './views/Order/OrderApplyRefundView.vue';
export { default as OrderRefundResultView } from './views/Order/OrderRefundResultView.vue';
export { default as UserAccountListView } from './views/userAccount/UserAccountListView.vue';
export { default as EditPhoneUserAccount } from './views/userAccount/EditPhoneUserAccount.vue';
export { default as EditElectricUserAccount } from './views/userAccount/EditElectricUserAccount.vue';
export { default as EditGasUserAccount } from './views/userAccount/EditGasUserAccount.vue';
export * from './utils';
packages/components/src/styles/components.scss
@@ -140,6 +140,13 @@
    line-height: 32px;
  }
  .recharge-result-view-remark {
    margin-bottom: 40px;
    font-size: 24px;
    color: boleGetCssVar('text-color', 'primary');
    line-height: 32px;
  }
  .recharge-result-view-btn-wrapper {
    display: flex;
    justify-content: center;
packages/components/src/utils/validator.ts
@@ -13,12 +13,12 @@
    return Promise.resolve(true);
  }
  // static validatorArray(value: any, ruleCfg: FormItemRuleWithoutValidator) {
  //   if (!_.isArray(value) || !value?.length) {
  //     return Promise.reject(ruleCfg.message);
  //   }
  //   return Promise.resolve(true);
  // }
  static validatorArray(value: any, ruleCfg: FormItemRuleWithoutValidator) {
    if (!Array.isArray(value) || !value?.length) {
      return Promise.reject(ruleCfg.message);
    }
    return Promise.resolve(true);
  }
  // 身份证后六位
  static validatorIDNumberSix(value: string, ruleCfg: FormItemRuleWithoutValidator) {
packages/components/src/views/GasBillRecharge/GasBillRecharge.vue
@@ -37,11 +37,12 @@
}>();
const preSetForm = reactive({
  gasOrgType: '' as any as LifeRechargeConstants.GasOrgCodeEnum,
  province: '',
  city: '',
  gasOrgType: '',
  // province: '',
  // city: '',
  gasAccount: '',
  remark: '',
  areaList: [] as string[],
});
provide(GasBillRechargeContextKey, {
packages/components/src/views/GasBillRecharge/GasBillRechargeBaseForm.vue
@@ -6,6 +6,14 @@
    label-position="top"
    class="order-bill-recharge electric"
  >
    <slot name="top"></slot>
    <NutFormItem label="所在城市" class="bole-form-item" prop="areaList" required>
      <ChooseInputWithAreaPicker
        :columns="cityAreaTree"
        v-model="form.areaList"
        placeholder="请选择所在城市"
      ></ChooseInputWithAreaPicker>
    </NutFormItem>
    <NutFormItem label="缴费户号" class="bole-form-item" prop="gasAccount" required>
      <NutInput
        v-model.trim="form.gasAccount"
@@ -23,24 +31,30 @@
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';
import ChooseInputWithAreaPicker from '../../components/Input/ChooseInputWithAreaPicker.vue';
import { useAllAreaList } from '../../hooks/area';
import { FormValidator } from '../../utils';
defineOptions({
  name: 'GasBillRechargeBaseForm',
});
const form = defineModel<{
  province: string;
  city: string;
  gasAccount: string;
}>('form');
const { findAreaNameFromCode, cityAreaTree } = useAllAreaList();
const { gasParValueList } = useGetGasParValue();
const form = defineModel<{
  // province: string;
  // city: string;
  gasAccount: string;
  areaList: string[];
}>('form');
const rules = reactive<FormRules>({
  province: [{ required: true, message: '请选择所在区域' }],
  city: [{ required: true, message: '请选择所在城市' }],
  gasAccount: [{ required: true, message: '请输入缴费户号', regex: /^\d{13}$/ }],
  areaList: [
    { required: true, message: '请选择所在城市', validator: FormValidator.validatorArray },
  ],
});
const formRef = ref<any>(null);
packages/components/src/views/GasBillRecharge/GasBillRechargeStep1.vue
@@ -2,10 +2,10 @@
  <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)"
        :title="item.gasOrgName"
        v-for="item in gasParValueList"
        :key="item.gasOrgCode"
        @click="goNext(item.gasOrgCode)"
      ></GasOrgTypeCard>
    </NutFormItem>
    <div class="common-content">
@@ -23,6 +23,7 @@
import GasOrgTypeCard from './GasOrgTypeCard.vue';
import { BlLifeRecharge, LifeRechargeConstants } from '@life-payment/core-vue';
import { useGasBillRechargeContext } from './context';
import { useGetGasParValue } from '../../hooks';
defineOptions({
  name: 'GasBillRechargeStep1',
@@ -30,7 +31,9 @@
const { preSetForm, goToNext, goTo } = useGasBillRechargeContext();
function goNext(gasOrgType: LifeRechargeConstants.GasOrgCodeEnum) {
const { gasParValueList } = useGetGasParValue();
function goNext(gasOrgType: string) {
  preSetForm.gasOrgType = gasOrgType;
  goToNext();
}
packages/components/src/views/GasBillRecharge/GasBillRechargeStep2.vue
@@ -10,22 +10,22 @@
      />
    </NutFormItem>
    <div class="common-content">
      <nut-button class="recharge-button" type="primary" @click="handleNext">
      <NutButton 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">
      </NutButton>
      <NutButton class="recharge-button" type="primary" plain @click="goToPrevious">
        <div class="recharge-button-inner">
          <div class="recharge-button-text">返回</div>
        </div>
      </nut-button>
      </NutButton>
    </div>
  </GasBillRechargeBaseForm>
</template>
<script setup lang="ts">
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, watch } from 'vue';
import GasBillRechargeBaseForm from './GasBillRechargeBaseForm.vue';
import { useGasBillRechargeContext } from './context';
@@ -62,12 +62,17 @@
      userId: blLifeRecharge.accountModel.userId,
      lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单,
      content: preSetForm.gasAccount,
      province: preSetForm.province,
      city: preSetForm.city,
      province: preSetForm.areaList?.[0] ?? '',
      city: preSetForm.areaList?.[1] ?? '',
      extraProperties: JSON.stringify(preSetForm),
      operators: preSetForm.gasOrgType,
      remark: preSetForm.remark,
    };
    await addUpdateUserAccount(params);
    preSetForm.areaList = [];
    preSetForm.gasAccount = '';
    preSetForm.remark = '';
    preSetForm.gasOrgType = '' as any;
    goToNext();
  } catch (error) {}
}
packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue
@@ -21,7 +21,7 @@
      <AccountCard
        v-if="userAccountAllList.length > 0"
        title="充值户号"
        :content="`${form.city} ${form.gasAccount}`"
        :content="`${form.areaList?.[1] ?? ''} ${form.gasAccount}`"
        :remark="form.remark"
      >
        <template #action>
@@ -31,19 +31,13 @@
      <AccountAddCard text="新增户号" v-else @click="handleAddUserAccount" />
    </NutFormItem>
    <NutFormItem
      v-if="!!form.province"
      label="选择充值金额"
      class="bole-form-item"
      prop="parValue"
      required
    >
    <NutFormItem label="选择充值金额" class="bole-form-item" prop="parValue" required>
      <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group">
        <!-- <NutRadio
        <NutRadio
          :label="Number(item)"
          :key="item"
          shape="button"
          v-for="item in parValueList"
          v-for="item in gasValueList"
          class="parValue-item"
        >
          <div class="parValue-item-inner">
@@ -59,13 +53,13 @@
            </div>
            <div class="discountTag">{{ lifePayGasRate }}折</div>
          </div>
        </NutRadio> -->
        </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>¥{{ realParValue }}</div>
          <div class="recharge-button-text">立即充值</div>
        </div>
      </nut-button>
@@ -82,7 +76,7 @@
      <template #info>
        <ConfirmDialogInfoItem
          label="燃气类型"
          :content="blLifeRecharge.constants.GasOrgCodeEnumText[form.gasOrgType]"
          :content="currentGasParValueItem?.gasOrgName ?? ''"
        />
        <ConfirmDialogInfoItem :label-width="96" label="户号" :content="form.gasAccount" />
        <ConfirmDialogInfoItem label="充值金额" :content="`¥${form.parValue.toFixed(2)}`" danger />
@@ -143,15 +137,17 @@
const { blLifeRecharge } = useLifeRechargeContext();
const { lifePayGasRate } = useGetRate();
const { gasParValueList } = useGetGasParValue();
const form = reactive({
  parValue: 0,
  province: '',
  city: '',
  // province: '',
  // city: '',
  gasOrgType: '',
  gasAccount: '',
  currentUserAccountId: '',
  remark: '',
  areaList: [] as string[],
});
const { userAccountAllList, handleUserAccountChange } = useSetUserAccountBySelect({
@@ -160,30 +156,31 @@
    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.currentUserAccountId = currentUserAccount.id;
    form.gasAccount = currentUserAccount.content;
    form.areaList = [currentUserAccount.province, currentUserAccount.city];
    form.gasOrgType = currentUserAccount.operators;
    // 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;
    // }
    form.remark = currentUserAccount.remark;
    const gasParValueItem = gasParValueList.value.find((x) => x.gasOrgCode === form.gasOrgType);
    if (gasParValueItem && gasParValueItem.parValue.every((x) => Number(x) !== form.parValue)) {
      form.parValue = 0;
    }
  },
});
function handleAddUserAccount() {
  goTo('step1');
}
const currentGasParValueItem = computed(() =>
  gasParValueList.value.find((x) => x.gasOrgCode === form.gasOrgType)
);
const gasValueList = computed(() => {
  const gasValueList = currentGasParValueItem.value?.parValue ?? [];
  return blLifeRecharge.filterParValueList(gasValueList);
});
const realParValue = computed(() =>
  blLifeRecharge.getRechargeParValue(form.parValue, lifePayGasRate.value)
@@ -233,8 +230,8 @@
        parValue: props.isDev ? 0.1 : form.parValue,
        gasOrgType: form.gasOrgType,
        gasAccount: form.gasAccount,
        province: form.province,
        city: form.city,
        province: form.areaList?.[0] ?? '',
        city: form.areaList?.[1] ?? '',
      },
    };
    let res = await blLifeRecharge.services.createLifePayGasOrder(params);
packages/components/src/views/GasBillRecharge/context.ts
@@ -19,9 +19,11 @@
}
export type GasUserAccountExtraProperties = {
  gasOrgType: LifeRechargeConstants.GasOrgCodeEnum;
  province: string;
  city: string;
  // gasOrgType: LifeRechargeConstants.GasOrgCodeEnum;
  gasOrgType: string;
  // province: string;
  // city: string;
  gasAccount: string;
  remark: string;
  areaList: string[];
};
packages/components/src/views/Order/OrderApplyRefundView.vue
@@ -49,7 +49,7 @@
});
type Props = {
  orderNo: string;
  id: string;
};
const props = withDefaults(defineProps<Props>(), {});
@@ -84,7 +84,7 @@
async function refundUserLifePayOrder() {
  try {
    let params: RefundUserLifePayOrderInput = {
      id: props.orderNo,
      id: props.id,
      userId: blLifeRecharge.accountModel.userId,
      refundApplyRemark: form.refundApplyRemark,
    };
packages/components/src/views/Order/OrderRefundResultView.vue
New file
@@ -0,0 +1,57 @@
<template>
  <LoadingLayout :loading="isLoading">
    <div class="recharge-result-view">
      <div class="recharge-result-view-title">{{ title }}</div>
      <div class="recharge-result-view-subtitle">订单号:{{ orderNo }}</div>
      <div class="recharge-result-view-remark">
        {{ detail.refundCheckRemark }},如有疑问请联系客服 {{ CustomerServicePhone }}(周一到周五
        9:00-17:30)
      </div>
      <div class="recharge-result-view-btn-wrapper">
        <div class="recharge-result-view-btn" @click="emit('goBackHome')">回首页</div>
      </div>
    </div>
  </LoadingLayout>
</template>
<script setup lang="ts">
import { LifeRechargeConstants, useLifeRechargeContext } from '@life-payment/core-vue';
import { CustomerServicePhone } from '../../constants';
import { useQuery } from '@tanstack/vue-query';
import { computed } from 'vue';
import LoadingLayout from '../../components//Layout/LoadingLayout.vue';
defineOptions({
  name: 'OrderRefundResultView',
});
type Props = {
  title?: string;
  orderNo?: string;
  lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum;
};
const props = withDefaults(defineProps<Props>(), {
  title: '退款失败',
});
const emit = defineEmits<{
  (e: 'goBackHome'): void;
}>();
const { blLifeRecharge } = useLifeRechargeContext();
const { data: detail, isLoading } = useQuery({
  queryKey: ['blLifeRecharge/getUserLifePayOrderDetail', props.orderNo],
  queryFn: async () => {
    return await blLifeRecharge.services.getUserLifePayOrderDetail(
      { orderNo: props.orderNo },
      {
        showLoading: false,
      }
    );
  },
  enabled: computed(() => !!props.orderNo),
});
</script>
packages/components/src/views/Order/components/ElectricOrder.vue
@@ -8,6 +8,7 @@
        title="电费充值"
        :status="convertOrderFrontStatus(item?.payStatus, item?.lifePayOrderStatus)"
        :order-no="item?.orderNo"
        :id="item?.id"
        @goApplyRefund="emit('goApplyRefund', $event)"
        @goRefundDetail="emit('goRefundDetail', $event)"
      >
@@ -76,7 +77,7 @@
// const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'goApplyRefund', orderNo: string): void;
  (e: 'goApplyRefund', id: string): void;
  (e: 'goRefundDetail', orderNo: string): void;
}>();
packages/components/src/views/Order/components/GasOrder.vue
@@ -8,6 +8,7 @@
        title="燃气充值"
        :status="convertOrderFrontStatus(item?.payStatus, item?.lifePayOrderStatus)"
        :order-no="item?.orderNo"
        :id="item?.id"
        @goApplyRefund="emit('goApplyRefund', $event)"
        @goRefundDetail="emit('goRefundDetail', $event)"
      >
@@ -68,7 +69,7 @@
// const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'goApplyRefund', orderNo: string): void;
  (e: 'goApplyRefund', id: string): void;
  (e: 'goRefundDetail', orderNo: string): void;
}>();
packages/components/src/views/Order/components/PhoneOrder.vue
@@ -8,6 +8,7 @@
        title="话费充值"
        :status="convertOrderFrontStatus(item?.payStatus, item?.lifePayOrderStatus)"
        :order-no="item?.orderNo"
        :id="item?.id"
        @goApplyRefund="emit('goApplyRefund', $event)"
        @goRefundDetail="emit('goRefundDetail', $event)"
      >
@@ -68,7 +69,7 @@
// const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'goApplyRefund', orderNo: string): void;
  (e: 'goApplyRefund', id: string): void;
  (e: 'goRefundDetail', orderNo: string): void;
}>();
packages/components/src/views/RechargeResultView/RechargeResultView.vue
@@ -3,7 +3,9 @@
    <div class="recharge-result-view-title">{{ title }}</div>
    <div class="recharge-result-view-subtitle">订单号:{{ orderNo }}</div>
    <div class="recharge-result-view-tips">
      同一号码充值期间,未到账前切勿在其他任何平台再次充值。因此造成的资金损失须用户自行承担!!!
      <slot name="tips">
        同一号码充值期间,未到账前切勿在其他任何平台再次充值。因此造成的资金损失须用户自行承担!!!
      </slot>
    </div>
    <div class="recharge-result-view-warning">
      如接到陌生来电,对方以缴费或误操作等理由要求处理款项,务必立即拉黑,谨防诈骗!!!
packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep1.vue
@@ -71,6 +71,7 @@
    let params: AddUpdateUserAccountInput = {
      userId: blLifeRecharge.accountModel.userId,
      lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.电费订单,
      operators: form.electricType,
      content: form.electricAccount,
      province: form.province,
      city: form.city,
packages/components/src/views/userAccount/EditElectricUserAccount.vue
New file
@@ -0,0 +1,120 @@
<template>
  <LoadingLayout :loading="isLoading">
    <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">
        <NutButton class="recharge-button" type="primary" @click="handleSave">
          <div class="recharge-button-inner">
            <div class="recharge-button-text">保存</div>
          </div>
        </NutButton>
      </div>
    </ElectricBillRechargeBaseForm>
  </LoadingLayout>
</template>
<script setup lang="ts">
import ElectricBillRechargeBaseForm from '../electricBillRecharge/ElectricBillRechargeBaseForm.vue';
import { Button as NutButton } from '@nutui/nutui-taro';
import { reactive, ref, computed } from 'vue';
import {
  useLifeRechargeContext,
  LifeRechargeConstants,
  AddUpdateUserAccountInput,
} from '@life-payment/core-vue';
import { useAddUpdateUserAccount } from '../../hooks';
import LoadingLayout from '../../components//Layout/LoadingLayout.vue';
import { useQuery } from '@tanstack/vue-query';
import { ElectricUserAccountExtraProperties } from '../electricBillRecharge/context';
defineOptions({
  name: 'EditElectricUserAccount',
});
type Props = {
  id?: string;
};
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'success'): void;
}>();
const { blLifeRecharge } = useLifeRechargeContext();
const { isLoading } = useQuery({
  queryKey: ['blLifeRecharge/getUserAccountDetail', props.id],
  queryFn: async () => {
    return await blLifeRecharge.services.getUserAccountDetail(
      { id: props.id },
      {
        showLoading: false,
      }
    );
  },
  onSuccess(data) {
    const currentUserAccountExtraProperties = JSON.parse(
      data.extraProperties
    ) as ElectricUserAccountExtraProperties;
    form.electricAccount = data.content;
    form.province = data.province;
    form.city = data.city;
    form.electricType = currentUserAccountExtraProperties.electricType;
    form.electricAccountType = currentUserAccountExtraProperties.electricAccountType;
    form.sixID = currentUserAccountExtraProperties.sixID;
    form.remark = data.remark;
  },
  enabled: computed(() => !!props.id),
});
const form = reactive({
  electricAccount: '',
  electricType: '',
  electricAccountType: '',
  province: '',
  city: '',
  sixID: '',
  remark: '',
});
const formRef = ref<any>(null);
function handleSave() {
  if (!formRef.value) return;
  formRef.value.validate().then(({ valid, errors }: any) => {
    if (valid) {
      handleAddUpdateUserAccount();
    }
  });
}
const { addUpdateUserAccount } = useAddUpdateUserAccount();
async function handleAddUpdateUserAccount() {
  try {
    let params: AddUpdateUserAccountInput = {
      userId: blLifeRecharge.accountModel.userId,
      operators: form.electricType,
      lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.电费订单,
      content: form.electricAccount,
      province: form.province,
      city: form.city,
      extraProperties: JSON.stringify(form),
      remark: form.remark,
      id: props.id,
    };
    await addUpdateUserAccount(params);
    emit('success');
  } catch (error) {}
}
</script>
packages/components/src/views/userAccount/EditGasUserAccount.vue
New file
@@ -0,0 +1,130 @@
<template>
  <LoadingLayout :loading="isLoading">
    <GasBillRechargeBaseForm ref="formRef" v-model:form="form">
      <template #top>
        <NutFormItem label="燃气类型" class="bole-form-item" prop="gasOrgType" required>
          <ChooseInputWithPicker
            v-model="form.gasOrgType"
            placeholder="请选择燃气类型"
            :value-enum="gasParValueList"
            enum-label-key="gasOrgName"
            enum-value-key="gasOrgCode"
          />
        </NutFormItem>
      </template>
      <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">
        <NutButton class="recharge-button" type="primary" @click="handleSave">
          <div class="recharge-button-inner">
            <div class="recharge-button-text">保存</div>
          </div>
        </NutButton>
      </div>
    </GasBillRechargeBaseForm>
  </LoadingLayout>
</template>
<script setup lang="ts">
import GasBillRechargeBaseForm from '../GasBillRecharge/GasBillRechargeBaseForm.vue';
import { Button as NutButton } from '@nutui/nutui-taro';
import { reactive, ref, computed } from 'vue';
import {
  useLifeRechargeContext,
  LifeRechargeConstants,
  AddUpdateUserAccountInput,
} from '@life-payment/core-vue';
import { useAddUpdateUserAccount, useGetGasParValue } from '../../hooks';
import LoadingLayout from '../../components//Layout/LoadingLayout.vue';
import ChooseInputWithPicker from '../../components//Input/ChooseInputWithPicker.vue';
import { useQuery } from '@tanstack/vue-query';
import { GasUserAccountExtraProperties } from '../GasBillRecharge/context';
defineOptions({
  name: 'EditGasUserAccount',
});
type Props = {
  id?: string;
};
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'success'): void;
}>();
const { blLifeRecharge } = useLifeRechargeContext();
const { gasParValueList } = useGetGasParValue();
const { isLoading } = useQuery({
  queryKey: ['blLifeRecharge/getUserAccountDetail', props.id],
  queryFn: async () => {
    return await blLifeRecharge.services.getUserAccountDetail(
      { id: props.id },
      {
        showLoading: false,
      }
    );
  },
  onSuccess(data) {
    const currentUserAccountExtraProperties = JSON.parse(
      data.extraProperties
    ) as GasUserAccountExtraProperties;
    form.gasAccount = data.content;
    form.areaList = [data.province, data.city];
    form.gasOrgType = data.operators as any;
    form.remark = data.remark;
  },
  enabled: computed(() => !!props.id),
});
const form = reactive({
  gasOrgType: '',
  // province: '',
  // city: '',
  gasAccount: '',
  remark: '',
  areaList: [] as string[],
});
const formRef = ref<any>(null);
function handleSave() {
  if (!formRef.value) return;
  formRef.value.validate().then(({ valid, errors }: any) => {
    if (valid) {
      handleAddUpdateUserAccount();
    }
  });
}
const { addUpdateUserAccount } = useAddUpdateUserAccount();
async function handleAddUpdateUserAccount() {
  try {
    let params: AddUpdateUserAccountInput = {
      userId: blLifeRecharge.accountModel.userId,
      lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单,
      content: form.gasAccount,
      province: form.areaList?.[0] ?? '',
      city: form.areaList?.[1] ?? '',
      extraProperties: JSON.stringify(form),
      remark: form.remark,
      operators: form.gasOrgType,
      id: props.id,
    };
    await addUpdateUserAccount(params);
    emit('success');
  } catch (error) {}
}
</script>
packages/components/src/views/userAccount/EditPhoneUserAccount.vue
New file
@@ -0,0 +1,111 @@
<template>
  <LoadingLayout :loading="isLoading">
    <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">
        <NutButton class="recharge-button" type="primary" @click="handleSave">
          <div class="recharge-button-inner">
            <div class="recharge-button-text">保存</div>
          </div>
        </NutButton>
      </div>
    </PhoneBillRechargeBaseForm>
  </LoadingLayout>
</template>
<script setup lang="ts">
import PhoneBillRechargeBaseForm from '../PhoneBillRecharge/PhoneBillRechargeBaseForm.vue';
import { Button as NutButton } from '@nutui/nutui-taro';
import { reactive, ref, computed } from 'vue';
import {
  useLifeRechargeContext,
  LifeRechargeConstants,
  AddUpdateUserAccountInput,
} from '@life-payment/core-vue';
import { useAddUpdateUserAccount } from '../../hooks';
import LoadingLayout from '../../components//Layout/LoadingLayout.vue';
import { useQuery } from '@tanstack/vue-query';
import { PhoneUserAccountExtraProperties } from '../PhoneBillRecharge/context';
defineOptions({
  name: 'EditPhoneUserAccount',
});
type Props = {
  id?: string;
};
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{
  (e: 'success'): void;
}>();
const { blLifeRecharge } = useLifeRechargeContext();
const { isLoading } = useQuery({
  queryKey: ['blLifeRecharge/getUserAccountDetail', props.id],
  queryFn: async () => {
    return await blLifeRecharge.services.getUserAccountDetail(
      { id: props.id },
      {
        showLoading: false,
      }
    );
  },
  onSuccess(data) {
    const currentUserAccountExtraProperties = JSON.parse(
      data.extraProperties
    ) as PhoneUserAccountExtraProperties;
    form.ispCode = currentUserAccountExtraProperties.ispCode;
    form.phone = data.content;
    form.name = currentUserAccountExtraProperties.name;
    form.remark = data.remark;
  },
  enabled: computed(() => !!props.id),
});
const form = reactive({
  ispCode: '',
  phone: '',
  name: '',
  remark: '',
});
const formRef = ref<any>(null);
function handleSave() {
  if (!formRef.value) return;
  formRef.value.validate().then(({ valid, errors }: any) => {
    if (valid) {
      handleAddUpdateUserAccount();
    }
  });
}
const { addUpdateUserAccount } = useAddUpdateUserAccount();
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,
      id: props.id,
    };
    await addUpdateUserAccount(params);
    emit('success');
  } catch (error) {}
}
</script>
packages/components/src/views/userAccount/UserAccountListView.vue
@@ -18,8 +18,8 @@
        }"
      >
        <template #action>
          <div class="account-card-action" @click="handleEditUserAccount">编辑</div>
          <div class="account-card-action" @click="handleEditUserAccount">删除</div>
          <div class="account-card-action" @click="handleEditUserAccount(item)">编辑</div>
          <div class="account-card-action" @click="handleDeleteUserAccount(item)">删除</div>
        </template>
      </AccountCard>
    </template>
@@ -33,6 +33,7 @@
  useLifeRechargeContext,
  QueryUserAccountListInput,
  LifeRechargeConstants,
  UserAccountListOutput,
} from '@life-payment/core-vue';
import { useInfiniteLoading } from '../../hooks/infiniteLoading';
import { OrderInputType } from '../../constants';
@@ -43,6 +44,10 @@
  name: 'UserAccountListView',
});
const emit = defineEmits<{
  (e: 'goEdit', row: UserAccountListOutput): void;
}>();
const { blLifeRecharge } = useLifeRechargeContext();
const TitleMap = {
@@ -51,13 +56,13 @@
  [LifeRechargeConstants.LifePayOrderTypeEnum.燃气订单]: '燃气户号',
};
const { infiniteLoadingProps } = useInfiniteLoading(
const { infiniteLoadingProps, invalidateQueries } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: QueryUserAccountListInput = {
      pageModel: {
        rows: 20,
        page: pageParam,
        orderInput: [{ property: 'id', order: OrderInputType.Desc }],
        orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
      },
      userId: blLifeRecharge.accountModel.userId,
    };
@@ -71,5 +76,23 @@
  }
);
function handleEditUserAccount() {}
function handleEditUserAccount(row: UserAccountListOutput) {
  emit('goEdit', row);
}
async function handleDeleteUserAccount(row: UserAccountListOutput) {
  try {
    const res = await Taro.showModal({
      title: '提示',
      content: '确定要删除该数据吗?',
      confirmColor: '#3a71ff',
    });
    if (res.confirm) {
      await blLifeRecharge.services.deleteUserAccount({
        id: row.id,
      });
      invalidateQueries();
    }
  } catch (error) {}
}
</script>
packages/core/src/lifeRecharge.ts
@@ -15,7 +15,7 @@
  constants = LifeRechargeConstants;
  constructor(options: BlLifeRechargeOptions<TResponse, TRequestOptions>) {
    this.services = new BlLifeRechargeServices(options);
    this.services = new BlLifeRechargeServices(this, options);
    this.accountModel = new BlLifeRechargeAccountModel({
      userId: options.userId,
      phoneNumber: options.phoneNumber,
packages/core/src/lifeRechargeAccountModel.ts
@@ -3,11 +3,13 @@
export class BlLifeRechargeAccountModel {
  userId = '';
  phoneNumber = '';
  channlesNum = '';
  constructor(options: BlLifeRechargeAccountModelOptions = {}) {
    const { userId = '', phoneNumber = '' } = options;
    const { userId = '', phoneNumber = '', channlesNum } = options;
    this.setUserId(userId);
    this.setPhoneNumber(phoneNumber);
    this.setChannlesNum(channlesNum);
  }
  setUserId(userId: string) {
@@ -17,4 +19,7 @@
  setPhoneNumber(phoneNumber: string) {
    this.phoneNumber = phoneNumber;
  }
  setChannlesNum(channlesNum: string) {
    this.channlesNum = channlesNum;
  }
}
packages/core/src/lifeRechargeServices.ts
@@ -1,15 +1,31 @@
import { BlLifeRechargeServicesOptions } from './types';
import { LifeRechargeConstants } from './lifeRechargeConstants';
import { Request, IRequest } from 'senior-request';
import { BlLifeRecharge } from './lifeRecharge';
export interface RequestConfig {}
export class BlLifeRechargeServices<TResponse = any, TRequestOptions = any> {
  private request: IRequest;
  constructor({ axiosConfig }: BlLifeRechargeServicesOptions<TResponse, TRequestOptions>) {
  ctx: BlLifeRecharge<TResponse, TRequestOptions>;
  constructor(
    ctx: BlLifeRecharge<TResponse, TRequestOptions>,
    { axiosConfig }: BlLifeRechargeServicesOptions<TResponse, TRequestOptions>
  ) {
    this.ctx = ctx;
    this.request = Request.create({
      ...axiosConfig,
      // baseURL: process.env.NODE_ENV === 'development' ? '/' : 'https://api.81812333.com',
      requestInterceptors: [
        // [
        //   (config) => {
        //     console.log('config2: ', config);
        //     return config;
        //   },
        // ],
        ...axiosConfig.requestInterceptors,
      ],
      timeout: 10 * 1000,
      headers: {
        Accept: 'application/json, text/plain, */*',
@@ -40,25 +56,37 @@
  }
  /** 获取电费充值区域 GET /api/LifePay/GetElectricSupportArea */
  async getElectricSupportArea(options?: RequestConfig) {
  async getElectricSupportArea(body: ChannelsBaseInput, options?: RequestConfig) {
    return this.request<ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', {
      method: 'GET',
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
  /** 获取电费面值 GET /api/LifePay/GetElectricParValue */
  async getElectricParValue(options?: RequestConfig) {
  /** 获取电费面值 POST /api/LifePay/GetElectricParValue */
  async getElectricParValue(body: ChannelsBaseInput, options?: RequestConfig) {
    return this.request<ElectricParValueResponse>('/api/LifePay/GetElectricParValue', {
      method: 'GET',
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
  /** 获取话费面值 GET /api/LifePay/GetPhoneParValue */
  async getPhoneParValue(options?: RequestConfig) {
  async getPhoneParValue(body: ChannelsBaseInput, options?: RequestConfig) {
    return this.request<PhoneParValueResponse>('/api/LifePay/GetPhoneParValue', {
      method: 'GET',
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
@@ -206,9 +234,13 @@
  }
  /** 获取燃气面值 GET /api/LifePay/GetGasParValue */
  async getGasParValue(options?: RequestConfig) {
  async getGasParValue(body: ChannelsBaseInput, options?: RequestConfig) {
    return this.request<GasParValueResponse>('/api/LifePay/GetGasParValue', {
      method: 'GET',
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
@@ -221,6 +253,59 @@
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
  /** 删除我的户号 POST /api/LifePay/DeleteUserAccount */
  async deleteUserAccount(
    // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
    params: APIdeleteUserAccountParams,
    options?: RequestConfig
  ) {
    return this.request<number>('/api/LifePay/DeleteUserAccount', {
      method: 'POST',
      params: {
        ...params,
      },
      ...(options || {}),
    });
  }
  /** 获取我的户号详情 GET /api/LifePay/GetUserAccountDetail */
  async getUserAccountDetail(
    // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
    params: APIgetUserAccountDetailParams,
    options?: RequestConfig
  ) {
    return this.request<UserAccountOutput>('/api/LifePay/GetUserAccountDetail', {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    });
  }
  /** 获取我的订单详情 GET /api/LifePay/GetUserLifePayOrderDetail */
  async getUserLifePayOrderDetail(
    // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
    params: APIgetUserLifePayOrderDetailParams,
    options?: RequestConfig
  ) {
    return this.request<UserLifePayOrderOutput>('/api/LifePay/GetUserLifePayOrderDetail', {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    });
  }
  /** 搜索管理--列表(区域管理) GET /api/Area/GetRegionalManagementList */
  async getRegionalManagementList(options?: RequestConfig) {
    return this.request<AreaInfo[]>('/api/Area/GetRegionalManagementList', {
      method: 'GET',
      ...(options || {}),
    });
  }
@@ -396,6 +481,12 @@
  creationTime?: string;
  /** 退款时间 */
  refundTime?: string;
  /** 退款凭证 */
  refundCredentialsImgUrl?: string;
  refundApplyRemark?: string;
  refundCheckRemark?: string;
  /** 渠道流水号 */
  acoolyOrderNo?: string;
}
export interface ElectricSupportAreaResponse {
@@ -536,7 +627,7 @@
  code?: string;
  message?: string;
  detail?: string;
  gasParValue?: GasParValueOutput;
  gasParValue?: GasParValueOutput[];
}
export interface GasParValueOutput {
@@ -566,3 +657,53 @@
  objectData?: any;
  data?: UserAccountListOutput[];
}
export interface APIdeleteUserAccountParams {
  id?: string;
}
export interface APIgetUserAccountDetailParams {
  id?: string;
}
export interface UserAccountOutput {
  id?: string;
  lifePayType?: LifeRechargeConstants.LifePayOrderTypeEnum;
  /** 运营商 */
  operators?: string;
  /** 手机号/户号 */
  content?: string;
  /** 省 */
  province?: string;
  /** 市 */
  city?: string;
  /** 拓展字段(电费类型) */
  extraProperties?: string;
  /** 备注 */
  remark?: string;
  /** 创建时间 */
  creationTime?: string;
  isDeleted?: boolean;
}
export interface APIgetUserLifePayOrderDetailParams {
  orderNo?: string;
}
export interface ChannelsBaseInput {
  channelId?: string;
}
export interface AreaInfo {
  areaCode?: number;
  parentId?: number;
  areaName?: string;
  /** 1省 2市 3区 4镇 */
  layer?: number;
  sort?: number;
  children?: AreaInfo[];
  /** 简易拼音 */
  simpleSpelling?: string;
  /** 快速检索 */
  quickQuery?: string;
}
packages/core/src/types.ts
@@ -8,6 +8,7 @@
export type BlLifeRechargeAccountModelOptions = {
  userId?: string;
  phoneNumber?: string;
  channlesNum?: string;
};
export type BlLifeRechargeOptions<
packages/services/api/LifePay.ts
@@ -112,7 +112,7 @@
  body: API.QueryUserAccountListInput,
  options?: API.RequestConfig
) {
  return request<API.UserAccountListOutputPageOutput>('/api/LifePay/GetAccountPage', {
  return request<API.UserAccountOutputPageOutput>('/api/LifePay/GetAccountPage', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
@@ -122,34 +122,56 @@
  });
}
/** 获取电费面值 GET /api/LifePay/GetElectricParValue */
export async function getElectricParValue(options?: API.RequestConfig) {
/** 获取电费面值 POST /api/LifePay/GetElectricParValue */
export async function getElectricParValue(
  body: API.ChannelsBaseInput,
  options?: API.RequestConfig
) {
  return request<API.ElectricParValueResponse>('/api/LifePay/GetElectricParValue', {
    method: 'GET',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取电费充值区域 GET /api/LifePay/GetElectricSupportArea */
export async function getElectricSupportArea(options?: API.RequestConfig) {
/** 获取电费充值区域 POST /api/LifePay/GetElectricSupportArea */
export async function getElectricSupportArea(
  body: API.ChannelsBaseInput,
  options?: API.RequestConfig
) {
  return request<API.ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', {
    method: 'GET',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取燃气支持商户 GET /api/LifePay/GetGasOrgType */
export async function getGasOrgType(options?: API.RequestConfig) {
/** 获取燃气支持商户 POST /api/LifePay/GetGasOrgType */
export async function getGasOrgType(body: API.ChannelsBaseInput, options?: API.RequestConfig) {
  return request<API.GasOrgTypeValueResponse>('/api/LifePay/GetGasOrgType', {
    method: 'GET',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取燃气面值 GET /api/LifePay/GetGasParValue */
export async function getGasParValue(options?: API.RequestConfig) {
/** 获取燃气面值 POST /api/LifePay/GetGasParValue */
export async function getGasParValue(body: API.ChannelsBaseInput, options?: API.RequestConfig) {
  return request<API.GasParValueResponse>('/api/LifePay/GetGasParValue', {
    method: 'GET',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
@@ -196,7 +218,7 @@
  });
}
/** 此处后端没有提供注释 POST /api/LifePay/GetLifePayOrderPageExport */
/** 导出订单Excel POST /api/LifePay/GetLifePayOrderPageExport */
export async function getLifePayOrderPageExport(
  body: API.QueryLifePayOrderListInput,
  options?: API.RequestConfig
@@ -228,23 +250,27 @@
/** 根据订单号获取支付状态 GET /api/LifePay/GetPayStatusByOrderNo */
export async function getPayStatusByOrderNo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetPayStatusByOrderNoParams,
  body: API.GetPayStatusByOrderNoInput,
  options?: API.RequestConfig
) {
  return request<API.LifePayStatusEnum>('/api/LifePay/GetPayStatusByOrderNo', {
    method: 'GET',
    params: {
      ...params,
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取话费面值 GET /api/LifePay/GetPhoneParValue */
export async function getPhoneParValue(options?: API.RequestConfig) {
/** 获取话费面值 POST /api/LifePay/GetPhoneParValue */
export async function getPhoneParValue(body: API.ChannelsBaseInput, options?: API.RequestConfig) {
  return request<API.PhoneParValueResponse>('/api/LifePay/GetPhoneParValue', {
    method: 'GET',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
@@ -262,7 +288,7 @@
  body: API.QueryUserAccountAllListInput,
  options?: API.RequestConfig
) {
  return request<API.UserAccountListOutput[]>('/api/LifePay/GetUserAccountAllList', {
  return request<API.UserAccountOutput[]>('/api/LifePay/GetUserAccountAllList', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
@@ -272,12 +298,27 @@
  });
}
/** 获取我的户号详情 GET /api/LifePay/GetUserAccountDetail */
export async function getUserAccountDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetUserAccountDetailParams,
  options?: API.RequestConfig
) {
  return request<API.UserAccountOutput>('/api/LifePay/GetUserAccountDetail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取我的户号列表 POST /api/LifePay/GetUserAccountList */
export async function getUserAccountList(
  body: API.QueryUserAccountListInput,
  options?: API.RequestConfig
) {
  return request<API.UserAccountListOutputPageOutput>('/api/LifePay/GetUserAccountList', {
  return request<API.UserAccountOutputPageOutput>('/api/LifePay/GetUserAccountList', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
@@ -287,6 +328,21 @@
  });
}
/** 获取我的订单详情 GET /api/LifePay/GetUserLifePayOrderDetail */
export async function getUserLifePayOrderDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetUserLifePayOrderDetailParams,
  options?: API.RequestConfig
) {
  return request<API.UserLifePayOrderOutput>('/api/LifePay/GetUserLifePayOrderDetail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取我的订单分页数据 POST /api/LifePay/GetUserLifePayOrderPage */
export async function getUserLifePayOrderPage(
  body: API.QueryLifePayOrderListInput,
packages/services/api/typings.d.ts
@@ -1592,10 +1592,6 @@
    id?: string;
  }
  interface APIgetPayStatusByOrderNoParams {
    orderNo?: string;
  }
  interface APIgetPersonalAttestationParams {
    /** 用户认证Id */
    id?: string;
@@ -1712,6 +1708,10 @@
    id?: string;
  }
  interface APIgetUserAccountDetailParams {
    id?: string;
  }
  interface APIgetUserCanAuthProductListParams {
    companyId?: string;
  }
@@ -1738,6 +1738,10 @@
  interface APIgetUserFollowInfoParams {
    userId?: string;
  }
  interface APIgetUserLifePayOrderDetailParams {
    orderNo?: string;
  }
  interface APIgetUserLifePayOrderRefundParams {
@@ -2980,6 +2984,10 @@
    currentPassword: string;
    /** 短信验证码 */
    verificationCode: string;
  }
  interface ChannelsBaseInput {
    checkChannelId?: string;
  }
  type ChargeTypeEnum = 1 | 2;
@@ -6326,7 +6334,7 @@
    code?: string;
    message?: string;
    detail?: string;
    gasParValue?: GasParValueOutput;
    gasParValue?: GasParValueOutput[];
  }
  interface GasSupportMerchantInfos {
@@ -7890,6 +7898,12 @@
    openId?: string;
    attach?: string;
    payAppId?: string;
    checkChannelId?: string;
  }
  interface GetPayStatusByOrderNoInput {
    checkChannelId?: string;
    orderNo?: string;
  }
  interface GetPermissionListResultDto {
@@ -12317,6 +12331,7 @@
    userId?: string;
    /** 渠道Id */
    channelId?: string;
    checkChannelId?: string;
    productData?: LifeElectricData;
  }
@@ -12337,6 +12352,7 @@
    userId?: string;
    /** 渠道Id */
    channelId?: string;
    checkChannelId?: string;
    productData?: LifeGasData;
  }
@@ -12350,6 +12366,8 @@
    /** 用户手机号 */
    phoneNumber?: string;
    lifePayType?: LifePayTypeEnum;
    /** 渠道名称 */
    channelName?: string;
    lifePayOrderType?: LifePayOrderTypeEnum;
    /** 订单号 */
    orderNo?: string;
@@ -12389,6 +12407,7 @@
  type LifePayOrderTypeEnum = 10 | 20 | 30;
  interface LifePayPhoneMesssageCodeLoginInput {
    checkChannelId?: string;
    /** 手机号 */
    phoneNumber: string;
  }
@@ -12428,6 +12447,7 @@
    userId?: string;
    /** 渠道Id */
    channelId?: string;
    checkChannelId?: string;
    productData?: LifePhoneData;
  }
@@ -13706,7 +13726,8 @@
    | 30
    | 31
    | 32
    | 40;
    | 40
    | 42;
  interface OrderChangedBzContentInput {
    outBizNo?: string;
@@ -16253,6 +16274,7 @@
    userId?: string;
    /** 搜索关键词 */
    keyWords?: string;
    checkChannelId?: string;
  }
  interface QueryMatchMakingApplyByOrderInput {
@@ -17646,6 +17668,7 @@
    h5Type?: string;
    openId?: string;
    attach?: string;
    checkChannelId?: string;
  }
  interface SetManyContractTemplateHandSignKeyInput {
@@ -19548,7 +19571,7 @@
    staffCount?: number;
  }
  interface UserAccountListOutput {
  interface UserAccountOutput {
    id?: string;
    lifePayType?: LifePayOrderTypeEnum;
    /** 运营商 */
@@ -19568,10 +19591,10 @@
    isDeleted?: boolean;
  }
  interface UserAccountListOutputPageOutput {
  interface UserAccountOutputPageOutput {
    pageModel?: Pagination;
    objectData?: any;
    data?: UserAccountListOutput[];
    data?: UserAccountOutput[];
  }
  interface UserAttentionsDto {
packages/utils/common.ts
@@ -124,3 +124,6 @@
export const hiddenIDNumberForEnd6 = (realIDNumber: string) =>
  realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
export const hiddenPhoneNumber = (realPhoneNumbe: string) =>
  realPhoneNumbe.replace(/^(.{3})(?:\d+)(.{4})$/, '$1****$2');
pnpm-lock.yaml
Diff too large