feat(recharge): add full virtual recharge flow for aigc credits
- Replace legacy recharge API endpoints with new dedicated VirtualRechargeApi with sensitive request logging - Implement pending order tracking, automatic payment reconciliation, and recovery for interrupted payments - Overhaul recharge component logic to support both pre-defined package and custom amount recharge - Fix currency price formatting to consistently display 2 decimal places for all monetary values - Remove unused xiaoqi-avatar asset and related component imports - Simplify Vite build asset naming configuration - Switch application to test development mode
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<input
|
||||
class="custom-input"
|
||||
type="number"
|
||||
:maxlength="4"
|
||||
:maxlength="6"
|
||||
:value="modelValue"
|
||||
@focus="emit('select')"
|
||||
@input="handleInput"
|
||||
@@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: "",
|
||||
@@ -33,12 +33,16 @@ defineProps({
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:modelValue", "select"]);
|
||||
const MAX_CUSTOM_AMOUNT = 9999;
|
||||
const MAX_CUSTOM_AMOUNT = 999999;
|
||||
|
||||
const handleInput = (event) => {
|
||||
const rawValue = event?.detail?.value ?? event?.target?.value ?? "";
|
||||
const digits = String(rawValue).replace(/\D/g, "");
|
||||
const value = digits ? String(Math.min(Number(digits), MAX_CUSTOM_AMOUNT)) : "";
|
||||
const amountText = String(rawValue).trim();
|
||||
const value = /^\d*$/.test(amountText)
|
||||
? amountText
|
||||
? String(Math.min(Number(amountText), MAX_CUSTOM_AMOUNT))
|
||||
: ""
|
||||
: props.modelValue;
|
||||
emit("select");
|
||||
emit("update:modelValue", value);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user