From a497f8da1225cc5bcfb778f370ac024716190fec Mon Sep 17 00:00:00 2001 From: Germey Date: Mon, 1 Jan 2024 02:50:17 +0800 Subject: [PATCH] update console --- package.json | 3 +- src/components/chat/InputBox.vue | 4 +- src/components/common/ApiStatus.vue | 15 +- src/components/common/Navigator.vue | 12 +- src/components/common/Price.vue | 2 +- src/components/console/SidePanel.vue | 157 ++++++++++++ src/components/order/Create.vue | 180 ++++++++++++++ src/components/order/StripePay.vue | 93 +++++++ src/components/order/WechatPay.vue | 111 +++++++++ src/i18n/zh/application/field.ts | 1 + src/i18n/zh/console/index.ts | 5 + src/i18n/zh/console/menu.ts | 11 + src/i18n/zh/index.ts | 4 + src/i18n/zh/order/button.ts | 8 + src/i18n/zh/order/field.ts | 12 + src/i18n/zh/order/index.ts | 13 + src/i18n/zh/order/message.ts | 10 + src/i18n/zh/order/state.ts | 6 + src/i18n/zh/order/title.ts | 7 + src/layouts/Console.vue | 46 ++++ src/operators/index.ts | 1 + src/operators/order/index.ts | 2 + src/operators/order/models.ts | 33 +++ src/operators/order/operator.ts | 55 +++++ src/pages/chat/Conversation.vue | 6 +- src/pages/console/application/Buy.vue | 95 ++++++++ src/pages/console/application/List.vue | 241 ++++++++++++++++++ src/pages/console/order/Detail.vue | 325 +++++++++++++++++++++++++ src/pages/console/order/List.vue | 207 ++++++++++++++++ src/plugins/font-awesome.ts | 8 +- src/router/console.ts | 44 ++++ src/router/constants.ts | 6 + src/router/index.ts | 2 + yarn.lock | 100 +------- 34 files changed, 1713 insertions(+), 112 deletions(-) create mode 100644 src/components/console/SidePanel.vue create mode 100644 src/components/order/Create.vue create mode 100644 src/components/order/StripePay.vue create mode 100644 src/components/order/WechatPay.vue create mode 100644 src/i18n/zh/console/index.ts create mode 100644 src/i18n/zh/console/menu.ts create mode 100644 src/i18n/zh/order/button.ts create mode 100644 src/i18n/zh/order/field.ts create mode 100644 src/i18n/zh/order/index.ts create mode 100644 src/i18n/zh/order/message.ts create mode 100644 src/i18n/zh/order/state.ts create mode 100644 src/i18n/zh/order/title.ts create mode 100644 src/layouts/Console.vue create mode 100644 src/operators/order/index.ts create mode 100644 src/operators/order/models.ts create mode 100644 src/operators/order/operator.ts create mode 100644 src/pages/console/application/Buy.vue create mode 100644 src/pages/console/application/List.vue create mode 100644 src/pages/console/order/Detail.vue create mode 100644 src/pages/console/order/List.vue create mode 100644 src/router/console.ts diff --git a/package.json b/package.json index 0f3c81a..cbc8b97 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "zhishuyun-ai", + "name": "zhishuyun-hub", "version": "0.1.0", "scripts": { "start": "cross-env NODE_ENV=$npm_config_env vite --host", @@ -28,7 +28,6 @@ "@types/mustache": "^4.2.2", "@types/qs": "^6.9.9", "@types/uuid": "^8.3.4", - "@zhishuyun/data": "^0.1.0", "axios": "^0.22.0", "codemirror": "^6.0.1", "copy-to-clipboard": "^3.3.3", diff --git a/src/components/chat/InputBox.vue b/src/components/chat/InputBox.vue index e26038a..955d2df 100644 --- a/src/components/chat/InputBox.vue +++ b/src/components/chat/InputBox.vue @@ -142,7 +142,7 @@ export default defineComponent({ .el-upload-list { position: absolute; width: 400px; - bottom: 40px; + bottom: 45px; } } @@ -155,7 +155,7 @@ export default defineComponent({ border-radius: 10px; background: none; box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1); - top: 50px; + top: 30px; .upload { display: inline-block; &.disabled { diff --git a/src/components/common/ApiStatus.vue b/src/components/common/ApiStatus.vue index 0acea7a..c1acb64 100644 --- a/src/components/common/ApiStatus.vue +++ b/src/components/common/ApiStatus.vue @@ -12,7 +12,9 @@ {{ application?.remaining_amount }} - {{ $t('common.button.buyMore') }} + {{ + $t('common.button.buyMore') + }}
@@ -36,6 +38,7 @@ import { IApplicationType } from '@/operators'; import { apiOperator } from '@/operators/api/operator'; import { IApiDetailResponse, IApi } from '@/operators/api'; import { ERROR_CODE_DUPLICATION } from '@/constants/errorCode'; +import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router'; export interface IData { confirming: boolean; @@ -83,9 +86,13 @@ export default defineComponent({ this.api = data; }); }, - onBuy() { - const url = `https://data.zhishuyun.com/console/applications/${this.application?.id}/buy`; - window.open(url, '_blank'); + onBuyMore(application: IApplication) { + this.$router.push({ + name: ROUTE_CONSOLE_APPLICATION_BUY, + params: { + id: application.id + } + }); }, onApply() { applicationOperator diff --git a/src/components/common/Navigator.vue b/src/components/common/Navigator.vue index ec072ad..38a0443 100644 --- a/src/components/common/Navigator.vue +++ b/src/components/common/Navigator.vue @@ -11,13 +11,19 @@ @click="$router.push(link.route)" > -
+