Add currency auto transform (#83)
Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
1 parent
3f16b60071
commit
c83b4fcc9f
21 files changed
+245
-22
No files matched your search
@@ -32,9 +32,7 @@
|
||||
<price :price="package?.price" />
|
||||
<span v-if="package" class="ml-2"
|
||||
>({{
|
||||
$t('service.message.around') +
|
||||
' $' +
|
||||
(package?.price / package?.amount).toFixed(4) +
|
||||
getPriceString({ value: package?.price / package?.amount }) +
|
||||
' / ' +
|
||||
$t(`service.unit.${application?.service?.unit}`)
|
||||
}})
|
||||
@@ -46,7 +44,7 @@
|
||||
v-if="package"
|
||||
:class="{ price: true, unfree: package?.price > 0, free: package?.price === 0 }"
|
||||
>
|
||||
${{ package?.price?.toFixed(2) }}
|
||||
{{ getPriceString({ value: package?.price }) }}
|
||||
</span>
|
||||
<span v-else :class="{ price: true, free: true }"> $ 0 </span>
|
||||
</el-form-item>
|
||||
@@ -91,6 +89,7 @@ import {
|
||||
import { ROUTE_CONSOLE_ORDER_DETAIL } from '@/router';
|
||||
import Price from '@/components/common/Price.vue';
|
||||
import { applicationOperator, orderOperator } from '@/operators';
|
||||
import { getPriceString } from '@/utils';
|
||||
|
||||
interface IData {
|
||||
application: IApplication | undefined;
|
||||
@@ -152,6 +151,7 @@ export default defineComponent({
|
||||
this.onFetchApplication();
|
||||
},
|
||||
methods: {
|
||||
getPriceString,
|
||||
onFetchApplication() {
|
||||
this.loading = true;
|
||||
applicationOperator
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :label="$t('order.field.price')">
|
||||
<span v-if="order?.price && order?.price > 0" class="price unfree">
|
||||
${{ order?.price?.toFixed(2) }}
|
||||
{{ getPriceString({ value: order?.price }) }}
|
||||
</span>
|
||||
<span v-else class="price free"> {{ $t('order.message.free') }} </span>
|
||||
</el-descriptions-item>
|
||||
@@ -142,6 +142,7 @@ import {
|
||||
import WechatPayOrder from '@/components/order/WechatPay.vue';
|
||||
import StripePayOrder from '@/components/order/StripePay.vue';
|
||||
import { IApplicationType, IOrder, IOrderDetailResponse, OrderState } from '@/models';
|
||||
import { getPriceString } from '@/utils';
|
||||
|
||||
enum PayWay {
|
||||
WechatPay = 'WechatPay',
|
||||
@@ -216,6 +217,7 @@ export default defineComponent({
|
||||
this.onFetchData();
|
||||
},
|
||||
methods: {
|
||||
getPriceString,
|
||||
onFetchData() {
|
||||
this.loading = true;
|
||||
orderOperator
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('order.field.price')" width="100px">
|
||||
<template #default="scope">
|
||||
<span class="price">${{ scope.row?.price?.toFixed(2) }}</span>
|
||||
<span class="price">{{ getPriceString({ value: scope.row?.price }) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" :label="$t('order.field.state')" class-name="text-center" width="150px">
|
||||
@@ -108,6 +108,7 @@ import Pagination from '@/components/common/Pagination.vue';
|
||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
||||
import { ElRow, ElCol, ElTable, ElTableColumn, ElButton, ElTag, ElCard } from 'element-plus';
|
||||
import { IOrder, IOrderListResponse, OrderState } from '@/models';
|
||||
import { getPriceString } from '@/utils';
|
||||
|
||||
interface IData {
|
||||
orders: IOrder[];
|
||||
@@ -159,6 +160,7 @@ export default defineComponent({
|
||||
this.onFetchData();
|
||||
},
|
||||
methods: {
|
||||
getPriceString,
|
||||
onPageChange(page: number) {
|
||||
this.$router.push({
|
||||
name: this.$route.name?.toString(),
|
||||
|
||||
Reference in new issue
Block a user