Fix experience bugs (#9)

This commit is contained in:
AceDataCloud committed 2024-03-24 23:27:13 +08:00
1 parent c300500135
commit b35d5a926a
260 files changed
+36865 -16290

No files matched your search

+11
View File
@@ -46,6 +46,7 @@
size="large"
class="btn-create"
:loading="creating"
round
@click="onCreateOrder"
>
{{ $t('application.button.createOrder') }}
@@ -206,6 +207,16 @@ export default defineComponent({
.el-card {
padding: 50px 0;
.price {
font-size: 20px;
font-weight: bold;
&.unfree {
color: #ff5441;
}
&.free {
color: #29c287;
}
}
}
}
+12 -2
View File
@@ -16,7 +16,7 @@
table-layout="fixed"
:empty-text="$t('common.message.noData')"
>
<el-table-column prop="id" :label="$t('application.field.id')" width="220px" class-name="text-center">
<el-table-column prop="id" :label="$t('application.field.id')" width="240px" class-name="text-center">
<template #default="scope">
<span>{{ scope.row.id }}</span>
<span class="copy">
@@ -49,6 +49,15 @@
<span>{{ getUsedAmount(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" width="360px">
<template #default="scope">
<div class="float-right">
<el-button type="primary" size="small" @click="onBuyMore(scope?.row)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
@@ -69,7 +78,7 @@ import { defineComponent } from 'vue';
import { applicationOperator } from '@/operators';
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import { ElTable, ElRow, ElCol, ElTableColumn, ElCard } from 'element-plus';
import { ElTable, ElRow, ElCol, ElTableColumn, ElCard, ElButton } from 'element-plus';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router/constants';
import { IApplication, IApplicationListResponse, ICredentialType, IService } from '@/models';
@@ -96,6 +105,7 @@ export default defineComponent({
CopyToClipboard,
ElTable,
ElRow,
ElButton,
ElCol,
ElTableColumn,
ElCard
+13 -25
View File
@@ -10,62 +10,50 @@
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="12" :offset="6">
<el-col :span="14" :offset="5">
<div v-if="loading" class="pt-5">
<el-skeleton animated />
</div>
<div v-else class="order">
<el-descriptions :column="1">
<el-descriptions-item :label="$t('order.field.id')">{{ order?.id }}</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.id')">
<span>{{ order?.id }} </span>
<copy-to-clipboard v-if="order?.id" :content="order?.id" class="inline-block" />
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.description')">
{{ order?.description }}
</el-descriptions-item>
<el-descriptions-item
v-if="order?.application?.type === applicationType.API"
:label="$t('order.field.api')"
>
{{ order?.application?.api?.title }}
<el-descriptions-item v-if="order?.application?.service" :label="$t('order.field.api')">
{{ order?.application?.service?.title }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.amount')">
<span v-if="order?.application?.type === applicationType.API">
{{ order?.amount }}{{ $t(`api.unit.${order?.application?.api?.unit}`) }}
</span>
{{ order?.amount }} {{ $t(`service.unit.${order?.application?.service?.unit}`) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.createdAt')">
{{ $dayjs.format(order?.created_at) }}
</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) }}
${{ order?.price?.toFixed(2) }}
</span>
<span v-else class="price free"> {{ $t('order.message.free') }} </span>
</el-descriptions-item>
<el-descriptions-item v-if="order?.pay_way" :label="$t('order.field.payWay')">
<span v-if="order?.pay_way === PayWay.WechatPay">
{{ $t('order.title.wechatPay') }}
</span>
<span v-if="order?.pay_way === PayWay.AliPay">
{{ $t('order.title.aliPay') }}
</span>
<span v-if="order?.pay_way === PayWay.Stripe">
{{ $t('order.title.stripe') }}
</span>
</el-descriptions-item>
</el-descriptions>
</div>
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PAID" class="mb-5">
<el-col :span="12" :offset="6">
<el-col :span="14" :offset="5">
<el-divider border-style="dashed" />
<el-alert :title="$t('order.message.paidSuccessfully')" type="success" show-icon :closable="false" />
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PENDING || order?.state === OrderState.FAILED">
<el-col :span="12" :offset="6">
<el-col :span="14" :offset="5">
<el-divider border-style="dashed" />
<div v-if="order.price && order.price > 0 && !order.pay_way" class="payways mb-4">
<div
v-if="false"
:class="{
payway: true,
wechatpay: true,
@@ -180,7 +168,7 @@ export default defineComponent({
data(): IData {
return {
PayWay: PayWay,
payWay: PayWay.WechatPay,
payWay: PayWay.Stripe,
OrderState: OrderState,
order: undefined,
loading: false,
+2
View File
@@ -55,6 +55,7 @@
<el-button
v-if="scope.row.state !== OrderState.PAID"
type="primary"
size="small"
@click="
$router.push({
name: 'console-order-detail',
@@ -68,6 +69,7 @@
</el-button>
<el-button
v-else
size="small"
@click="
$router.push({
name: 'console-order-detail',