Update application UX (#232)
This commit is contained in:
1 parent
26ad4cf011
commit
83a5746874
14 files changed
+155
-118
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"type": "patch",
|
||||||
|
"comment": "update wallet ux",
|
||||||
|
"packageName": "@acedatacloud/nexior",
|
||||||
|
"email": "cqc@cuiqingcai.com",
|
||||||
|
"dependentChangeType": "patch"
|
||||||
|
}
|
||||||
@@ -1,43 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-descriptions :column="1" class="flex flex-col">
|
<div>
|
||||||
<el-descriptions-item v-if="application.scope === 'Individual'" :label="$t('application.field.serviceName')">{{
|
<div class="flex flex-col">
|
||||||
application.service?.title
|
<el-icon class="check"><check /></el-icon>
|
||||||
}}</el-descriptions-item>
|
<div class="icon">
|
||||||
<el-descriptions-item :label="$t('application.field.id')">
|
<font-awesome-icon icon="fa-solid fa-wallet" />
|
||||||
<span>{{ application.id }}</span>
|
</div>
|
||||||
<copy-to-clipboard v-if="application.id" :content="application.id" />
|
<div class="text-left">
|
||||||
</el-descriptions-item>
|
<p class="description">
|
||||||
<el-descriptions-item :label="$t('application.field.type')">
|
<span v-if="!application.service">{{ $t('application.title.globalBalance') }}</span>
|
||||||
<el-tag v-if="application.type === 'Period'" effect="dark" round>
|
<span v-else>{{ $t('application.title.applicationBalance', { service: application.service?.title }) }}</span>
|
||||||
{{ $t('application.type.period') }}
|
</p>
|
||||||
</el-tag>
|
<p class="value">
|
||||||
<el-tag v-if="application.type === 'Usage'" effect="dark" round>
|
{{ application?.remaining_amount?.toFixed(6) }}
|
||||||
{{ $t('application.type.usage') }}
|
{{ $t(`service.unit.` + (application?.service?.unit || 'credit') + 's') }}
|
||||||
</el-tag>
|
</p>
|
||||||
</el-descriptions-item>
|
<p class="description2">
|
||||||
<el-descriptions-item v-if="application.type === 'Period'" :label="$t('application.field.expiredAt')">
|
<span v-if="application.type === 'Period'">
|
||||||
{{ $dayjs.format(application.expired_at) }}
|
{{ $t('application.field.expiredAt') }}: {{ $dayjs.format(application.expired_at) }}
|
||||||
</el-descriptions-item>
|
</span>
|
||||||
<el-descriptions-item :label="$t('application.field.remainingAmount')">
|
<span v-else>
|
||||||
{{ application?.remaining_amount?.toFixed(6) }}
|
{{ $t('application.message.neverExpire') }}
|
||||||
{{ $t(`service.unit.` + (application?.service?.unit || 'credit') + 's') }}
|
</span>
|
||||||
</el-descriptions-item>
|
</p>
|
||||||
</el-descriptions>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col justify-center align-middle gap-2">
|
||||||
|
<div class="flex">
|
||||||
|
<el-button size="small" round @click="onGoUsage">
|
||||||
|
{{ $t('application.button.usage') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="flex">
|
||||||
|
<el-button type="primary" round size="small" @click="onBuyMore">
|
||||||
|
{{ $t('application.button.buyMore') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { IApplication } from '@/models';
|
import { IApplication } from '@/models';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElTag, ElDescriptions, ElDescriptionsItem } from 'element-plus';
|
import { ElButton, ElIcon } from 'element-plus';
|
||||||
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
|
import { ROUTE_CONSOLE_APPLICATION_EXTRA, ROUTE_CONSOLE_USAGE_LIST } from '@/router';
|
||||||
|
import { Check } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ApplicationInfo',
|
name: 'ApplicationInfo',
|
||||||
components: {
|
components: {
|
||||||
ElTag,
|
FontAwesomeIcon,
|
||||||
CopyToClipboard,
|
ElButton,
|
||||||
ElDescriptions,
|
Check,
|
||||||
ElDescriptionsItem
|
ElIcon
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
application: {
|
application: {
|
||||||
@@ -52,19 +68,83 @@ export default defineComponent({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onGoUsage() {
|
||||||
|
this.$router.push({
|
||||||
|
name: ROUTE_CONSOLE_USAGE_LIST,
|
||||||
|
query: {
|
||||||
|
application_id: this.application.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onBuyMore() {
|
||||||
|
// open in new tab for this url
|
||||||
|
const url = this.$router.resolve({
|
||||||
|
name: ROUTE_CONSOLE_APPLICATION_EXTRA,
|
||||||
|
params: {
|
||||||
|
id: this.application.id
|
||||||
|
}
|
||||||
|
}).href;
|
||||||
|
window.open(url, '_blank');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.info {
|
.item {
|
||||||
font-size: 13px;
|
cursor: pointer;
|
||||||
color: var(--el-text-color-primary);
|
padding: 20px;
|
||||||
text-align: center;
|
width: 400px;
|
||||||
line-height: 28px;
|
background-color: var(--el-bg-color);
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid var(--el-border-color-lighter);
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
&.active {
|
||||||
|
.check {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.subtitle {
|
|
||||||
font-size: 12px;
|
.check {
|
||||||
|
color: var(--el-color-white);
|
||||||
|
font-size: 20px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 5px;
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
height: 40px;
|
||||||
|
width: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--el-bg-color-page);
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
.description {
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.description2 {
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 12px;
|
||||||
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,34 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<el-dialog v-model="showInfo" width="600px">
|
<el-dialog v-model="showInfo">
|
||||||
<div v-if="application">
|
<div v-if="application">
|
||||||
<p class="text-left mb-4">
|
<p class="text-center mb-4">
|
||||||
{{ $t('application.message.applicationSelection') }}
|
{{ $t('application.message.applicationSelection') }}
|
||||||
</p>
|
</p>
|
||||||
<div class="applications flex flex-col gap-2 mb-6">
|
<div class="flex flex-col gap-4 mb-6 justify-center items-center overflow-y-auto">
|
||||||
<div
|
<application-info
|
||||||
v-for="(app, index) in applications"
|
v-for="(app, index) in applications"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="{
|
:class="{
|
||||||
item: true,
|
item: true,
|
||||||
active: application?.id === app.id
|
active: application?.id === app.id
|
||||||
}"
|
}"
|
||||||
|
:application="app"
|
||||||
@click="onSelectApplication(app)"
|
@click="onSelectApplication(app)"
|
||||||
>
|
|
||||||
<el-icon class="icon"><check /></el-icon>
|
|
||||||
<application-info :application="app" :show-type="true" :show-id="true" />
|
|
||||||
<el-button round type="primary" @click.stop="onBuyMore(application)">{{
|
|
||||||
$t('common.button.buyMore')
|
|
||||||
}}</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<span class="actions">
|
|
||||||
<api-price
|
|
||||||
v-if="showPrice && application?.service?.apis?.[0]?.price"
|
|
||||||
class="price inline-block"
|
|
||||||
:price="application?.service?.apis?.[0]?.price"
|
|
||||||
/>
|
/>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-button circle @click="showInfo = true">
|
<el-button circle @click="showInfo = true">
|
||||||
@@ -39,11 +27,9 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ElButton, ElIcon, ElDialog, ElTooltip } from 'element-plus';
|
import { ElButton, ElDialog } from 'element-plus';
|
||||||
import { IApplicationType, IApplication, IService } from '@/models';
|
import { IApplicationType, IApplication, IService } from '@/models';
|
||||||
import { ROUTE_CONSOLE_APPLICATION_EXTRA, ROUTE_CONSOLE_APPLICATION_SUBSCRIBE } from '@/router';
|
import { ROUTE_CONSOLE_APPLICATION_EXTRA, ROUTE_CONSOLE_APPLICATION_SUBSCRIBE } from '@/router';
|
||||||
import ApiPrice from '@/components/api/Price.vue';
|
|
||||||
import { Check } from '@element-plus/icons-vue';
|
|
||||||
import ApplicationInfo from './Info.vue';
|
import ApplicationInfo from './Info.vue';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||||
|
|
||||||
@@ -56,12 +42,9 @@ export default defineComponent({
|
|||||||
name: 'ApplicationStatus',
|
name: 'ApplicationStatus',
|
||||||
components: {
|
components: {
|
||||||
ElButton,
|
ElButton,
|
||||||
Check,
|
|
||||||
ElDialog,
|
ElDialog,
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
ApplicationInfo,
|
ApplicationInfo
|
||||||
ApiPrice,
|
|
||||||
ElIcon
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
application: {
|
application: {
|
||||||
@@ -113,49 +96,3 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.applications {
|
|
||||||
.item {
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 20px;
|
|
||||||
background-color: var(--el-bg-color);
|
|
||||||
border-radius: 15px;
|
|
||||||
border: 1px solid var(--el-border-color-lighter);
|
|
||||||
.icon {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
&.active {
|
|
||||||
.icon {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 30px;
|
|
||||||
.icon {
|
|
||||||
color: var(--el-color-white);
|
|
||||||
font-size: 20px;
|
|
||||||
background-color: var(--el-color-primary);
|
|
||||||
border-radius: 50%;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions {
|
|
||||||
margin: 0 5px;
|
|
||||||
display: inline-block;
|
|
||||||
@media (max-width: 767px) {
|
|
||||||
display: block;
|
|
||||||
margin: 5px auto 0 auto;
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btn-apply {
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -105,7 +105,7 @@ export default defineComponent({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$width: 300px;
|
$width: 200px;
|
||||||
$padding-left: 10px;
|
$padding-left: 10px;
|
||||||
.side-panel {
|
.side-panel {
|
||||||
padding-left: $padding-left;
|
padding-left: $padding-left;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@
|
|||||||
"message": "价格",
|
"message": "价格",
|
||||||
"description": "用户应支付的申请的额外价格。"
|
"description": "用户应支付的申请的额外价格。"
|
||||||
},
|
},
|
||||||
|
|
||||||
"message.alreadyApplied": {
|
"message.alreadyApplied": {
|
||||||
"message": "您已经申请了此服务,请查看控制台",
|
"message": "您已经申请了此服务,请查看控制台",
|
||||||
"description": "当用户已经申请了此服务时向用户显示的消息。"
|
"description": "当用户已经申请了此服务时向用户显示的消息。"
|
||||||
@@ -211,6 +212,10 @@
|
|||||||
"message": "修改成功",
|
"message": "修改成功",
|
||||||
"description": "当修改成功时向用户显示的消息。"
|
"description": "当修改成功时向用户显示的消息。"
|
||||||
},
|
},
|
||||||
|
"message.neverExpire": {
|
||||||
|
"message": "永不过期",
|
||||||
|
"description": "当申请永不过期时向用户显示的消息。"
|
||||||
|
},
|
||||||
"title.buyService": {
|
"title.buyService": {
|
||||||
"message": "购买服务",
|
"message": "购买服务",
|
||||||
"description": "当用户想要购买服务时页面的标题。"
|
"description": "当用户想要购买服务时页面的标题。"
|
||||||
@@ -226,5 +231,13 @@
|
|||||||
"title.manageApplication": {
|
"title.manageApplication": {
|
||||||
"message": "申请管理",
|
"message": "申请管理",
|
||||||
"description": "当用户想要管理申请时页面的标题。"
|
"description": "当用户想要管理申请时页面的标题。"
|
||||||
|
},
|
||||||
|
"title.applicationBalance": {
|
||||||
|
"message": "专属积分 - {service}",
|
||||||
|
"description": "当用户查看申请余额时向用户显示的消息。"
|
||||||
|
},
|
||||||
|
"title.globalBalance": {
|
||||||
|
"message": "通用余额",
|
||||||
|
"description": "当用户查看通用余额时向用户显示的消息。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
|
|
||||||
.el-card {
|
.el-card {
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ export default defineComponent({
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ export default defineComponent({
|
|||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
.el-card {
|
.el-card {
|
||||||
min-height: 500px;
|
min-height: 500px;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ export default defineComponent({
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ export default defineComponent({
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
width: calc(100% - 300px);
|
width: calc(100% - 200px);
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
|||||||
Reference in new issue
Block a user