zhengyiming
4 天以前 9453bef1fc4a3121b28ffa6617f0fbfc81d9f634
packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue
@@ -6,34 +6,36 @@
    label-position="top"
    class="order-bill-recharge phone"
  >
    <NutFormItem class="bole-form-item" prop="currentUserAccountId">
      <NutRadioGroup
        v-model="form.currentUserAccountId"
        direction="horizontal"
        class="par-account-list"
        v-if="userAccountAllList.length > 0"
        @change="handleUserAccountChange"
      >
        <NutRadio
          :label="item.id"
          shape="button"
          v-for="item in userAccountAllList"
          :key="item.id"
          >{{ item.content }}</NutRadio
    <Chunk borderRadiusSmall>
      <NutFormItem class="bole-form-item" prop="currentUserAccountId">
        <NutRadioGroup
          v-model="form.currentUserAccountId"
          direction="horizontal"
          class="par-account-list"
          v-if="userAccountAllList.length > 0"
          @change="handleUserAccountChange"
        >
      </NutRadioGroup>
      <AccountCard
        v-if="userAccountAllList.length > 0"
        title="充值手机号"
        :content="form.phone"
        :remark="form.remark"
      >
        <template #action>
          <div class="account-card-action" @click="handleAddUserAccount">新增</div>
        </template>
      </AccountCard>
      <AccountAddCard v-else @click="handleAddUserAccount" />
    </NutFormItem>
          <NutRadio
            :label="item.id"
            shape="button"
            v-for="item in userAccountAllList"
            :key="item.id"
            >{{ item.content }}</NutRadio
          >
        </NutRadioGroup>
        <AccountCard
          v-if="userAccountAllList.length > 0"
          title="充值手机号"
          :content="form.phone"
          :remark="form.remark"
        >
          <template #action>
            <div class="account-card-action" @click="handleAddUserAccount">新增</div>
          </template>
        </AccountCard>
        <AccountAddCard v-else @click="handleAddUserAccount" />
      </NutFormItem>
    </Chunk>
    <NutFormItem label="选择充值金额" class="bole-form-item" prop="parValue" required>
      <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group">
@@ -55,7 +57,7 @@
                {{ blLifeRecharge.getRechargeParValue(item, lifePayPhoneRate) }}元
              </div>
            </div>
            <div class="discountTag">{{ lifePayPhoneRate }}折</div>
            <div class="discountTag" v-if="lifePayPhoneRate > 0">{{ lifePayPhoneRate }}折</div>
          </div>
        </NutRadio>
      </NutRadioGroup>
@@ -72,7 +74,7 @@
          <div class="recharge-button-text">立即充值</div>
        </div>
      </nut-button>
      <RechargeTipsView :tips="tips" />
      <RechargeTipsView :lifePayOrderType="LifeRechargeConstants.LifePayOrderTypeEnum.话费订单" />
    </div>
    <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay">
      <template #info>
@@ -109,13 +111,13 @@
import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue';
import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue';
import { useGetRate, useGetPhoneParValue, useSetUserAccountBySelect } from '../../hooks';
import { CustomerServiceTips } from '../../constants';
import AccountAddCard from '../../components/Card/AccountAddCard.vue';
import AccountCard from '../../components/Card/AccountCard.vue';
import { usePhoneBillRechargeContext, PhoneUserAccountExtraProperties } from './context';
import SelectPayTypeFormItem from '../../components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue';
import { useSelectPayType, useGetPayStatusByOrderNo } from '../../hooks/selectPayType';
import { RechargeProps } from './types';
import Chunk from '../../components/Layout/Chunk.vue';
defineOptions({
  name: 'PhoneBillRechargeStep2',
@@ -161,6 +163,7 @@
const emit = defineEmits<{
  (e: 'goPay', orderNo: string): void;
  (e: 'paySuccess', orderNo: string): void;
  (e: 'missName', userAccountId: string): void;
}>();
const { lifePayPhoneRate } = useGetRate();
@@ -200,19 +203,14 @@
  if (!formRef.value) return;
  formRef.value.validate().then(({ valid, errors }: any) => {
    if (valid) {
      if (!form.name) {
        emit('missName', form.currentUserAccountId);
        return;
      }
      recharge();
    }
  });
}
const tips = [
  '平台提供慢充服务,订单提交后,话费将于0 - 24小时内到账。若未能按时到账,系统将自动发起退款。',
  '充值期间,若同一号码款项未到账,请勿在其他平台重复充值;主副卡不可同时充值。因上述操作导致的资金损失,由用户自行承担。',
  '本平台话费充值服务不适用于已停机号码。电信号码若有欠费,也无法完成充值。电信已完成维护的区域包括:广东、江苏、湖北、四川、江西、河北、河南、福建、辽宁。其它区域正在分批次进行维护中,在此期间可能会出现充值不成功并自动退款的情况,请您谅解。',
  '如接到陌生来电,对方以缴费或误操作等理由要求处理款项,务必立即拉黑,谨防诈骗。',
  '充值发票由运营商提供,您可登录网上营业厅下载电子发票。',
  CustomerServiceTips,
];
const confirmDialogVisible = ref(false);
@@ -221,7 +219,7 @@
}
const { state, invokeAliPay, invokeWeixinPay } = useSelectPayType({
  openId: toRef(props, 'openId'),
  getOpenId: toRef(props, 'getOpenId'),
  isInWeChat: toRef(props, 'isInWeChat'),
  isH5: toRef(props, 'isH5'),
  appId: toRef(props, 'appId'),
@@ -236,9 +234,9 @@
      channelId: blLifeRecharge.accountModel.channlesNum,
      productData: {
        ispCode: form.ispCode,
        parValue: props.isDev ? 0.1 : form.parValue,
        parValue: form.parValue,
        phone: form.phone,
        name: form.ispCode === BlLifeRecharge.constants.IspCode.dianxin ? form.name : '',
        name: form.name,
      },
    };
    let res = await blLifeRecharge.services.createLifePayPhoneOrder(params);