From 1910e9f27373b8b4da75f076762025ceb3419965 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 12 六月 2025 15:40:50 +0800
Subject: [PATCH] fix: 暂时隐藏电信充值通道
---
packages/components/src/views/electricBillRecharge/electricBillRecharge.vue | 189 +++++++++-------------------------------------
1 files changed, 39 insertions(+), 150 deletions(-)
diff --git a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
index bd6ffdc..b181b30 100644
--- a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
+++ b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
@@ -1,164 +1,53 @@
<template>
- <Form
- :model-value="form"
- ref="formRef"
- :rules="rules"
- label-position="top"
- class="order-bill-recharge electric"
- >
- <FormItem label="鎵�鍦ㄥ煄甯�" class="bole-form-item" prop="type" required>
- <ChooseInputWithPicker
- v-model="form.type"
- placeholder="璇烽�夋嫨鍩庡競"
- :value-enum="IspCodeText"
- />
- </FormItem>
- <FormItem label="鐢电綉绫诲瀷" class="bole-form-item" prop="type" required>
- <ChooseInputWithPicker
- v-model="form.type"
- placeholder="璇烽�夋嫨鐢电綉绫诲瀷"
- :value-enum="IspCodeText"
- />
- </FormItem>
- <FormItem label="鐢佃垂绫诲瀷" class="bole-form-item" prop="type" required>
- <ChooseInputWithPicker
- v-model="form.type"
- placeholder="璇烽�夋嫨鐢佃垂绫诲瀷"
- :value-enum="IspCodeText"
- />
- </FormItem>
- <FormItem label="鐢电綉鎴峰彿" class="bole-form-item" prop="phone" required>
- <Input
- v-model.trim="form.phone"
- class="bole-input-text"
- placeholder="璇疯緭鍏�13浣嶆暟瀛楃紪鍙�"
- type="text"
- />
- </FormItem>
- <FormItem label="閫夋嫨鍏呭�奸噾棰�" class="bole-form-item" prop="parValue" required>
- <RadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group">
- <Radio
- :label="item"
- :key="item"
- shape="button"
- v-for="item in parValueList"
- class="parValue-item"
- >
- <div class="parValue-item-inner">
- <div class="amount-wrapper">
- <div class="amount">{{ item }}</div>
- <div class="unit">鍏�</div>
- </div>
- <div class="price-wrapper">
- <div class="price-text">鎶樺悗</div>
- <div class="price">{{ blLifeRecharge.getRechargeParValue(item, rate) }}鍏�</div>
- </div>
- <div class="discountTag">{{ rate * 100 }}鎶�</div>
- </div>
- </Radio>
- </RadioGroup>
- </FormItem>
- <div class="common-content">
- <nut-button class="recharge-button" type="primary" @click="recharge">
- <div class="recharge-button-inner">
- <div>锟{ realParValue }}</div>
- <div class="recharge-button-text">绔嬪嵆鍏呭��</div>
- </div>
- </nut-button>
- <RechargeTipsView :tips="tips" />
- </div>
- <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay">
- <template #tips>
- 璇ヤ骇鍝佷负鎱㈠厖妯″紡锛�0-72灏忔椂鍐呭埌璐︼紝浠嬫剰璇峰嬁浠樻锛佸厖鍊煎墠璇蜂粩缁嗛槄璇诲厖鍊奸』鐭ワ紒
- </template>
- <template #info>
- <ConfirmDialogInfoItem label="鐢电綉绫诲瀷" content="鍥藉鐢电綉" />
- <ConfirmDialogInfoItem label="鐢佃垂绫诲瀷" content="浣忓畢" />
- <ConfirmDialogInfoItem label="鍏呭�奸噾棰�" :content="`锟�${form.parValue}`" danger />
- <ConfirmDialogInfoItem label="浼樻儬閲戦" :content="`锟�${discountParValue}`" />
- <ConfirmDialogInfoItem label="瀹炰粯閲戦" :content="`锟�${realParValue}`" danger />
- </template>
- <template #warning>
- 鍚屼竴鐢佃垂璐︽埛鍦ㄥ厖鍊兼湡闂达紝鏈埌璐﹀墠鍒囧嬁鍦ㄥ叾浠栦换浣曞钩鍙板啀娆″厖鍊笺�傚洜姝ら�犳垚鐨勮祫閲戞崯澶遍』鐢ㄦ埛鑷鎵挎媴锛侊紒锛�
- </template>
- </ConfirmDialog>
- </Form>
+ <ElectricBillRechargeStep1 v-if="current === 'step1'" />
+ <ElectricBillRechargeStep2
+ v-else-if="current === 'step2'"
+ v-bind="props"
+ @go-pay="emit('goPay', $event)"
+ @paySuccess="emit('paySuccess', $event)"
+ @missName="emit('missName', $event)"
+ @editUserAccount="emit('editUserAccount', $event)"
+ />
</template>
<script setup lang="ts">
-import { Form, FormItem, RadioGroup, Radio, Input, Button as NutButton } from '@nutui/nutui-taro';
-import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
-import { reactive, ref, computed } from 'vue';
-import BlRadio from '../../components/Radio/Radio.vue';
-import { IspCodeText, IspCode } from '../../constants';
-import { useLifeRechargeContext } from '../../utils';
-import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue';
-import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue';
-import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue';
-import ChooseInputWithPicker from '../../components/Input/ChooseInputWithPicker.vue';
+import { computed, provide, watch } from 'vue';
+import { useStepper } from 'senin-mini/hooks';
+import { ElectricBillRechargeContextKey } from './context';
+import ElectricBillRechargeStep1 from './ElectricBillRechargeStep1.vue';
+import ElectricBillRechargeStep2 from './ElectricBillRechargeStep2.vue';
+import { RechargeProps } from '../PhoneBillRecharge/types';
defineOptions({
name: 'electricBillRecharge',
});
-const emit = defineEmits<{
- (e: 'goPay'): void;
-}>();
-
-const form = reactive({
- ispCode: IspCode.yidong,
- phone: '',
- parValue: 100,
- type: IspCodeText.yidong,
+const props = withDefaults(defineProps<RechargeProps>(), {
+ isDev: false,
});
-const rate = 0.96;
+const stepperInfo = useStepper(['step1', 'step2'], 'step2');
+const current = computed(() => stepperInfo.current.value);
-const parValueList = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1500, 2000, 3000];
+const emit = defineEmits<{
+ (e: 'goPay', orderNo: string): void;
+ (e: 'paySuccess', orderNo: string): void;
+ (e: 'missName', userAccountId: string): void;
+ (e: 'editUserAccount', userAccountId: string): void;
+ (e: 'currentChange', current: 'step1' | 'step2'): void;
+}>();
-const realParValue = computed(() => blLifeRecharge.getRechargeParValue(form.parValue, rate));
-const discountParValue = computed(() => form.parValue - Number(realParValue.value));
-
-const { blLifeRecharge } = useLifeRechargeContext();
-
-const rules = reactive<FormRules>({});
-
-const formRef = ref<any>(null);
-
-function handleSubmit() {
- if (!formRef.value) return;
- formRef.value.validate().then(({ valid, errors }: any) => {
- if (valid) {
- }
- });
-}
-
-const tips = [
- '骞冲彴鎻愪緵鎱㈠厖鏈嶅姟锛岃鍗曟彁浜ゅ悗锛岀數璐瑰皢浜�0 - 72 灏忔椂鍐呭埌璐︼紝鑻ユ湭鑳芥寜鏃跺埌璐︼紝绯荤粺灏嗚嚜鍔ㄥ彂璧烽��娆俱��',
- '鍏呭�兼湡闂达紝鑻ュ悓涓�璐︽埛鐨勫厖鍊兼鏈埌璐︼紝璇峰嬁鍦ㄥ叾浠栧钩鍙伴噸澶嶅厖鍊硷紝鍥犱笂杩版搷浣滃鑷寸殑璧勯噾鎹熷け锛岀敱鐢ㄦ埛鑷鎵挎媴銆�',
- '涓虹‘淇濆厖鍊奸『鍒╄繘琛岋紝鐩墠骞冲彴涓嶆敮鎸佸娆犳閲戦瓒呰繃1000鍏冪殑璐︽埛杩涜鍏呭�硷紝涓旀瘡娆″厖鍊奸噾棰濆繀椤婚珮浜庢瑺璐规�婚銆�',
- '濡傛帴鍒伴檶鐢熸潵鐢碉紝瀵规柟浠ョ即璐规垨璇搷浣滅瓑鐞嗙敱瑕佹眰澶勭悊娆鹃」锛屽姟蹇呯珛鍗虫媺榛戯紝璋ㄩ槻璇堥獥銆�',
- '涓嬪崟鏃讹紝璇锋偍鍔″繀鍑嗙‘濉啓瀹屾暣鐨勭渷甯傚強鎴峰彿淇℃伅銆傚厖鍊煎畬鎴愬悗锛屽彂绁ㄧ敱杩愯惀鍟嗘彁渚涳紝鎮ㄥ彲鐧诲綍缃戜笂钀ヤ笟鍘呬笅杞藉搴旂殑鐢靛瓙鍙戠エ銆�',
-];
-
-const confirmDialogVisible = ref(false);
-
-function recharge() {
- confirmDialogVisible.value = true;
-}
-
-function goPay() {
- emit('goPay');
-}
-</script>
-<style lang="scss">
-.order-bill-recharge {
- &.electric {
- .nut-dialog {
- .nut-dialog__content {
- max-height: 700px;
- }
- }
+watch(
+ current,
+ (newVal) => {
+ emit('currentChange', newVal);
+ },
+ {
+ immediate: true,
}
-}
-</style>
+);
+
+provide(ElectricBillRechargeContextKey, {
+ ...stepperInfo,
+});
+</script>
--
Gitblit v1.9.1