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>
@@ -115,6 +117,7 @@
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',
@@ -160,6 +163,7 @@
const emit = defineEmits<{
  (e: 'goPay', orderNo: string): void;
  (e: 'paySuccess', orderNo: string): void;
  (e: 'missName', userAccountId: string): void;
}>();
const { lifePayPhoneRate } = useGetRate();
@@ -196,14 +200,13 @@
const formRef = ref<any>(null);
function handleSubmit() {
  if (!form.name) {
    state.show = true;
    state.msg = '请先完善手机号所属机主姓名';
    return;
  }
  if (!formRef.value) return;
  formRef.value.validate().then(({ valid, errors }: any) => {
    if (valid) {
      if (!form.name) {
        emit('missName', form.currentUserAccountId);
        return;
      }
      recharge();
    }
  });