收敛前端金额表单命名
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
import type { ApiResponse } from '@/shared/types/types'
|
||||
import type { RealnameStatusValue, RiskStatus, UserStatus } from '@/types/status'
|
||||
import type { RealnameStatusValue, RiskStatus, UserStatus } from '@/shared/types/status'
|
||||
|
||||
export interface AuthUser {
|
||||
id: number
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
import type { ApiResponse } from '@/shared/types/types'
|
||||
import type { RealnameStatusValue } from '@/types/status'
|
||||
import type { RealnameStatusValue } from '@/shared/types/status'
|
||||
|
||||
export interface RealnameStatus {
|
||||
status: RealnameStatusValue
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
|
||||
import type { ApiResponse, PaginatedResult } from '@/shared/types/types'
|
||||
import type { DisputeStatus } from '@/types/status'
|
||||
import type { DisputeStatus } from '@/shared/types/status'
|
||||
|
||||
export interface Dispute {
|
||||
id: number
|
||||
|
||||
@@ -111,10 +111,10 @@ export interface PostRentalNotice {
|
||||
|
||||
export interface SubmitCheckoutPayload {
|
||||
content: string
|
||||
consumable_amount?: number
|
||||
consumableAmountYuan?: number
|
||||
coin_consumed_m: number
|
||||
other_amount?: number
|
||||
deposit_deduct_amount?: number
|
||||
otherAmountYuan?: number
|
||||
depositDeductAmountYuan?: number
|
||||
evidence_urls: string[]
|
||||
reason?: string
|
||||
}
|
||||
@@ -145,10 +145,10 @@ export interface RefundStatus {
|
||||
function toCheckoutRequest(payload: SubmitCheckoutPayload): SubmitCheckoutRequest {
|
||||
return {
|
||||
content: payload.content,
|
||||
consumable_amount_cent: yuanToCent(payload.consumable_amount),
|
||||
consumable_amount_cent: yuanToCent(payload.consumableAmountYuan),
|
||||
coin_consumed_m: payload.coin_consumed_m,
|
||||
other_amount_cent: yuanToCent(payload.other_amount),
|
||||
deposit_deduct_amount_cent: yuanToCent(payload.deposit_deduct_amount),
|
||||
other_amount_cent: yuanToCent(payload.otherAmountYuan),
|
||||
deposit_deduct_amount_cent: yuanToCent(payload.depositDeductAmountYuan),
|
||||
evidence_urls: payload.evidence_urls,
|
||||
reason: payload.reason,
|
||||
}
|
||||
|
||||
@@ -78,16 +78,16 @@ export function calculateCheckoutTotal(
|
||||
}
|
||||
|
||||
export function calculateCounterTotal(counterForm: {
|
||||
consumable_amount: number
|
||||
consumableAmountYuan: number
|
||||
coin_consumed_m: number
|
||||
other_amount: number
|
||||
deposit_deduct_amount: number
|
||||
otherAmountYuan: number
|
||||
depositDeductAmountYuan: number
|
||||
}): number {
|
||||
return roundMoney(
|
||||
counterForm.consumable_amount +
|
||||
counterForm.consumableAmountYuan +
|
||||
counterForm.coin_consumed_m +
|
||||
counterForm.other_amount +
|
||||
counterForm.deposit_deduct_amount
|
||||
counterForm.otherAmountYuan +
|
||||
counterForm.depositDeductAmountYuan
|
||||
)
|
||||
}
|
||||
|
||||
@@ -127,10 +127,10 @@ export function hydrateCounterFormFromOrder(order: Order | null) {
|
||||
try {
|
||||
const info = JSON.parse(order.counter_info) as Record<string, any>
|
||||
return {
|
||||
consumable_amount: readNumber(info.consumable_amount),
|
||||
consumableAmountYuan: readNumber(info.consumableAmountYuan),
|
||||
coin_consumed_m: readNumber(info.coin_consumed_m),
|
||||
other_amount: readNumber(info.other_amount),
|
||||
deposit_deduct_amount: readNumber(info.deposit_deduct_amount),
|
||||
otherAmountYuan: readNumber(info.otherAmountYuan),
|
||||
depositDeductAmountYuan: readNumber(info.depositDeductAmountYuan),
|
||||
reason: String(info.reason || ''),
|
||||
evidenceText: String(info.evidence || ''),
|
||||
}
|
||||
|
||||
@@ -4,17 +4,17 @@ import type { Order } from '../api/orders'
|
||||
|
||||
export interface CheckoutForm {
|
||||
content: string
|
||||
consumable_amount: number
|
||||
consumableAmountYuan: number
|
||||
coin_consumed_m: number
|
||||
other_amount: number
|
||||
otherAmountYuan: number
|
||||
evidenceText: string
|
||||
}
|
||||
|
||||
export interface CounterForm {
|
||||
consumable_amount: number
|
||||
consumableAmountYuan: number
|
||||
coin_consumed_m: number
|
||||
other_amount: number
|
||||
deposit_deduct_amount: number
|
||||
otherAmountYuan: number
|
||||
depositDeductAmountYuan: number
|
||||
reason: string
|
||||
evidenceText: string
|
||||
}
|
||||
@@ -32,17 +32,17 @@ export function useSettlement(order: Ref<Order | null>) {
|
||||
|
||||
const checkoutForm = ref<CheckoutForm>({
|
||||
content: '',
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
evidenceText: '',
|
||||
})
|
||||
|
||||
const counterForm = ref<CounterForm>({
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
deposit_deduct_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
depositDeductAmountYuan: 0,
|
||||
reason: '',
|
||||
evidenceText: '',
|
||||
})
|
||||
@@ -58,9 +58,9 @@ export function useSettlement(order: Ref<Order | null>) {
|
||||
try {
|
||||
await submitCheckout(order.value.id, {
|
||||
content: checkoutForm.value.content.trim(),
|
||||
consumable_amount: checkoutForm.value.consumable_amount,
|
||||
consumableAmountYuan: checkoutForm.value.consumableAmountYuan,
|
||||
coin_consumed_m: checkoutForm.value.coin_consumed_m,
|
||||
other_amount: checkoutForm.value.other_amount,
|
||||
otherAmountYuan: checkoutForm.value.otherAmountYuan,
|
||||
evidence_urls: linesToList(checkoutForm.value.evidenceText),
|
||||
})
|
||||
onSuccess?.()
|
||||
@@ -95,10 +95,10 @@ export function useSettlement(order: Ref<Order | null>) {
|
||||
const reasonText = counterForm.value.reason.trim()
|
||||
await counterCheckout(order.value.id, {
|
||||
content: reasonText,
|
||||
consumable_amount: counterForm.value.consumable_amount,
|
||||
consumableAmountYuan: counterForm.value.consumableAmountYuan,
|
||||
coin_consumed_m: counterForm.value.coin_consumed_m,
|
||||
other_amount: counterForm.value.other_amount,
|
||||
deposit_deduct_amount: counterForm.value.deposit_deduct_amount,
|
||||
otherAmountYuan: counterForm.value.otherAmountYuan,
|
||||
depositDeductAmountYuan: counterForm.value.depositDeductAmountYuan,
|
||||
reason: reasonText,
|
||||
evidence_urls: linesToList(counterForm.value.evidenceText),
|
||||
})
|
||||
@@ -119,10 +119,10 @@ export function useSettlement(order: Ref<Order | null>) {
|
||||
const reasonText = reason.trim()
|
||||
await counterCheckout(order.value.id, {
|
||||
content: reasonText,
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
deposit_deduct_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
depositDeductAmountYuan: 0,
|
||||
reason: reasonText,
|
||||
evidence_urls: [],
|
||||
})
|
||||
|
||||
@@ -51,17 +51,17 @@ const listingCode = computed(() =>
|
||||
const handoffContent = ref('')
|
||||
const checkoutForm = ref({
|
||||
content: '',
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
evidenceText: '',
|
||||
})
|
||||
const resourceUsage = ref<Record<string, number>>({})
|
||||
const counterForm = ref({
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
deposit_deduct_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
depositDeductAmountYuan: 0,
|
||||
reason: '',
|
||||
evidenceText: '',
|
||||
})
|
||||
@@ -231,19 +231,19 @@ async function handleSubmitCheckout() {
|
||||
returning.value = true
|
||||
try {
|
||||
const consumableAmount = resourceChargeAmount.value
|
||||
checkoutForm.value.consumable_amount = consumableAmount
|
||||
checkoutForm.value.consumableAmountYuan = consumableAmount
|
||||
await submitCheckout(order.value.id, {
|
||||
content: checkoutContentWithSummary(),
|
||||
consumable_amount: consumableAmount,
|
||||
consumableAmountYuan: consumableAmount,
|
||||
coin_consumed_m: checkoutForm.value.coin_consumed_m,
|
||||
other_amount: checkoutForm.value.other_amount,
|
||||
otherAmountYuan: checkoutForm.value.otherAmountYuan,
|
||||
evidence_urls: linesToList(checkoutForm.value.evidenceText),
|
||||
})
|
||||
checkoutForm.value = {
|
||||
content: '',
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
evidenceText: '',
|
||||
}
|
||||
resourceUsage.value = {}
|
||||
@@ -283,10 +283,10 @@ async function handleCounterCheckout() {
|
||||
const reasonText = counterForm.value.reason.trim()
|
||||
await counterCheckout(order.value.id, {
|
||||
content: reasonText,
|
||||
consumable_amount: counterForm.value.consumable_amount,
|
||||
consumableAmountYuan: counterForm.value.consumableAmountYuan,
|
||||
coin_consumed_m: counterForm.value.coin_consumed_m,
|
||||
other_amount: counterForm.value.other_amount,
|
||||
deposit_deduct_amount: counterForm.value.deposit_deduct_amount,
|
||||
otherAmountYuan: counterForm.value.otherAmountYuan,
|
||||
depositDeductAmountYuan: counterForm.value.depositDeductAmountYuan,
|
||||
reason: reasonText,
|
||||
evidence_urls: linesToList(counterForm.value.evidenceText),
|
||||
})
|
||||
@@ -592,10 +592,10 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
function hydrateCounterForm() {
|
||||
if (!order.value?.checkout) return
|
||||
const checkout = order.value.checkout
|
||||
counterForm.value.consumable_amount = amountYuan(checkout.consumable_amount_cent)
|
||||
counterForm.value.consumableAmountYuan = amountYuan(checkout.consumable_amount_cent)
|
||||
counterForm.value.coin_consumed_m = checkout.coin_consumed_m
|
||||
counterForm.value.other_amount = amountYuan(checkout.other_amount_cent)
|
||||
counterForm.value.deposit_deduct_amount = amountYuan(checkout.deposit_deduct_amount_cent)
|
||||
counterForm.value.otherAmountYuan = amountYuan(checkout.other_amount_cent)
|
||||
counterForm.value.depositDeductAmountYuan = amountYuan(checkout.deposit_deduct_amount_cent)
|
||||
}
|
||||
|
||||
function linesToList(value: string) {
|
||||
@@ -882,7 +882,7 @@ async function copyListingCode() {
|
||||
<template #input>
|
||||
<div class="coin-input-wrap">
|
||||
<input
|
||||
v-model.number="checkoutForm.other_amount"
|
||||
v-model.number="checkoutForm.otherAmountYuan"
|
||||
type="number"
|
||||
placeholder="不含上方额外物资"
|
||||
class="custom-inline-input"
|
||||
@@ -901,7 +901,7 @@ async function copyListingCode() {
|
||||
</div>
|
||||
<div>
|
||||
<span>其他押金赔付</span>
|
||||
<strong>¥{{ money(checkoutForm.other_amount) }}</strong>
|
||||
<strong>¥{{ money(checkoutForm.otherAmountYuan) }}</strong>
|
||||
<em>从押金赔付扣除</em>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1090,7 +1090,7 @@ async function copyListingCode() {
|
||||
<van-field label="额外消耗品已用">
|
||||
<template #input>
|
||||
<input
|
||||
v-model.number="counterForm.consumable_amount"
|
||||
v-model.number="counterForm.consumableAmountYuan"
|
||||
type="number"
|
||||
class="custom-inline-input"
|
||||
/>
|
||||
@@ -1108,7 +1108,7 @@ async function copyListingCode() {
|
||||
<van-field label="其他押金扣款">
|
||||
<template #input>
|
||||
<input
|
||||
v-model.number="counterForm.other_amount"
|
||||
v-model.number="counterForm.otherAmountYuan"
|
||||
type="number"
|
||||
class="custom-inline-input"
|
||||
/>
|
||||
@@ -1117,7 +1117,7 @@ async function copyListingCode() {
|
||||
<van-field label="押金赔付扣除" required>
|
||||
<template #input>
|
||||
<input
|
||||
v-model.number="counterForm.deposit_deduct_amount"
|
||||
v-model.number="counterForm.depositDeductAmountYuan"
|
||||
type="number"
|
||||
class="custom-inline-input"
|
||||
/>
|
||||
|
||||
@@ -60,17 +60,17 @@ const checkingPayment = ref(false)
|
||||
let paymentPollingTimer: number | undefined
|
||||
const checkoutForm = ref({
|
||||
content: '',
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
evidenceText: '',
|
||||
})
|
||||
const resourceUsage = ref<Record<string, number>>({})
|
||||
const counterForm = ref({
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
deposit_deduct_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
depositDeductAmountYuan: 0,
|
||||
reason: '',
|
||||
evidenceText: '',
|
||||
})
|
||||
@@ -321,19 +321,19 @@ async function handleSubmitCheckout() {
|
||||
returning.value = true
|
||||
try {
|
||||
const consumableAmount = resourceChargeAmount.value
|
||||
checkoutForm.value.consumable_amount = consumableAmount
|
||||
checkoutForm.value.consumableAmountYuan = consumableAmount
|
||||
await submitCheckout(order.value.id, {
|
||||
content: checkoutContentWithSummary(),
|
||||
consumable_amount: consumableAmount,
|
||||
consumableAmountYuan: consumableAmount,
|
||||
coin_consumed_m: checkoutForm.value.coin_consumed_m,
|
||||
other_amount: checkoutForm.value.other_amount,
|
||||
otherAmountYuan: checkoutForm.value.otherAmountYuan,
|
||||
evidence_urls: linesToList(checkoutForm.value.evidenceText),
|
||||
})
|
||||
checkoutForm.value = {
|
||||
content: '',
|
||||
consumable_amount: 0,
|
||||
consumableAmountYuan: 0,
|
||||
coin_consumed_m: 0,
|
||||
other_amount: 0,
|
||||
otherAmountYuan: 0,
|
||||
evidenceText: '',
|
||||
}
|
||||
resourceUsage.value = {}
|
||||
@@ -367,10 +367,10 @@ async function handleCounterCheckout() {
|
||||
const reasonText = counterForm.value.reason.trim()
|
||||
await counterCheckout(order.value.id, {
|
||||
content: reasonText,
|
||||
consumable_amount: counterForm.value.consumable_amount,
|
||||
consumableAmountYuan: counterForm.value.consumableAmountYuan,
|
||||
coin_consumed_m: counterForm.value.coin_consumed_m,
|
||||
other_amount: counterForm.value.other_amount,
|
||||
deposit_deduct_amount: counterForm.value.deposit_deduct_amount,
|
||||
otherAmountYuan: counterForm.value.otherAmountYuan,
|
||||
depositDeductAmountYuan: counterForm.value.depositDeductAmountYuan,
|
||||
reason: reasonText,
|
||||
evidence_urls: linesToList(counterForm.value.evidenceText),
|
||||
})
|
||||
@@ -641,10 +641,10 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
function hydrateCounterForm() {
|
||||
if (!order.value?.checkout) return
|
||||
const checkout = order.value.checkout
|
||||
counterForm.value.consumable_amount = amountYuan(checkout.consumable_amount_cent)
|
||||
counterForm.value.consumableAmountYuan = amountYuan(checkout.consumable_amount_cent)
|
||||
counterForm.value.coin_consumed_m = checkout.coin_consumed_m
|
||||
counterForm.value.other_amount = amountYuan(checkout.other_amount_cent)
|
||||
counterForm.value.deposit_deduct_amount = amountYuan(checkout.deposit_deduct_amount_cent)
|
||||
counterForm.value.otherAmountYuan = amountYuan(checkout.other_amount_cent)
|
||||
counterForm.value.depositDeductAmountYuan = amountYuan(checkout.deposit_deduct_amount_cent)
|
||||
}
|
||||
|
||||
function linesToList(value: string) {
|
||||
@@ -911,7 +911,7 @@ async function copyListingCode() {
|
||||
</el-form-item>
|
||||
<el-form-item label="其他押金赔付(元)">
|
||||
<el-input-number
|
||||
v-model="checkoutForm.other_amount"
|
||||
v-model="checkoutForm.otherAmountYuan"
|
||||
class="full-control"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
@@ -930,7 +930,7 @@ async function copyListingCode() {
|
||||
</div>
|
||||
<div>
|
||||
<span>其他押金赔付</span>
|
||||
<strong>¥{{ money(checkoutForm.other_amount) }}</strong>
|
||||
<strong>¥{{ money(checkoutForm.otherAmountYuan) }}</strong>
|
||||
<em>作为押金赔付扣除,和额外消耗品分开展示</em>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1022,7 +1022,7 @@ async function copyListingCode() {
|
||||
<el-form class="form-grid" label-position="top">
|
||||
<el-form-item label="额外消耗品已用金额">
|
||||
<el-input-number
|
||||
v-model="counterForm.consumable_amount"
|
||||
v-model="counterForm.consumableAmountYuan"
|
||||
class="full-control"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
@@ -1040,7 +1040,7 @@ async function copyListingCode() {
|
||||
</el-form-item>
|
||||
<el-form-item label="其他押金扣款(元)">
|
||||
<el-input-number
|
||||
v-model="counterForm.other_amount"
|
||||
v-model="counterForm.otherAmountYuan"
|
||||
class="full-control"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
@@ -1049,7 +1049,7 @@ async function copyListingCode() {
|
||||
</el-form-item>
|
||||
<el-form-item label="押金扣除(元)">
|
||||
<el-input-number
|
||||
v-model="counterForm.deposit_deduct_amount"
|
||||
v-model="counterForm.depositDeductAmountYuan"
|
||||
class="full-control"
|
||||
:min="0"
|
||||
:max="amountYuan(order.deposit_amount_cent)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ChargeMode, QuantityKey, ScreenshotKey } from '@/features/listings/api/listingOptions'
|
||||
import type { PublishDraft, PublishForm } from '@/types/publish'
|
||||
import type { PublishDraft, PublishForm } from '@/shared/types/publish'
|
||||
|
||||
export function defaultPublishForm(): PublishForm {
|
||||
return {
|
||||
@@ -19,7 +19,7 @@ export function defaultPublishForm(): PublishForm {
|
||||
online_end: '',
|
||||
ban_record: '',
|
||||
common_regions: [],
|
||||
deposit_amount: '',
|
||||
depositAmountYuan: '',
|
||||
remark: '',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
removePublishDraft,
|
||||
writePublishDraft,
|
||||
} from '@/features/seller/composables/usePublishDraft'
|
||||
import type { PublishForm } from '@/types/publish'
|
||||
import type { PublishForm } from '@/shared/types/publish'
|
||||
import { yuanToCent } from '@/shared/utils/money'
|
||||
import {
|
||||
commonOnlineTimes,
|
||||
@@ -505,15 +505,15 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
function syncRecommendedDeposit() {
|
||||
const recommended = pricing.recommendedDepositAmount.value
|
||||
if (recommended <= 0) return
|
||||
const current = Number(form.deposit_amount)
|
||||
if (form.deposit_amount === '' || !Number.isFinite(current) || current < recommended) {
|
||||
form.deposit_amount = recommended
|
||||
const current = Number(form.depositAmountYuan)
|
||||
if (form.depositAmountYuan === '' || !Number.isFinite(current) || current < recommended) {
|
||||
form.depositAmountYuan = recommended
|
||||
}
|
||||
}
|
||||
|
||||
function useRecommendedDeposit() {
|
||||
if (pricing.recommendedDepositAmount.value > 0) {
|
||||
form.deposit_amount = pricing.recommendedDepositAmount.value
|
||||
form.depositAmountYuan = pricing.recommendedDepositAmount.value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
asset_summary: buildAssetSummary(),
|
||||
screenshot_urls: pricing.screenshotUrls.value,
|
||||
price_cent: yuanToCent(pricing.calculatedFinalPrice.value),
|
||||
deposit_amount_cent: yuanToCent(Number(form.deposit_amount)),
|
||||
deposit_amount_cent: yuanToCent(Number(form.depositAmountYuan)),
|
||||
agreed_virtual_asset_sale: virtualAssetSaleAgreementChecked.value,
|
||||
agreed_seller_agreement: sellerAgreementChecked.value,
|
||||
})
|
||||
@@ -624,17 +624,17 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
}
|
||||
}
|
||||
if (pricing.banRecordOptions.value.length && !form.ban_record) return '请选择封禁记录'
|
||||
if (form.deposit_amount === '' || Number(form.deposit_amount) < 0) return '请填写押金'
|
||||
if (!Number.isFinite(Number(form.deposit_amount))) return '押金格式不正确'
|
||||
if (form.depositAmountYuan === '' || Number(form.depositAmountYuan) < 0) return '请填写押金'
|
||||
if (!Number.isFinite(Number(form.depositAmountYuan))) return '押金格式不正确'
|
||||
if (
|
||||
pricing.recommendedDepositAmount.value > 0 &&
|
||||
Number(form.deposit_amount) < pricing.recommendedDepositAmount.value
|
||||
Number(form.depositAmountYuan) < pricing.recommendedDepositAmount.value
|
||||
) {
|
||||
return `押金不能低于智能推荐 ¥${pricing.recommendedDepositAmount.value}`
|
||||
}
|
||||
if (
|
||||
pricing.calculatedConsumablePrice.value > 0 &&
|
||||
Number(form.deposit_amount) <= pricing.calculatedConsumablePrice.value
|
||||
Number(form.depositAmountYuan) <= pricing.calculatedConsumablePrice.value
|
||||
) {
|
||||
return `押金必须大于额外消耗品总价值 ¥${pricing.calculatedConsumablePrice.value}`
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ function selectRadio<T extends string>(value: T, setter: (value: T) => void) {
|
||||
<div class="form-section">
|
||||
<h2 class="section-title">押金与价格</h2>
|
||||
<van-field
|
||||
v-model="form.deposit_amount"
|
||||
v-model="form.depositAmountYuan"
|
||||
label="押金"
|
||||
type="number"
|
||||
required
|
||||
|
||||
@@ -484,7 +484,7 @@ function selectDailyLoss(value: string | number) {
|
||||
>
|
||||
<div class="deposit-control">
|
||||
<el-input-number
|
||||
v-model="form.deposit_amount"
|
||||
v-model="form.depositAmountYuan"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
:placeholder="priceConfig.deposit_placeholder"
|
||||
@@ -631,7 +631,9 @@ function selectDailyLoss(value: string | number) {
|
||||
<div>
|
||||
<span>押金价格</span>
|
||||
<strong>{{
|
||||
form.deposit_amount === '' ? '--' : `¥${formatMoney(Number(form.deposit_amount))}`
|
||||
form.depositAmountYuan === ''
|
||||
? '--'
|
||||
: `¥${formatMoney(Number(form.depositAmountYuan))}`
|
||||
}}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
QuantityKey,
|
||||
ScreenshotKey,
|
||||
} from '@/features/listings/api/listingOptions'
|
||||
import type { PublishForm } from '@/types/publish'
|
||||
import type { PublishForm } from '@/shared/types/publish'
|
||||
import {
|
||||
buildDepositBreakdownItems,
|
||||
calculateConsumablePrice,
|
||||
|
||||
@@ -17,7 +17,7 @@ export type PublishForm = {
|
||||
online_end: string
|
||||
ban_record: string
|
||||
common_regions: string[]
|
||||
deposit_amount: number | ''
|
||||
depositAmountYuan: number | ''
|
||||
remark: string
|
||||
}
|
||||
|
||||
|
||||
@@ -48,13 +48,6 @@ export function centToDisplayYuan(cent: number | undefined | null): number {
|
||||
return roundMoney(centToYuan(cent))
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 使用 centToDisplayYuan。保留导出避免旧导入立刻失效。
|
||||
*/
|
||||
export function centToJiao(cent: number | undefined | null): number {
|
||||
return centToDisplayYuan(cent)
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化分为角字符串(保留1位小数)
|
||||
* @example formatCent(12345) -> "123.5"
|
||||
|
||||
@@ -7,7 +7,11 @@ import type {
|
||||
PublishRatioConfig,
|
||||
PublishSalePriceConfig,
|
||||
} from '@/features/listings/api/listingOptions'
|
||||
import type { DepositBreakdownItem, PublishForm, PublishPlatformPricing } from '@/types/publish'
|
||||
import type {
|
||||
DepositBreakdownItem,
|
||||
PublishForm,
|
||||
PublishPlatformPricing,
|
||||
} from '@/shared/types/publish'
|
||||
|
||||
export const dailyLossOptions = [10, 20, 30, 40, 50]
|
||||
export const commonOnlineTimes = [
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
SettlementStatus,
|
||||
UserStatus,
|
||||
WalletStatus,
|
||||
} from '@/types/status'
|
||||
} from '@/shared/types/status'
|
||||
|
||||
const listingStatusMap: Record<ListingStatus, string> = {
|
||||
draft: '草稿',
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import type { ChargeMode, QuantityKey, ScreenshotKey } from '@/features/listings/api/listingOptions'
|
||||
|
||||
export type PublishForm = {
|
||||
server_region: string
|
||||
face_owner: string
|
||||
haf_coin_amount: number | ''
|
||||
rank_level: string
|
||||
secret_kd: string
|
||||
fire_level: number | ''
|
||||
daily_loss_m: number | ''
|
||||
accelerated_sale_ratio: number | ''
|
||||
season_insurance: string
|
||||
stamina_level: string
|
||||
load_level: string
|
||||
login_method: string
|
||||
online_start: string
|
||||
online_end: string
|
||||
ban_record: string
|
||||
common_regions: string[]
|
||||
deposit_amount: number | ''
|
||||
remark: string
|
||||
}
|
||||
|
||||
export interface PublishDraft {
|
||||
form: PublishForm
|
||||
quantityValues: Record<QuantityKey, number>
|
||||
quantityModes: Record<QuantityKey, ChargeMode>
|
||||
screenshotFiles: Record<ScreenshotKey, string[]>
|
||||
selectedSkins: string[]
|
||||
}
|
||||
|
||||
export interface DepositBreakdownItem {
|
||||
label: string
|
||||
amount: number
|
||||
count: number
|
||||
}
|
||||
|
||||
export interface PublishPlatformPricing {
|
||||
buyerCoinBasePrice: number
|
||||
buyerTotalPrice: number
|
||||
buyerRatio: number
|
||||
platformMarkupAmount: number
|
||||
ruleType: 'fixed_markup' | 'ratio_subtract' | 'none' | string
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
export const listingStatuses = ['draft', 'published', 'rented', 'offline', 'abnormal'] as const
|
||||
export type ListingStatus = (typeof listingStatuses)[number]
|
||||
|
||||
export const listingReviewStatuses = ['none', 'pending', 'approved', 'rejected'] as const
|
||||
export type ListingReviewStatus = (typeof listingReviewStatuses)[number]
|
||||
|
||||
export const orderStatuses = [
|
||||
'pending_confirm',
|
||||
'pending_payment',
|
||||
'pending_handoff',
|
||||
'renting',
|
||||
'overdue',
|
||||
'pending_return_confirm',
|
||||
'pending_checkout_confirm',
|
||||
'pending_checkout_accept',
|
||||
'checkout_disputing',
|
||||
'completed',
|
||||
'cancelled',
|
||||
'closed',
|
||||
'disputing',
|
||||
'abnormal',
|
||||
] as const
|
||||
export type OrderStatus = (typeof orderStatuses)[number]
|
||||
|
||||
export const handoffStatuses = [
|
||||
'pending_owner',
|
||||
'pending_renter_confirm',
|
||||
'received',
|
||||
'pending_owner_return_confirm',
|
||||
'pending_owner_checkout',
|
||||
'pending_renter_checkout',
|
||||
'checkout_disputed',
|
||||
'returned',
|
||||
'cancelled',
|
||||
'owner_timeout',
|
||||
'renter_confirm_timeout',
|
||||
'return_overdue',
|
||||
'owner_return_confirm_timeout',
|
||||
'owner_checkout_confirm_timeout',
|
||||
'admin_closed',
|
||||
'admin_abnormal',
|
||||
'arbitrated',
|
||||
] as const
|
||||
export type HandoffStatus = (typeof handoffStatuses)[number]
|
||||
|
||||
export const settlementStatuses = [
|
||||
'unsettled',
|
||||
'pending',
|
||||
'frozen',
|
||||
'settled',
|
||||
'refunded',
|
||||
'cancelled',
|
||||
'closed',
|
||||
'disputed',
|
||||
'arbitrated',
|
||||
] as const
|
||||
export type SettlementStatus = (typeof settlementStatuses)[number]
|
||||
|
||||
export const realnameStatuses = [
|
||||
'unknown',
|
||||
'unverified',
|
||||
'pending',
|
||||
'verified',
|
||||
'rejected',
|
||||
] as const
|
||||
export type RealnameStatusValue = (typeof realnameStatuses)[number]
|
||||
|
||||
export const userStatuses = ['active', 'frozen', 'disabled'] as const
|
||||
export type UserStatus = (typeof userStatuses)[number]
|
||||
|
||||
export const riskStatuses = ['normal', 'watch', 'restricted', 'blocked'] as const
|
||||
export type RiskStatus = (typeof riskStatuses)[number]
|
||||
|
||||
export const disputeStatuses = ['open', 'processing', 'resolved', 'closed'] as const
|
||||
export type DisputeStatus = (typeof disputeStatuses)[number]
|
||||
|
||||
export const walletStatuses = ['active', 'frozen', 'disabled'] as const
|
||||
export type WalletStatus = (typeof walletStatuses)[number]
|
||||
|
||||
export const ledgerDirections = ['in', 'out', 'freeze', 'unfreeze'] as const
|
||||
export type LedgerDirection = (typeof ledgerDirections)[number]
|
||||
|
||||
export const balanceTypes = ['available', 'frozen'] as const
|
||||
export type BalanceType = (typeof balanceTypes)[number]
|
||||
Reference in New Issue
Block a user