新增财务仪表盘并统一金额到角
This commit is contained in:
@@ -6,6 +6,7 @@ import { showToast, showDialog } from 'vant'
|
||||
import { fetchOrderChat } from '@/features/chats/api/chats'
|
||||
import { createDispute } from '@/features/disputes/api/disputes'
|
||||
import { uploadFile } from '@/shared/api/files'
|
||||
import { formatMoney } from '@/shared/utils/money'
|
||||
import {
|
||||
acceptCheckout,
|
||||
cancelOrder,
|
||||
@@ -529,7 +530,7 @@ function readUnitPrice(priceText: string) {
|
||||
}
|
||||
|
||||
function roundMoney(value: number) {
|
||||
return Math.round(value)
|
||||
return Math.round(Number(value || 0) * 10) / 10
|
||||
}
|
||||
|
||||
function roundQuantity(value: number) {
|
||||
@@ -537,7 +538,7 @@ function roundQuantity(value: number) {
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return `${roundMoney(readNumber(value))}`
|
||||
return formatMoney(readNumber(value))
|
||||
}
|
||||
|
||||
function formatHandoffRecordType(type: string) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
type Order,
|
||||
type PaymentOrder,
|
||||
} from '@/features/orders/api/orders'
|
||||
import { formatMoney } from '@/shared/utils/money'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { formatDateMinute } from '@/utils/time'
|
||||
import { formatListingNo } from '@/utils/listingDisplay'
|
||||
@@ -119,7 +120,7 @@ function readError(error: unknown, fallback: string) {
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return Math.round(Number(value || 0))
|
||||
return formatMoney(Number(value || 0))
|
||||
}
|
||||
|
||||
function isOwner(order: Order) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import QRCode from 'qrcode'
|
||||
import { fetchOrderChat } from '@/features/chats/api/chats'
|
||||
import { createDispute } from '@/features/disputes'
|
||||
import { uploadFile } from '@/shared/api/files'
|
||||
import { formatMoney } from '@/shared/utils/money'
|
||||
import {
|
||||
acceptCheckout,
|
||||
cancelOrder,
|
||||
@@ -588,7 +589,7 @@ function readUnitPrice(priceText: string) {
|
||||
}
|
||||
|
||||
function roundMoney(value: number) {
|
||||
return Math.round(value)
|
||||
return Math.round(Number(value || 0) * 10) / 10
|
||||
}
|
||||
|
||||
function roundQuantity(value: number) {
|
||||
@@ -596,7 +597,7 @@ function roundQuantity(value: number) {
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return `${roundMoney(readNumber(value))}`
|
||||
return formatMoney(readNumber(value))
|
||||
}
|
||||
|
||||
function orderRentAmount(item: Order) {
|
||||
@@ -1252,7 +1253,7 @@ async function copyListingCode() {
|
||||
<div class="pay-summary">
|
||||
<div class="pay-summary-row">
|
||||
<span>支付金额</span>
|
||||
<strong>¥{{ (activePayment.amount_cent / 100).toFixed(2) }}</strong>
|
||||
<strong>¥{{ formatMoney(activePayment.amount_cent / 100) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="paymentPayURL()" class="pay-qr-section">
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { CopyDocument, Search } from '@element-plus/icons-vue'
|
||||
|
||||
import { fetchOrders, type Order } from '@/features/orders'
|
||||
import { formatMoney } from '@/shared/utils/money'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { orderStatusLabel } from '@/utils/statusLabels'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
@@ -139,7 +140,7 @@ function ownerActualIncome(order: Order) {
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return Math.round(Number(value || 0))
|
||||
return formatMoney(Number(value || 0))
|
||||
}
|
||||
|
||||
function shortenOrderNo(orderNo: string) {
|
||||
|
||||
Reference in New Issue
Block a user